subscribe to our Youtube


14455 questions

17168 answers


0 members

We are migrating to our new platform at Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
2,008 views 3 comments
by anonymous

Got a RUT955 and found free time to fidle with it yesterday.

Set up the build environment and built packages for my zwave daemon, and found it very easy. Nice job with the open part guys!

Set up an package archive for opkg. You can use it as it is if you like.

src alleato-all

Add the above line to a config file in /etc/opkg, run opkg update and just install with opkg install zwaved.

You also need to have a MQTT broker alive on the RUT, so activate it. Also a ZWave dongle is needed, anyone will do. O, and modify the start script to get the correct /dev/ttyXXXYY. It's not correct at the moment.

In order for local listening and publishing install mosquitto-client.

If you are interested I can add a short manual for the daemon. I only add it if anybody are interested, so please shout.

1 Answer

0 votes
by anonymous

Very nice to hear !

You are very welcome to share a manual, it might even be uploaded on the wiki page later.
Best answer
by anonymous

Can I send it somewhere?

It's too big and do not fit into 12000 characters.
by anonymous

Things to know:

h1. ZWAVE daemon


h2. Background

The zwave daemon is used to communicate with zwave devices using mqtt.
More than one device is possible to use.

h2. Directory organization

h2. Dependencies

An MQTT broker is mandatory. It might be set up on a different machine.

h2. Start and stop

Usage: zwaved -D <device> -N <name>  [OPTION]

* -D, --device=DEVICE  Serial device
* -N, --name=NAME      Name to use on MQTT

These options may be used if needed:
* -H, --host           Host name, default localhost
* -p, --port           Port number, default 1883
* -d, --daemon         Daemonize
* -h, --help           Print this help
* -v, --version        Print version information
* -l, --log=LEVEL      Loglevel wanted (0-7)

h2. Using zwaved

h3. Setup

* Three command windows:
** Mosquitto running in command line. <pre>mosquitto</pre>
** Listener running <pre>mosquitto_sub -v -t \#</pre>
** Command line to run "mosquitto_pub" in

h3. Network commands

Commands in this category is used to communicate with the local controller

h4. remove_failed_node_id

Removes a failing node from controller. If node is not failing it will not be removed.
If node reoccurs in network it will still be usable but won't be shown in listed nodes.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/remove_failed_node_id' -m '{"node_id":<NODE>}'</pre>
NOTE! Naming of command indicates that this only affecting the id in the list.

h4. replace_failed_node

As in remove ditto, but will also expect a new clean node to be NIFF:ed that will appear on the removed nodes address.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/replace_failed_node' -m '{"node_id":<NODE>}'</pre>
NOTE! Naming of command indicates that this is is used to replace an actual node.

h4. is_failed_node_id

This command is only working on USB-sticks and will produce a "true" or a "false" telling if the node_id is a failed one.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/is_failed_node_id' -m '{"node_id":<NODE>}'</pre>

h4. get_id

This command is used to retrieve the home id of the chip.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/get_id' -m '{}'</pre>

h4. get_init_data

Returns the capabilities, chip and the current node list from the chip.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/get_init_data' -m '{}'</pre>

h4. get_suc

Returns the node id of the current SUC.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/get_suc' -m '{}'</pre>

h4. add_node

Starts inclusion of node in network.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/add_node' -m '{"mode":"any"}'</pre>
Additional arguments that can be used are:
* "network_wide":true/false - Default is true.
* "high_power":true/false - Default is true.
The command can be halted with
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/add_node' -m '{"mode":"stop"}'</pre>

h4. remove_node

Starts exclusion of node from network.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/remove_node' -m '{"mode":"any"}'</pre>

h4. learn

Strats inclusion into other network
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/learn' -m '{"mode":"any"}'</pre>

h4. request_node_neighbor_update

Requests a rediscover of neighborhood around a specific node. This can for example be used when a static node is removed.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/request_node_neighbor_update' -m '{"node_id":<NODE>}'</pre>

h4. hard_reset

Use this command with caution. Some zwave chips also removes current home id, and gets a new.
Removes current nodes from list, and restarts counter where new nodes is placed.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/hard_reset' -m '{}'</pre>
NOTE! If nodes are not reset, they will still be operational.

h4. soft_reset

As in hard_reset but won't reset home id.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/soft_reset' -m '{}'</pre>

h4. get_neighbors

TODO! This command is not conforming to standard.
Command is used to retrieve neighborhood of a specific node.
<pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/get_neighbors' -m '{}'</pre>
Needed conformance is
<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/get_neighbors' -m '{"node_id":<NODE>}'</pre>

h4. get_nif

<pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/get_nif' -m '{}'</pre>

h4. assign_return_route

<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/assign_return_route' -m '{"source_node_id":<SOURCE>,"dest_node_id":<DEST>}'</pre>

h4. delete_return_route

<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/delete_return_route' -m '{"node_id":<NODE>}'</pre>

h4. get_last_working_route

<pre>mosquitto_pub -t 'cmd/zwave/usb0/network/get_last_working_route' -m '{"node_id":<NODE>}'</pre>

by anonymous
h3. Node commands

h4. alarm

* set - Set alarm status <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/alarm/set' -m '{"type":<TYPE>,"status":<STATUS>}'</pre>
* get - Get alarm status <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/alarm/get' -m '{"type":<TYPE>,"zwave_alarm_type":<STATUS>}'</pre>
* type_supported_get - Retrieve which alarm types is supported <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/alarm/type_supported_get' -m '{}'</pre>

h4. association

* set - Set association <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/association/set' -m '{"group":<GROUP>,"node_id":<NODE_ID>}'</pre>
* get - Get association <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/association/get' -m '{"group":<GROUP>}'</pre>
* groupings_get - Get supported groupings <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/association/groupings_get' -m '{}'</pre>
* remove - Remove association <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/association/remove' -m '{"group":<GROUP>,"node_id":<NODE_ID>}'</pre>

h4. basic

This is a mandatory command class supported by all zwave actors.
Command may allso be used on multichannel devices
* set - Set value <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/basic/set' -m '{"value":<VALUE>}'</pre>
* get - Get value <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/basic/get' -m '{}'</pre>

h4. battery

Command is used to get battery level from device
NOTE! Those devices normally is unreachable if not "beam" is supported, untill wake_up/notification
* get - Get battery level - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/battery/get' -m '{}'</pre>

h4. climate_control_schedule

* get - Retrieve one day setbacks - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/climate_control_schedule/get' -m '{}'</pre>
* set - Set one day setbacks - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/climate_control_schedule/set' -m '{"weekday":<DAY_OF_WEEK>, "setbacks":[{"hour":5,"minute":0,"setback":10},{"hour":23,"minute":0,"setback":-20}]}'</pre>
* changed_get - Get number of setbacks performed - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/climate_control_schedule/changed_get' -m '{}'</pre>
* override_get - Retrieve override status - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/climate_control_schedule/override_get' -m '{}'</pre>
* override_set - Set override status - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/climate_control_schedule/override_set' -m '{"type":<TYPE>, "setback":-40}'</pre>

h4. color_control

This command is used to control rgb enabled devices and similar.
* capability_get - Get a list of available capabilities. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/color_control/capability_get' -m '{}'</pre>
* state_get - Get the current state of a specific capability. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/color_control/state_get' -m '{"capability_id":<CAPABILITY>}'</pre>
* state_set - Set a state on a given capability. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/color_control/state_set' -m '{"<CAPABILITY_NAME>":<LEVEL>}'</pre>
* start_capability_level_change - Start a level change on a given capability. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/color_control/start_capability_level_change' -m '{"direction":"<DIRECTION>","capability_id":<CAPABILITY>}'</pre>
* stop_state_change - Stop an ongoing level change on a given capability. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/color_control/stop_state_change' -m '{"capability_id":<CAPABILITY>}'</pre>

h4. configuration

Command is used to manipulate configuration on devices.
* get - Get a configuration value. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/configuration/get' -m '{"parameter":<PARAMETER_ID>}'</pre>
* set - Set a configuration value. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/configuration/set' -m '{"parameter":<PARAMETER_ID>,"value":<VALUE>,"size":<SIZE>}'</pre>

h4. hail

* hail - Hail <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/hail/hail' -m '{}'</pre>

h4. manufacturer_specific

* get - Retrieve product typ identification. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/manufacturer_specific/get' -m '{}'</pre>
* device_specific_get - Retrieve serial number from device. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/manufacturer_specific/device_specific_get' -m '{"device_id_type":<ID_TYPE>}'</pre>

ID_TYPE: Use 0 for OEM-id and 1 for serial number.

h4. meter

* get - Retrieve a specific meter value. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/meter/get' -m '{"scale":"<SCALE>"}'</pre>

h4. meter_pulse

* get - Retrieve a specific pulse meter current value. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/meter_pulse/get' -m '{}'</pre>

h4. multi_channel_association

This command is similar to association command, but is allso capable of setting associations to multi channel capable devices.
If association is set, those settings are also shown and is possible to manipulate here.
* get - Get current associations on a specific grouping. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_channel_association/get' -m '{"grouping":<grouping>}'</pre>
* set - Set an association. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_channel_association/set' -m '{"grouping":<GROUPING>,"node_id":<NODE>,"endpoint":<ENDPOINT>}'</pre>
NOTE! ENDPOINT is only needed if intended. In case of excluded, this gives the same result as in association.
* groupings_get - Get number of groupings on a device. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_channel_association/groupings_get' -m '{}'</pre>
* remove - Remove an association. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_channel_association/remove' -m '{"grouping":<GROUPING>,"node_id":<NODE>,"endpoint":<ENDPOINT>}'</pre>

h4. multi_channel

Command is used to manipulate multi channel capable devices.
NOTE! This command is also used to encapsulate other commands.
* get - Get data about endpoints. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_channel/get' -m '{}'</pre>
* capability_get - Get capabilities of a specific endpoint. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>.<CHANNEL>/multi_channel/capability_get' -m '{}'</pre>

h4. multi_cmd

* encap - Encapsulate multiple commands to device - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/multi_cmd/encap' -m '{"cmds":[{"topic":<TOPIC>,"message":<MESSAGE>},...]}'</pre>

h4. powerlevel

Get and set powerlevel on capable devices
NOTE! Bug in command. Should handle timeout in set command too.
* set - Set powerlevel. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/powerlevel/set' -m '{"level":<LEVEL>}'</pre>
* get - Get powerlevel. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/powerlevel/get' -m '{}'</pre>

h4. protection

Manage protection capable devices
NOTE! Never tested
* set - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/set' -m '{"local_state":<LOCAL>,"rf_state":<RF>}'</pre>
* get - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/get' -m '{}'</pre>
* ec_set - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/ec_set' -m '{"node_id":<NODE>}'</pre>
* ec_get - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/ec_get' -m '{}'</pre>
* supported_get - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/supported_get' -m '{}'</pre>
* timeout_set - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/timeout_set' -m '{"timeout":<TIMEOUT>}'</pre>
* timeout_get - <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/protection/timeout_get' -m '{}'</pre>

h4. sensor_alarm

No commands available, this is a reporting command class only.

h4. sensor_binary

* get - Retrieve current sensor status from node. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/sensor_binary/get' -m '{"type":<TYPE>}'</pre>
Parameter is optional.

h4. sensor_multilevel

* get - Retrieve current sensor status from node. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/sensor_multilevel/get' -m '{"type":<TYPE>,"scale":<SCALE>}'</pre>
Both parameters are optional.

h4. switch_all

* set - Set mode to switch. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/switch_all/set' -m '{"mode":<MODE>}'</pre>
* get - Get current switch mode. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/switch_all/set' -m '{}'</pre>
* on - Switch all on. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/switch_all/on' -m '{}'</pre>
* off - Switch all off. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/switch_all/off' -m '{}'</pre>

h4. switch_binary

* set - Set value to switch. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_binary/set' -m '{"switch":<BOOLEAN>}'</pre>
* get - Get current value from switch. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_binary/get' -m '{}'</pre>

h4. switch_multilevel

* set - Set level to switch. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_multilevel/set' -m '{"level":<LEVEL>}'</pre>
* get - Get current level from switch. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_multilevel/get' -m '{}'</pre>
* start - Start level change. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_multilevel/start' -m '{"direction":"<DIRECTION>"}'</pre>
* stop - Stop level change. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>(.<CHANNEL>)/switch_multilevel/stop' -m '{}'</pre>

h4. thermostat_heating

NOTE! Not implemented

h4. thermostat_mode

* set - Set thermostat mode. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/thermostat_mode/set' -m '{"mode":<MODE>}'</pre>
* get - Get thermostat mode. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/thermostat_mode/get' -m '{}'</pre>
* supported_get - Get supported thermostat modes. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/thermostat_mode/supported_get' -m '{}'</pre>

h4. thermostat_setpoint

* set - Set thermostat target temerature. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/thermostat_setpoint/set' -m '{"value":<VALUE>}'</pre>
* get - Get current target temperature. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/thermostat_setpoint/get' -m '{}'</pre>

h4. time

* get - Set time. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/time/get' -m '{}'</pre>
* date_get - Get date. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/time/date_get' -m '{}'</pre>
* offset_set - Set time offset. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/time/offset_set' -m '{"tz_offset":<TZ_OFFSET>,"dst_start_mon":<DST_START_MONTH>,"dst_start_day":<DST_START_DAY>,"dst_start_hour":<DST_START_HOUR>,"dst_end_mon":<DST_END_MONTH>,"dst_end_day":<DST_END_DAY>,"dst_end_hour":<DST_END_HOUR>}'</pre>
* offset_get - Get time offset. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/time/offset_get' -m '{}'</pre>

h4. version

* get - Get version. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/version/get' -m '{}'</pre>
* command_class_get - Get specific command class version. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/version/command_class_get' -m '{"command_class":"<COMMAND_CLASS>"}'</pre>

Command class is named by string. The correct spelling of command classes are found in "NIF"-report.

h4. wake_up

* set - Set wake up intervall. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/wake_up/set' -m '{"interval":<INTERVAL>,"node_id":1}'</pre>
* set - Set wake up intervall for a node that for the moment is *asleep* (this example 24h), <pre>mosquitto_pub -t 'set/obj/zwave/usb0/node/<Node>/wake_up' -m '{"interval":86400}'</pre>
* get - Get wake up intervall. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/wake_up/get' -m '{}'</pre>
* capabilities_get - Retrieve min, max, default value and resolution of wake_up. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/wake_up/capabilities_get' -m '{}'</pre>
* no_more - Let node go to sleep again. <pre>mosquitto_pub -t 'cmd/zwave/usb0/node/<NODE>/wake_up/no_more' -m '{}'</pre>