Home Assistant Community Add-on: Z-Wave to MQTT

Did you have to reset your existing zwave devices?

No resetting was required. I copied the network key and i could control an see all devices in the zwave2mqtt web interface. After that I turned that docket container off and went back to using zwave with home assistant just fine.

@awulf could you DM me any help on getting this running as a docker for home assistant? I have home assistant ok a docker, rather than hass.io and I cant seem to see a standard way to get this workingā€¦ Want to have a quick play as not a fan of having z-wave network reboot each update. Zigbee for me is on deconz docker so I can leave that running, would love z-wave to be the same.

Actually, if seems like there is a docker already created on docker hub:

https://hub.docker.com/r/robertslando/zwave2mqtt

Is there a migration guide or recommended steps to move from the built-in HA OZW integration to zwave2mqtt? In my experience, OZW does not rebuild device configs from an existing controller network correctly; results are better if OZW handles device inclusions. Can my zwcfg XML file simply be ported over from HA integration into zwave2mqtt?

2 Likes

@wrkn Yes you can import existing zwcfg XML into Zwave2MQTT. When you have configured your Zwave2MQTT you can go to ā€œControl Panelā€ and use the ā€œarrow upā€ icon to import existing XML config. (see screenshot)

Although there is one issue with the current (0.1.0) release of ZWave2MQTT that it writes the XML files to the wrong location. They should be saved to /opt/stores but it writes them to /opt instead.
Somebody already created a pull request which will fix this issue. https://github.com/hassio-addons/addon-zwave2mqtt/pull/4
Still waiting for approvalā€¦

1 Like

Can someone describe the format of the networkkey.

Whether I put it in ā€œā€
Or I haev it comma seperated, I get the same errors.

If I put it in the Optionkey in option.yaml, the add-on web UI wonā€™t loadā€¦

"
"
"
2019-06-10 15:29:00.030 Always, OpenZwave Version 1.4.164 Starting Up
2019-06-10 15:29:00.030 Warning, Invalid Network Key. Does not contain 16 Bytes - Contains 1
2019-06-10 15:29:00.030 Warning, Raw Key: 0x5A
2019-06-10 15:29:00.030 Warning, Parsed Key:
2019-06-10 15:29:00.030 Warning, 1) - 0x5A
2019-06-10 15:29:00.030 Error, Exception: Driver.cpp:6727 - 103 - Failed to Read Network Key
[15:29:00] INFO: Starting the Z-Wave to MQTTā€¦
2019-06-10T15:29:00.914Z z2m:Store scenes.json not found
2019-06-10T15:29:02.241Z z2m:App Application path:/opt
Initialising OpenZWave 1.4.164 binary addon for Node.JS.
OpenZWave Security API is ENABLED
ZWave device db : /usr/etc/openzwave/
User settings path : /opt
Option Overrides : --Logging undefined --ConsoleOutput undefined --QueueLogLevel 6 --DriverMaxAttempts 9999 --SaveConfiguration undefined --PollInterval 5000 --NetworkKey 0xA2, 0xD2, 0x22, 0xE1, 0xB6, 0x1D, 0x26, 0xAA, 0x15, 0x47, 0xE9, 0x12, 0x9F, 0x46, 0x1D, 0x5A
2019-06-10T15:29:02.479Z z2m:Zwave Connecting to /dev/ttyACM0
2019-06-10 15:29:02.481 Always, OpenZwave Version 1.4.164 Starting Up
2019-06-10 15:29:02.482 Warning, Invalid Network Key. Does not contain 16 Bytes - Contains 1
2019-06-10 15:29:02.482 Warning, Raw Key: 0x5A
2019-06-10 15:29:02.482 Warning, Parsed Key:
2019-06-10 15:29:02.483 Warning, 1) - 0x5A
2019-06-10 15:29:02.483 Error, Exception: Driver.cpp:6727 - 103 - Failed to Read Network Key
Error: Driver.cpp:6727 - Failed to Read Network Key
[15:29:02] INFO: Starting the Z-Wave to MQTTā€¦
2019-06-10T15:29:03.372Z z2m:Store scenes.json not found
"
"
"

I have it installed in my options.xml (non-hassio so no add-on) in the following format - not the real numbers:

Option name=ā€œNetworkKeyā€ value=ā€œ0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0xGG, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99ā€

Would be great if this was in the document.

Do I include the " "
Do I include the 0x hex ?
Space or no-space?

1 Like

Got my NetworkID working thanks to information above.
No ā€œā€
No Spaces between 0x valuesā€¦

Once I have that in, I get the following errors

OpenZWave Error, mgr, Manager::GetDriver failed - Home ID 0x00000000 is unknown
OpenZWave Warning, Exception: Manager.cpp:373 - 100 - Invalid HomeId passed to GetDriver

1 Like

Iā€™m at a loss as to what to do and havenā€™t stumbled upon documentation yet.

So far, when I open an close a sensor, I get some data in the Z-wave Window which is a minor success, however it doesnā€™t look positive that itā€™s working.
I do get a MQTT message upon the service start, but nothing after that.

Here are the errors and screenshots. Apologies as I just tried to set this up without having a working config to compare.



OpenZWave Detail, Node008, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x08, 0x03, 0x30, 0x03, 0xff, 0x35

OpenZWave Detail, 

OpenZWave Detail, Node008, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x08, 0x01, 0x09, 0x00, 0x04, 0x00

OpenZWave Warning, Node008, WARNING: Checksum incorrect - sending NAK

OpenZWave Detail, Node008, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x08, 0x03, 0x30, 0x03, 0x01, 0x09

OpenZWave Warning, Node008, WARNING: Checksum incorrect - sending NAK

OpenZWave Detail, Node006, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x06, 0x03, 0x30, 0x04, 0x00, 0x06

OpenZWave Warning, Node006, WARNING: Checksum incorrect - sending NAK

OpenZWave Warning, WARNING: Out of frame flow! (0x3b). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0x03). Sending NAK.

2019-06-11T11:40:20.947Z z2m:App Zwave api call: testNetworkNode [ 8 ]

2019-06-11T11:40:20.959Z z2m:Zwave Success zwave api call testNetworkNode 

OpenZWave Error, mgr, Manager::GetDriver failed - Home ID 0x00000000 is unknown

OpenZWave Warning, Exception: Manager.cpp:373 - 100 - Invalid HomeId passed to GetDriver

OpenZWave Warning, WARNING: 500ms passed without reading the rest of the frame...aborting frame read

OpenZWave Detail, contrlr, Received: 0x01, 0x15, 0x5a, 0x2d, 0x57, 0x61, 0x76, 0x65, 0x20, 0x34, 0x2e, 0x35, 0x34, 0x00, 0x01, 0x10, 0x01, 0x15, 0x5a, 0x2d, 0x57, 0x61, 0x76

OpenZWave Warning, contrlr, WARNING: Checksum incorrect - sending NAK

OpenZWave Detail, contrlr, Received: 0x01, 0x10, 0x01, 0x15, 0x5a, 0x2d, 0x57, 0x61, 0x76, 0x65, 0x20, 0x35, 0x34, 0x00, 0x01, 0x93, 0x00, 0x01

OpenZWave Warning, contrlr, WARNING: Checksum incorrect - sending NAK

OpenZWave Detail, Node008, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x08, 0x03, 0x30, 0x03, 0xff, 0x35

OpenZWave Detail, 

OpenZWave Detail, Node008, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x08, 0x03, 0x30, 0x03, 0x00, 0xca

OpenZWave Detail, 

OpenZWave Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)

2019-06-11T11:43:37.385Z z2m:Zwave Notification from node 255: Notification - TimeOut (1)

OpenZWave Detail, contrlr, Removing current message

OpenZWave Detail, contrlr, Notification: Notification - TimeOut

OpenZWave Detail, 

OpenZWave Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x20) - FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc

OpenZWave Detail, contrlr, Received: 0x01, 0x08, 0x01, 0x20, 0xff, 0x16, 0x67, 0x86, 0x01, 0x01

OpenZWave Warning, contrlr, WARNING: Checksum incorrect - sending NAK

OpenZWave Detail, contrlr, Received: 0x01, 0x08, 0x01, 0x20, 0xff, 0x16, 0x67, 0x86, 0x01, 0xdf

OpenZWave Detail, 

OpenZWave Info, contrlr, Received reply to FUNC_ID_ZW_MEMORY_GET_ID. Home ID = 0xff166786. Our node ID = 1

OpenZWave Detail, Node022, Expected reply was received

OpenZWave Detail, Node022, Message transaction complete

OpenZWave Detail, 

OpenZWave Detail, contrlr, Removing current message

OpenZWave Detail, 

OpenZWave Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x05) - FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9

2019-06-11T11:43:38.400Z z2m:Zwave Notification from node 255: Notification - TimeOut (1)

OpenZWave Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)

OpenZWave Detail, contrlr, Removing current message

OpenZWave Detail, contrlr, Notification: Notification - TimeOut

OpenZWave Detail, 

OpenZWave Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x07) - FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb

OpenZWave Warning, WARNING: Out of frame flow! (0xfb). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0xe8). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0x00). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0x4f). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0x4f). Sending NAK.

OpenZWave Warning, WARNING: Out of frame flow! (0x4f). Sending NAK.

2019-06-11T11:43:39.418Z z2m:Zwave Notification from node 255: Notification - TimeOut (1)

OpenZWave Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)

OpenZWave Detail, contrlr, Removing current message

OpenZWave Detail, contrlr, Notification: Notification - TimeOut

OpenZWave Detail, 

OpenZWave Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x56) - FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa

2019-06-11T11:43:40.419Z z2m:Zwave Notification from node 255: Notification - TimeOut (1)

OpenZWave Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)

OpenZWave Detail, contrlr, Removing current message

OpenZWave Detail, contrlr, Notification: Notification - TimeOut

Attached is my config. Can anyone help a newbie with some documentation or assistance?


ļæ¼

See my post above. I had to edit it to get the text to show.

Oopsā€¦

How to migrate from builtin to this? Or how to add MQTT dimmers in the correct way in HA ?

1 Like

Iā€™m at my witts end trying to figure out what is going onā€¦

I guess I need to ask the following questions

  1. When using the z-wave to mqtt add-on, should the configure still be added into the configuration.xml as /dev/ACM0 with netowkr key or only into this add-on? Are my configs posted above seem correct?
  2. After what changes must hass be reloaded? Sometimes I can see my nodes, in the add-on, often they disappear
  3. What would cause this
    "OpenZWave Warning, WARNING: Out of frame flow! (0x03). Sending NAK.
  4. My logs have a bunch of these. Not sure how to interpret this
    ā€œWarning, Exception: Manager.cpp:373 - 100 - Invalid HomeId passed to GetDriverā€
  5. Why does MQTT keep reconnecting like
    2019-06-12T05:44:26.397Z z2m:Mqtt MQTT client reconnecting
    2019-06-12T05:44:26.444Z z2m:Mqtt MQTT client closed
    Is this the reconnection time? Is there a reason Iā€™d want to keep reconnecting?
  6. After opening and closing a switch about 10 times, the only thing I see in the logs is
    OpenZWave Warning, WARNING: Out of frame flow! (0x35). Sending NAK.
    OpenZWave Warning, WARNING: 500ms passed without reading the rest of the frameā€¦aborting frame read
    OpenZWave Warning, WARNING: Out of frame flow! (0x00). Sending NAK.

Given my device is only about 1 foot or 30cm away, it shouldnā€™t be network instability.

1 Like

Are you migrating from HA Zwave component? Then you need to make sure that ZWave is disabled. Either remove it from your configuration.yaml or under Intergration.
To make sure you shouldnā€™t have ā€œZWaveā€ menu item under ā€œConfigurationā€. If this menu item is still there then your ZWave stick is bound to HA and canā€™t be used by ZWave2Mqtt.

I have noticed when adding a wrong network key in ZWave2Mqtt I couldnā€™t change it anymore. I had to login into hass.io and edit the settings.json file to fix this. But if you can login into the web ui you donā€™t have the same issue.

Hope this helps.

1 Like

Hi @Rgruyters

Thank you for the noteā€¦

Not migrating but definately had both going at the same time. Removed the hass component and now only zwave to mqtt bridge exists.

Iā€™m noticing error messages in logs, missed events despite being nearby, cannot rename devices, etc. I feel like it shouldnā€™t be this way so clearly iā€™ve done something wrong.

Unfortunately, Iā€™ve given up on this. Itā€™s a great idea however I think there are some areas to improve

Documentation with screenshots and good explanations. I found this a tough go setting up and I knew a bit about z-wave
Once you have a device added, there is no friendly name way of recognizing the nodes. I spent most of my time in debug mode.
I was not able to get a single message from z-wave to mqtt despite my gateway being correct. Ohh, I take that back, there was an initial MQTT connection message, no event messages. Maybe a recommendation of a action based on the device time or template would be nice.

I found Node-Red with Hass a much cleaner and easier solution but if the above are fixed, given my setup of 3 PIā€™s, i would prefer to use the zwave to mqtt add-on

3 Likes

if youā€™re having the MQTT connection issues, check your config against the documentation. I got those messages about reconnecting and disconnecting. The documentation states the broker is looking for the protocol and the broker address. Once I put mqtt://192.168.1.95 in the broker and 1883 in the port and had the correct authentication, my MQTT connected. Just make sure to read the documentation on GitHub. Itā€™s a little sparse, but has the information needed to get it setup.

Thanks! Iā€™ll wait for that fix.

Also, I just noticed when playing around with it I couldnā€™t get my dongleā€™s USB by-id path working, it would only take the tty path. I donā€™t want to rely on that because sometimes after reboots or upgrades my device tty paths change and itā€™s a pain to manage.

:tada: Release v0.2.0

Full Changelog

This release is a maintenance release, upgrading all parts of the add-on to the latest and greatest.

:hammer: Changes

  • :arrow_up: Upgrades base image to v3.1.2
  • :arrow_up: Updated zwave2mqtt to version 1.1.2 (#4)
  • :pencil2: Maintaince -> Maintenance
  • :sparkles: Adds FUNDING.yml
  • :arrow_up: Upgrades add-on base image to v4.0.1
  • :arrow_up: Upgrades git to 2.22.0-r0
  • :arrow_up: Upgrades linux-headers to 4.19.36-r0
  • :arrow_up: Upgrades npm to 10.16.0-r0
  • :arrow_up: Upgrades yarn to 1.16.0-r0
  • :arrow_up: Upgrades nodejs to 10.16.0-r0
  • :arrow_up: Upgrades eudev to 3.2.8-r0
  • :arrow_up: Upgrades nginx to 1.16.0-r2
  • :arrow_up: Upgrades openssl to 1.1.1c-r0
  • :books: Adds links to upstream project

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck