Node documentation

The node.

This file is part of python-openzwave project https://github.com/OpenZWave/python-openzwave.
platform:Unix, Windows, MacOS X
sinopsis:openzwave API

License : GPL(v3)

python-openzwave is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

python-openzwave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with python-openzwave. If not, see http://www.gnu.org/licenses.

class openzwave.node.ZWaveNode(node_id, network)

Represents a single Node within the Z-Wave Network.

add_value(value_id)

Add a value to the node

Parameters:
  • value_id (int) – The id of the value to add
  • command_class (str) – The command_class of the value
Return type:

bool

assign_return_route()

Ask the to update its update its Return Route to the Controller

This command will ask a Node to update its Return Route to the Controller

Results of the AssignReturnRoute Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Returns:True if the request was sent successfully.
Return type:bool
basic

The basic type of the node.

Return type:int
capabilities

The capabilities of the node.

Return type:set()
change_value(value_id)

Change a value of the node. Not implemented

Parameters:value_id (int) – The id of the value to change
command_classes

The commandClasses of the node.

Return type:set()
command_classes_as_string

Return the command classes of the node as string.

Return type:set()
create_button(buttonid)

Create a handheld button id.

Only intended for Bridge Firmware Controllers.

Results of the CreateButton Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Parameters:buttonid (int) – the ID of the Button to query.
Returns:True if the request was sent successfully.
Return type:bool
delete_button(buttonid)

Delete a handheld button id.

Only intended for Bridge Firmware Controllers.

Results of the CreateButton Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Parameters:buttonid (int) – the ID of the Button to query.
Returns:True if the request was sent successfully.
Return type:bool
device_type

The device_type of the node.

Return type:str
generic

The generic type of the node.

Return type:int
get_command_class_as_string(class_id)

Return the command class representation as string.

Parameters:class_id (hexadecimal code) – the COMMAND_CLASS to get string representation
Return type:str
get_command_class_genres()

Return the list of genres of command classes

Return type:set()
get_max_associations(groupidx)

Gets the maximum number of associations for a group.

Parameters:groupidx (int) – The group to query
Return type:int
get_values(class_id='All', genre='All', type='All', readonly='All', writeonly='All', index='All', label='All')

Retrieve the set of values. You can optionnaly filter for a command class, a genre and/or a type. You can also filter readonly and writeonly params.

This method always filter the values. If you wan’t to get all the node’s values, use self.values instead.

Parameters:
  • class_id (hexadecimal code or string) – the COMMAND_CLASS to get values
  • genre ('All' or PyGenres) – the genre of value
  • type ('All' or PyValueTypes) – the type of value
  • readonly ('All' or True or False) – Is this value readonly
  • writeonly ('All' or True or False) – Is this value writeonly
  • index (int) – Index of value within all the values
  • label (str) – Label of the value as set by openzwave
Return type:

set() of Values

get_values_by_command_classes(genre='All', type='All', readonly='All', writeonly='All')

Retrieve values in a dict() of dicts(). The dict is indexed on the COMMAND_CLASS. This allows to browse values grouped by the COMMAND_CLASS.You can optionnaly filter for a command class, a genre and/or a type. You can also filter readonly and writeonly params.

This method always filter the values. If you wan’t to get all the node’s values, use the property self.values instead.

Parameters:
  • genre ('All' or PyGenres) – the genre of value
  • type ('All' or PyValueTypes) – the type of value
  • readonly ('All' or True or False) – Is this value readonly
  • writeonly ('All' or True or False) – Is this value writeonly
Return type:

dict(command_class : dict(valueids))

get_values_for_command_class(class_id)

Retrieve the set of values for a command class. Deprecated For backward compatibility only. Use get_values instead

Parameters:class_id (hexadecimal code or string) – the COMMAND_CLASS to get values
Return type:set() of classId
groups

Get the association groups reported by this node

In Z-Wave, groups are numbered starting from one. For example, if a call to GetNumGroups returns 4, the _groupIdx value to use in calls to GetAssociations AddAssociation and RemoveAssociation will be a number between 1 and 4.

Return type:dict()
groups_to_dict(extras=['all'])

Return a dict representation of the groups.

Parameters:extras ([]) – The extra inforamtions to add
Returns:A dict
Return type:dict()
has_command_class(class_id)

Check that this node use this commandClass.

Parameters:classId (hexadecimal code) – the COMMAND_CLASS to check
Return type:bool
heal(upNodeRoute=False)

Heal network node by requesting the node rediscover their neighbors. Sends a ControllerCommand_RequestNodeNeighborUpdate to the node.

Parameters:upNodeRoute (bool) – Optional Whether to perform return routes initialization. (default = false).
Returns:True is the ControllerCommand is sent. False otherwise
Return type:bool
is_awake

Is this node a awake.

Return type:bool
is_beaming_device

Is this node a beaming device.

Return type:bool
is_failed

Is this node is presume failed.

Return type:bool
is_frequent_listening_device

Is this node a frequent listening device.

Return type:bool
is_info_received

Get whether the node information has been received. Returns True if the node information has been received yet

Return type:bool
is_listening_device

Is this node a listening device.

Return type:bool
is_locked

Is this node locked.

Return type:bool
is_ready

Get whether the node is ready to operate (QueryStage Completed).

Return type:bool
is_routing_device

Is this node a routing device.

Return type:bool
is_security_device

Is this node a security device.

Return type:bool
is_sleeping

Is this node sleeping.

Return type:bool
is_zwave_plus

Is this node a zwave plus one.

Return type:bool
location

The location of the node.

Return type:str
manufacturer_id

The manufacturer id of the node.

Return type:str
manufacturer_name

The manufacturer name of the node.

Return type:str
max_baud_rate

Get the maximum baud rate of a node

name

The name of the node.

Return type:str
neighbor_update()

Ask a Node to update its Neighbor Tables

This command will ask a Node to update its Neighbor Tables.

Results of the RequestNodeNeighborUpdate Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Returns:True if the request was sent successfully.
Return type:bool
neighbors

The neighbors of the node.

Return type:set()
network_update()

Update the controller with network information from the SUC/SIS.

Results of the RequestNetworkUpdate Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Returns:True if the request was sent successfully.
Return type:bool
node_id

The id of the node.

Return type:int
num_groups

Gets the number of association groups reported by this node.

Return type:int
product_id

The product Id of the node.

Return type:str
product_name

The product name of the node.

Return type:str
product_type

The product type of the node.

Return type:str
query_stage

Is this node a awake.

Return type:string
refresh_info()

Trigger the fetching of fixed data about a node.

Causes the nodes data to be obtained from the Z-Wave network in the same way as if it had just been added. This method would normally be called automatically by OpenZWave, but if you know that a node has been changed, calling this method will force a refresh of the data held by the library. This can be especially useful for devices that were asleep when the application was first run.

Return type:bool
refresh_value(value_id)

Refresh a value of the node. Not implemented

Parameters:value_id (int) – The id of the value to change
remove_value(value_id)

Change a value of the node. Todo

Parameters:value_id (int) – The id of the value to change
Returns:The result of the operation
Return type:bool
request_all_config_params()

Request the values of all known configurable parameters from a device.

request_config_param(param)

Request the value of a configurable parameter from a device.

Some devices have various parameters that can be configured to control the device behaviour. These are not reported by the device over the Z-Wave network but can usually be found in the devices user manual. This method requests the value of a parameter from the device, and then returns immediately, without waiting for a response. If the parameter index is valid for this device, and the device is awake, the value will eventually be reported via a ValueChanged notification callback. The ValueID reported in the callback will have an index set the same as _param and a command class set to the same value as returned by a call to Configuration::StaticGetCommandClassId.

Parameters:param – The param of the node.
request_state()

Trigger the fetching of just the dynamic value data for a node. Causes the node’s values to be requested from the Z-Wave network. This is the same as the query state starting from the dynamic state.

Return type:bool
role

The role of the node.

Return type:str
security

The security type of the node.

Returns:The security type of the node
Return type:int
send_information()

Send a NIF frame from the Controller to a Node. This command send a NIF frame from the Controller to a Node

Results of the SendNodeInformation Command will be send as a Notification with the Notification type as Notification::Type_ControllerCommand

Returns:True if the request was sent successfully.
Return type:bool
set_config_param(param, value, size=2)

Set the value of a configurable parameter in a device.

Some devices have various parameters that can be configured to control the device behaviour. These are not reported by the device over the Z-Wave network but can usually be found in the devices user manual. This method returns immediately, without waiting for confirmation from the device that the change has been made.

Parameters:
  • param – The param of the node.
  • value – The value of the param.
  • size (int) – Is an optional number of bytes to be sent for the parameter value. Defaults to 2.
Returns:

Return type:

bool

set_field(field, value)

A helper to set a writable field : name, location, product_name, ...

Parameters:
  • field (str) – The field to set : name, location, product_name, manufacturer_name
  • value (str) – The value to set
Return type:

bool

specific

The specific type of the node.

Returns:The specific type of the node
Return type:int
test(count=1)

Send a number of test messages to node and record results.

Parameters:count (int) – The number of test messages to send.
to_dict(extras=['all'])

Return a dict representation of the node.

Parameters:extras ([]) – The extra inforamtions to add
Returns:A dict
Return type:dict()
type

Get a human-readable label describing the node :rtype: str

values_to_dict(extras=['all'])

Return a dict representation of the values.

Parameters:extras ([]) – The extra inforamtions to add
Returns:A dict
Return type:dict()
version

The version of the node.

Returns:The version of the node
Return type:int