platypush.plugins.zwave

class platypush.plugins.zwave.ZwavePlugin(**kwargs)[source]

This plugin interacts with the devices on a Z-Wave network started through the platypush.backend.zwave.ZwaveBackend backend.

Requires:

activate_scene(scene_id: Optional[int] = None, scene_label: Optional[str] = None)[source]

Activate a scene.

Parameters:
  • scene_id – Select by scene_id.
  • scene_label – Select by scene label.
add_node(do_security=False)[source]

Start the inclusion process to add a node to the network.

Parameters:do_security – Whether to initialize the Network Key on the device if it supports the Security CC
add_node_to_group(group_index: Optional[int] = None, group_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Add a node to a group.

Parameters:
  • group_index – Select group by group index.
  • group_label – Select group by group label.
  • node_id – Select node by node_id.
  • node_name – Select node by node name.
Returns:

cancel_command()[source]

Cancel the current running command.

create_button(button_id: Union[int, str], node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Create a handheld button on a device. Only intended for bridge firmware controllers.

Parameters:
  • button_id – The ID of the button.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
create_new_primary()[source]

Create a new primary controller on the network when the previous primary fails.

create_scene(label: str)[source]

Create a new scene.

Parameters:label – Scene label.
delete_button(button_id: Union[int, str], node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Delete a button association from a device. Only intended for bridge firmware controllers.

Parameters:
  • button_id – The ID of the button.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
get_battery_levels(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the battery levels of a node or of all the nodes on the network.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_bulbs(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the bulbs/LEDs on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_capabilities() → List[str][source]

Get the capabilities of the controller.

get_dimmers(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the dimmers on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
get_doorlocks(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the doorlocks on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_groups() → Dict[int, Any][source]

Get the groups on the network.

get_node_config(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the configuration values of a node or of all the nodes on the network.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
get_node_stats(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[str, Any][source]

Get the statistics of a node on the network.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
get_nodes(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[str, Any][source]

Get the nodes associated to the network.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
get_power_levels(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the power levels of this node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_protections(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the protection-compatible devices on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_scene_values(scene_id: Optional[int] = None, scene_label: Optional[str] = None) → dict[source]

Get the values associated to a scene.

Parameters:
  • scene_id – Select by scene_id.
  • scene_label – Select by scene label.
get_scenes() → Dict[str, Any][source]

Get the scenes configured on the network.

get_sensors(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the sensors on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_switches(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the switches on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_thermostats(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the thermostats on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_usercodes(node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[int, Any][source]

Get the usercodes on the network or associated to a node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by name.
get_value(value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None) → Dict[str, Any][source]

Get a value on the network.

Parameters:
  • value_id – Select by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select value by [node_id/node_name, value_label]
  • node_name – Select value by [node_id/node_name, value_label]
hard_reset()[source]

Perform a hard reset of the controller. It erases its network configuration settings. The controller becomes a primary controller ready to add devices to a new network.

heal(refresh_routes: bool = False)[source]

Heal network by requesting nodes rediscover their neighbors.

Parameters:refresh_routes – Whether to perform return routes initialization (default: False).
kill_command()[source]

Immediately terminate any running command on the controller and release the lock.

node_add_value(value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Add a value to a node.

Parameters:
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by label.
  • node_id – Select node by node_id.
  • node_name – Select node by label.
node_heal(node_id: Optional[int] = None, node_name: Optional[str] = None, refresh_routes: bool = False)[source]

Heal network node by requesting the node to rediscover their neighbours.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
  • refresh_routes – Whether to perform return routes initialization. (default: False).
node_network_update(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Update the controller with network information.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
node_refresh_info(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Fetch up-to-date information about the node.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
node_remove_value(value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Remove a value from a node.

Parameters:
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select node by node_id.
  • node_name – Select node by label.
node_update_neighbours(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Ask a node to update its neighbours table.

Parameters:
  • node_id – Select node by node_id.
  • node_name – Select node by label.
receive_configuration()[source]

Receive the configuration from the primary controller on the network. Requires a primary controller active.

remove_failed_node(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Remove a failed node from the network.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
remove_node()[source]

Remove a node from the network.

remove_node_from_group(group_index: Optional[int] = None, group_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Remove a node from a group.

Parameters:
  • group_index – Select group by group index.
  • group_label – Select group by group label.
  • node_id – Select node by node_id.
  • node_name – Select node by node name.
Returns:

remove_scene(scene_id: Optional[int] = None, scene_label: Optional[str] = None)[source]

Remove a scene.

Parameters:
  • scene_id – Select by scene_id.
  • scene_label – Select by scene label.
replace_failed_node(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Replace a failed node on the network.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
replication_send(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Send node information from the primary to the secondary controller.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
request_network_update(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Request a network update to a node.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
request_node_neighbour_update(node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Request a neighbours list update to a node.

Parameters:
  • node_id – Filter by node_id.
  • node_name – Filter by node name.
scene_add_value(data: Optional[Any] = None, value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, scene_id: Optional[int] = None, scene_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Add a value to a scene.

WARNING: This method actually doesn’t work, by own admission of the :ref:`OpenZWave developer <https://github.com/OpenZWave/python-openzwave/blob/master/src-lib/libopenzwave/libopenzwave.pyx#L4730>`_

Parameters:
  • data – Data to set for the value (default: current value data).
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select value by [node_id/node_name, value_label]
  • node_name – Select value by [node_id/node_name, value_label]
  • scene_id – Select scene by scene_id.
  • scene_label – Select scene by scene label.
scene_remove_value(value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, scene_id: Optional[int] = None, scene_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Remove a value from a scene.

Parameters:
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select value by [node_id/node_name, value_label]
  • node_name – Select value by [node_id/node_name, value_label]
  • scene_id – Select scene by scene_id.
  • scene_label – Select scene by scene label.
set_controller_name(name: str)[source]

Set the name of the controller on the network.

Parameters:name – New controller name.
set_node_location(location: str, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Set the location of a node.

Parameters:
  • location – Node location.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
set_node_manufacturer_name(manufacturer_name: str, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Set the manufacturer name of a node.

Parameters:
  • manufacturer_name – Manufacturer name.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
set_node_name(new_name: str, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Rename a node on the network.

Parameters:
  • new_name – New name for the node.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
set_node_product_name(product_name: str, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Set the product name of a node.

Parameters:
  • product_name – Product name.
  • node_id – Filter by node_id.
  • node_name – Filter by current node name.
set_scene_label(new_label: str, scene_id: Optional[int] = None, scene_label: Optional[str] = None)[source]

Rename a scene/set the scene label.

Parameters:
  • new_label – New label.
  • scene_id – Select by scene_id.
  • scene_label – Select by current scene label.
set_value(data, value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Set a value.

Parameters:
  • data – Data to set for the value.
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select value by [node_id/node_name, value_label]
  • node_name – Select value by [node_id/node_name, value_label]
set_value_label(new_label: str, value_id: Optional[int] = None, id_on_network: Optional[str] = None, value_label: Optional[str] = None, node_id: Optional[int] = None, node_name: Optional[str] = None)[source]

Change the label/name of a value.

Parameters:
  • new_label – New value label.
  • value_id – Select value by value_id.
  • id_on_network – Select value by id_on_network.
  • value_label – Select value by [node_id/node_name, value_label]
  • node_id – Select value by [node_id/node_name, value_label]
  • node_name – Select value by [node_id/node_name, value_label]
soft_reset()[source]

Perform a soft reset of the controller. Resets a controller without erasing its network configuration settings.

status() → Dict[str, Any][source]

Get the status of the controller. :return: dict

switch_all(state: bool)[source]

Switch all the connected devices on/off.

Parameters:state – True (switch on) or False (switch off).
test(count: int = 1)[source]

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

Parameters:count – The number of test messages to send.
transfer_primary_role()[source]

Add a new controller to the network and make it the primary. The existing primary will become a secondary controller.

write_config()[source]

Store the current configuration of the network to the user directory.