Hi guys,
I am using OpenZWave (beta) integration with the OpenZwave plugin (0.3.0) and a MQTT broker (@Raspberry Pi 4). I would say it works fairly stable except that there’s no control panel YET.
Anyhow. I recently moved my Aeotec ZWave Gen5 stick and I am seriously suspecting that nodes far away from the base unit are not able to communicate with the USB stick anymore.
So I want to execute a heal network command. In lack of a easily installable control panel(?) does anyone know how I can send a heal command to OpenZwave plugin by publishing it to the MQTT broker?
Thank you
/ Henrik
Oh I found the MQTT doc for qt-openzwave. I’ll read it to see if I can publish it to the MQTT broker
MQTT Client for OpenZWave
=========================
Docker Repo: https://hub.docker.com/r/openzwave/ozwdaemon
Make sure you have create a local folder where ozwdaemon can store the config files etc for your installation. In this example, /home/ozw/config/ is on your local machine.
If you are using Secure Communications, setup a Docker Secret:
```
printf "0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0b,0x0c,0x0d,0x0e,0x0f,0x10" | docker secret create OZW_Network_Key -
```
* replace the Hex String with 16 Bytes to use as your Network Key.
Start a container with the following command line:
```
docker run -it --security-opt seccomp=unconfined --device=/dev/ttyUSB0 -v /home/ozw/config:/opt/ozw/config -e MQTT_SERVER="10.100.200.102" -e USB_PATH=/dev/ttyUSB0 --secret OZW_Network_Key openzwave/ozwdaemon:latest
```
* Update `MQTT_SERVER` with the IP address of the MQTT Server and all `/dev/ttyUSB0` entries with the path to your USB Stick.
* If you are not running with a ZWave Network Key, remove the `--secret OZW_Network_Key` command
This file has been truncated. show original
Now I tried this:
mosquitto_pub -h ... -t "OpenZWave/1/command/healnetwork" -m ""
Let’s hope I am on the right track
2t0m
(Thomas)
September 9, 2020, 9:11am
4
Hi @henrik.klang ,
I was looking for the healNetworkNode command and I found your post.
Did you get it working ?
Edit : I did.
- id: '1590165766966'
alias: 'Zwave : Auto Heal Node'
trigger:
- at: 00:02:00
platform: time
condition: []
action:
- data:
payload: '{"node": 14, "doreturnroute": false}'
topic: OpenZWave/1/command/healnetworknode/
service: mqtt.publish
mode: single
1 Like
Yep my above mosquitto_pub command worked flawlessly. The device “lost” seems to have recalulated its route so i was able to use it.
Did you try mosquitto_pub before trying your script above?
2t0m
(Thomas)
September 9, 2020, 12:28pm
6
No, I directly started to play with the HA service mqtt.publish
service: mqtt.publish
payload: '{"node": 14, "doreturnroute": false}'
topic: OpenZWave/1/command/healnetworknode/
And I have been reading OZW log with
tail -f /opt/openzwave/logs/ozwdaemon.log
I’m not sure you get any feedback on the command being successful. At least I didn’t as far as I can remember.
2t0m
(Thomas)
September 9, 2020, 4:03pm
8
You can get a feedback from ozwdaemon.log
.
This was my first try.
[20200909 11:00:34.166 CEST] [ozw.mqtt.commands] [debug]: Got "OpenZWave/1/command/healnetworknode/" Message: "{\"node\": 14}"
[20200909 11:00:34.166 CEST] [ozw.mqtt.commands] [warning]: Missing Field for "healnetworknode" : "doreturnroute" : "{\"node\": 14}"
1 Like
freshcoast
(Z-Wave AI Bot)
September 9, 2020, 4:19pm
9
You will get this same feedback in MQTT, topic OpenZWave/<instance>/event/<topic>/
with a payload indicating whether the command was accepted or if there were errors. https://github.com/OpenZWave/qt-openzwave/blob/89cc0d86c983101aacd89c780bae18bb3dffe9b4/docs/MQTT.md#command-status-and-feedback
I’m not sure if i’m doing this right.
I’ve added en changed the position of some zwave plus devices and used this command to heal my network:
service: mqtt.publish
topic: OpenZWave/1/command/healnetwork/
In the log file i get this:
[ozw.mqtt.commands] [debug]: Got “OpenZWave/1/command/healnetwork/” Message: “”
[ozw.mqtt.commands] [warning]: Json Parse Error for “healnetwork” : The document is empty. : “”
Can someone tell me if i did it right?
freshcoast
(Z-Wave AI Bot)
January 8, 2021, 10:55pm
11
Payload needs to be an empty JSON object, {}
1 Like