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

Hey Folks,

Could you please help me to figure out how to send Scene Events from ZWave2MQTT to Hass?

Thank you in advance

Hi there, I just discover this addon, but I canā€™t make it work. no page when I try to open the webui.
My config:

{
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

My logs:

[18:04:48] INFO: Starting NGinx...
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
PANIC: unprotected error in call to Lua API (bad light userdata pointer)

My system Hassio qemuarm-64

Thanks in advance!

1 Like

Same here. Running Hassio on a odroid C2

:tada: Release v0.4.2

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Upgrades Zwave2Mqtt to v2.0.6
  • :arrow_up: Upgrades add-on base image to v5.0.3
  • :books: Update add-on installation instructions

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

I am really impressed with the improved latency and reliability as soon as I switched from native Z-Wave to Zwave2MQTT!

Iā€™ve got a question about the use of a battery powered wall switch; the Aeotec Nanomote Quad (ZWA003-C).

I see the events in the debug console coming in, great!

2019-12-20T21:20:12.759Z z2m:Zwave zwave node 14: changed: 91-1-4:Button Four:7680 ā†’ 7680

But how do I trigger something in Home Assistant with the buttons being pressed? I found the page on the Z-Wave native integration, but how does that apply to Zwave2MQTT? I donā€™t see any button entity, nor any events in Home Assistant, but I do see a ā€œdimmerā€ and a ā€œbatteryā€ device.

Iā€™m using the Docker image 2.0.6 with OZW 1.4 (this one).

Update: I think I have found the events by debugging on the mqtt broker. However, I seem to be missing ~ 50% of the button events. Illustrated by the output below, it should have sent the Battery status on every press, but instead it only gets received half the time and sometimes I see only a Battery status event when I press the button. Anything that I can do about this?

{"value_id":"14-128-1-0","node_id":14,"class_id":128,"type":"byte","genre":"user","instance":1,"index":0,"label":"Battery Level","units":"%","help":"","read_only":true,"write_only":false,"min":0,"max":255,"is_polled":false,"value":100}
{"value_id":"14-91-1-1","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":1,"label":"Button One","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-128-1-0","node_id":14,"class_id":128,"type":"byte","genre":"user","instance":1,"index":0,"label":"Battery Level","units":"%","help":"","read_only":true,"write_only":false,"min":0,"max":255,"is_polled":false,"value":100}
{"value_id":"14-91-1-2","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":2,"label":"Button Two","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-91-1-1","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":1,"label":"Button One","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-91-1-4","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":4,"label":"Button Four","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-91-1-3","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":3,"label":"Button Three","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-128-1-0","node_id":14,"class_id":128,"type":"byte","genre":"user","instance":1,"index":0,"label":"Battery Level","units":"%","help":"","read_only":true,"write_only":false,"min":0,"max":255,"is_polled":false,"value":100}
{"value_id":"14-91-1-3","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":3,"label":"Button Three","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}
{"value_id":"14-128-1-0","node_id":14,"class_id":128,"type":"byte","genre":"user","instance":1,"index":0,"label":"Battery Level","units":"%","help":"","read_only":true,"write_only":false,"min":0,"max":255,"is_polled":false,"value":100}
{"value_id":"14-91-1-3","node_id":14,"class_id":91,"type":"int","genre":"user","instance":1,"index":3,"label":"Button Three","units":"","help":"","read_only":true,"write_only":false,"min":-2147483648,"max":2147483647,"is_polled":false,"value":7680}

Update 2: I just realized this is a forum topic about hassio, but Iā€™m using plain HA.

Iā€™ve installed the addon, started it. But when I open the WebUI, Iā€™m asked for a username and password. What are these (by default) and where to change these?

(If I leave the frontdoor open, I can open the web UI, but thatā€™s not what I wantā€¦)

I am struggling with the feature set of the latest version. Are you creating a device or are you just forwarding to mqtt? Question is what to do when I do see devices in the GUI?

First and most important I would like to thank you for the excellent work and initiative to create this plugin.

But according to the latest zwave2mqtt commit (that this addon is based on) OZW 1.4 is now deprecated and replaced by OZW 1.6 as default platform. Unfortunately 1.6 is not 100% backwards compatible with 1.4 and a full rescan of network nodes are required for the update.

And since I have not done the jump over to z2m yet I would rather start fresh on the 1.6 platform at the same time.

So when can we expect this addon to be updated with the latest z2m 1.6 commit that supports custom items, mesh-map, z-wave events and etc. without moving over to the edge repository? If you got a timeline please share :pray: :upside_down_face:

3 Likes

Iā€™m also in this boat, Iā€™m seriously considering moving to this but also donā€™t want to start with something deprecated. Is there anything we can do to help get on 1.6?

I also have a similar question: I installed the latest add-on and confirmed it is using OZW 1.4 - i would like to use 1.6 - How can I install it under Hass.io add-on Z-Wave to MQTT?

1 Like

I am also looking for OZW 1.6 :slight_smile:

I have set up the Z-Wave to MQTT add-on, but there must be issues I donĀ“t got right. Most of the nodes are reported deadā€¦ and HA has not reported the Z-wave network as runningā€¦ Everything was perfect until I started the Z-Wave to MQTT add-on.

The Z-wave network is not started (as per the /config/zwave page within HA).

How is this supposed to work?

2020-02-18 22:16:56.414 Always, OpenZwave Version 1.4.3462 Starting Up
2020-02-18 22:18:28.135 Info, Setting Up Provided Network Key for Secure Communications
2020-02-18 22:18:28.135 Info, mgr,     Added driver for controller /dev/ttyACM0
2020-02-18 22:18:28.140 Info,   Opening controller /dev/ttyACM0
2020-02-18 22:18:28.141 Info, Trying to open serial port /dev/ttyACM0 (attempt 1)
2020-02-18 22:18:28.142 Info, Serial port /dev/ttyACM0 opened (attempt 1)
2020-02-18 22:18:28.142 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2020-02-18 22:18:28.142 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2020-02-18 22:18:28.143 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2020-02-18 22:18:28.143 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2020-02-18 22:18:28.143 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2020-02-18 22:18:28.143 Detail, 
2020-02-18 22:18:28.143 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2020-02-18 22:18:28.922 Detail, Unsolicited message received while waiting for ACK.
2020-02-18 22:18:28.922 Detail, contrlr,   Received: 0x01, 0x04, 0x01, 0x13, 0x01, 0xe8
2020-02-18 22:18:28.922 Detail, contrlr,   ZW_SEND_DATA delivered to Z-Wave stack
2020-02-18 22:18:28.940 Detail, Unsolicited message received while waiting for ACK.
2020-02-18 22:18:28.941 Detail, contrlr,   Received: 0x01, 0x07, 0x00, 0x13, 0x40, 0x00, 0x00, 0x02, 0xa9
2020-02-18 22:18:28.941 Detail, contrlr,   ZW_SEND_DATA Request with callback ID 0x40 received (expected 0x00)
2020-02-18 22:18:28.941 Warning, contrlr, WARNING: Unexpected Callback ID received
2020-02-18 22:18:29.942 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2020-02-18 22:18:29.942 Detail, contrlr, Removing current message
2020-02-18 22:18:29.942 Detail, contrlr, Notification: Notification - TimeOut
2020-02-18 22:18:29.956 Detail, 
2020-02-18 22:18:29.956 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x20) - FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2020-02-18 22:18:30.958 Error, contrlr, ERROR: Dropping command, expected response not received after 1 attempt(s)
2020-02-18 22:18:30.958 Detail, contrlr, Removing current message
2020-02-18 22:18:30.958 Detail, contrlr, Notification: Notification - TimeOut
2020-02-18 22:18:30.973 Detail, 
2020-02-18 22:18:30.973 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x05) - FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9

And from the Z-Wave to MQTT debug console:

OpenZWave Detail, Node021, Received: 0x01, 0x0c, 0x00, 0x04, 0x00, 0x15, 0x06, 0x31, 0x05, 0x04, 0x22, 0x00, 0x1f, 0xe9
OpenZWave Detail,
OpenZWave Info, Node021, Received SensorMultiLevel report from node 21, instance 1, Power: value=3.1W
OpenZWave Detail, Node021, Refreshed Value: old value=2.9, new value=3.1, type=decimal
2020-02-18T22:00:13.332Z z2m:Zwave zwave node 21: changed: 49-1-4:Power:2.9 -> 3.1
OpenZWave Detail, Node021, Changes to this value are not verified
OpenZWave Detail, Node021, Notification: ValueChanged
OpenZWave Detail, Node035, Received: 0x01, 0x0d, 0x10, 0x04, 0x00, 0x14, 0xff, 0x31, 0x0c, 0x04, 0x22, 0x00, 0x3f, 0x2d
OpenZWave Detail,
OpenZWave Info, Node035, Received SensorMultiLevel report from node 35, instance 1, Power: value=6.3W
2020-02-18T22:00:13.428Z z2m:Zwave ValueAdded: 35-49-1-4 Power
OpenZWave Detail, Node035, Initial read of value
OpenZWave Detail, Node035, Notification: ValueAdded
OpenZWave Detail, Node035, Notification: ValueChanged

Ok, read the entire topic. And a lot of other topicsā€¦

I am a long time Vera user (10 yrs) and have HA running with the Vera integration for about 2 months now. I am not so very happy with the support and integration of zwave devices in Vera. A lot of devices are not supported in the correct way in terms of displaying the right devices type and control buttons etc.

I am now in the proces of investigating an alternative for Vera.

I have a USB zwave stick (aeotec zwave+) and I wonder what nextā€¦

I really canā€™t place this zwave2mqtt vs Vera vs zwave: in HAā€¦ what is a benefit of both or one? Whatā€™s best to start a migration? What is what? Assume I am a non on HA and zwave level.

Thanks in advance!

TL;DR - Zwave2MQTT is an opensource version of the Vera aiming to bring more functionality and control while eliminating some of the issues of built in Zwave in HA. Bring a network controller (zstick), install the software on a device (add-on or separate docker container depending on your HA install method) and configure MQTT with HA. Zwave in HA tries to roll all of the network and device control functionality into one software package (HA). Both depend on the development of OpenZWave for support of devices.

If I understand things correctly (and someone correct me please if I miss-type something)

Each option is its own ecosystem with its own set of developers and level of functionality/integration. Vera is semi-closed meaning they implement the Zwave protocol as published but depends on their own system updates to support devices. You have to use their GUI or interface to change Zwave device settings or parameters. The Vera integration allows HA to interface with the Zwave devices through the Vera gateway for control/status only such as turning lights on/off from HA or locally (there may be other limitations). Zwave built into HA uses OZW 1.4 and has the add/remove node, network control, and other Zwave network status functionality built in. There is more control such as sending service calls directly to Zwave devices to set parameters. However, some newer devices arenā€™t supported and require you to update some files to add device definitions. Another downside is every time HA is restarted, so is the Zwave network and subsystem thus potentially causing issues. Z2M aims to decouple the Zwave network from HA by running a separate Zwave network ā€œserverā€ (for a lack of a better term) and communicating over the MQTT topic publisher/subscriber protocol. Then leveraging the HA MQTT discovery services for creating entities such as lights and switches. However, Z2M just like HA depends on the development of OZW to support devices, but Z2M at least (I think) has an option of being built with OZW 1.6 which supports more/newer functionality and command classes. Now when HA reboots, the Zwave network stays running separately and HA just reconnects to the MQTT broker for control and status updates.

Ah, that makes sense and makes me exited :-).

I run hass.io and I can install zwave2mqtt via add-on. So when I reboot (sometimes multiple times an hour), I think it completely reboots all containers included, so also including z2m? So is this a good approach for me? Or should I run z2m another way? What is the best approach? Btw my hass core (hass.io) runs in hyperv currently.

:tada: Release v0.5.0

Full Changelog

:tada: Major update release!

This upgrades the add-on to the latest Zwave2Mqtt (v2.2.0) using OpenZwave 1.6!

It also means, we are now using the latest and greatest device database available, and are now able to keep up with the device database from the OpenZwave project.

:hammer: Changes

  • :fireworks: Updates maintenance/license year to 2020
  • :pencil2: Funding adjustments
  • :pencil2: Fixes some spelling and grammar
  • :arrow_up: Upgrades git to 2.24.1-r0
  • :arrow_up: Upgrades yarn to 1.19.2-r0
  • :arrow_up: Upgrades eudev to 3.2.9-r1
  • :arrow_up: Upgrades lua-resty-http to 0.15-r0
  • :arrow_up: Upgrades libusb to 1.0.23-r0
  • :arrow_up: Upgrades openzwave to 1.6.974-r0
  • :arrow_up: Upgrades openssl to 1.1.1d-r3
  • :ambulance: Upgrade node-serialport on the fly for Node 12.x support
  • :pencil2: Fixes some spelling and grammar
  • :art: Config.json file formatting
  • :ambulance: Fix Patreon link
  • :arrow_up: Upgrades nginx to 1.16.1-r6
  • :arrow_up: Upgrades nodejs to 12.15.0-r1
  • :books: Update add-on documentation to use new YAML configuration format
  • :hammer: Re-branding
  • :hammer: Update add-on config with new password & list features
  • :hammer: Updates for upstream Supervisor changes
  • :arrow_up: Upgrades add-on base image to v7.0.2
  • :arrow_up: Upgrades open-zwave database to 2e18ba844ff75965819c0dad74817a3178dbe8da
  • :arrow_up: Upgrades Zwave2Mqtt to v2.2.0
  • :hammer: Donā€™t use apk cache on cleanup

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

1 Like

Iā€™m unclear how you can run this on a HyperV since usually a USB stick is required and those do not pass thru?

The idea usually is that this runs on a separate box, like a raspberry pi, so that it is separate from the real Home Assistance instance doing all your work and that you reboot frequently. This way the zwave box can stay up most of the time even if you are rebooting the HA instance.

I do not use this (had trouble early and did a USBIP version instead which is a similar concept), and it works great; no zwave impact to reboots, for the price of an rPi, with my HomeAssistant running in HyperV with all the benefits of snapshots and real hardwer.

So I had to be more clear.

I am aware that hyperv cant do usb passthrough, hence I would like to know ā€œhow elseā€ can I install the best and stable and most easily manageable zwave2mqqtā€¦

And second, if I would run on esxi on which I can do passthrough, I would run hass core (hassos) and z2m as addon, would that be sustainable in terms of hassos reboots etc.? Or would the above also apply that in both situations running zwave2mqtt on another ā€œinstanceā€ is the best way forward and then again, what way would that be?

Keen on your thoughts.

With the caveat Iā€™m not using it only following along and planning toā€¦

If itā€™s a second computer, or second vmware instance, I know you are good.

If itā€™s in the same instance, let me be careful with terminology: if you run a reboot (e.g. manual reboot of the VM, or HAā€™s supervisor, system reboot) then itā€™s going to reboot the zwave2mqt also.

If you do a HA server restart (e.g. from server control, which is what I suspect you are doing so frequently) then I do not know, it depends on how they have it set up; someone else maybe can answer, or give it a quick try (even if you donā€™t have it hooked up and working you can watch if the docker image restarts).

But if it were me, for easy maintenance and sure fire control, I would put it in a separate instance, or on a separate box entirely like an rPi. In that case it has very, very little running on it, should not require much maintenance (only if you want to upgrade the zwave components), and so rarely needs to reboot. If your VMWare instance is pretty much 24x7x365 you can do it there, but if you reboot it frequently you might find an rPi a worthy add-on.

Weā€™re getting thereā€¦

Whats the best way/method to simply install zwave2mqtt on and esxi vm?