My first time Home Assistant and OpenZWave experiences

I’d like to share my experiences with Home Assistant (HA) and Openzwave (OZW). I recently moved, thought “it’s almost 2018, that home automation zwave stuff must be mature enough by now, let’s try it”. But boy, what a struggle it has been so far. Please allow me to rant a little bit about the experience, my goal is to use enough of the right keywords per issue so that others having similar troubles find this post and can maybe use it to their advantage. Some thing may not be accurate or 100% correct, but please bear with me. In the end I’d love to hear about any things I missed or other comments. I appreciate all the efforts that went into the relevant products, please treat everything as positive feedback, maybe mixed with a little frustration :wink: So, here goes.

First the very unnuanced summary:

  1. The Openzwave cache file ‘zwcfg_*.xml’ is used to name the zwave entities in Home Assistant. Why is a CACHE file being used for something so critical, I ask myself?
  2. Many timeouts in my zwave network due to ‘unsupported commands’ (did I mention it’s 2018 now and the switches I use were introduced in 2016?)
  3. Timeouts because of out-of-range issues (good luck distinguishing between the previous point and this one when you have both issues and are new to zwave!)
  4. Abismal performance when switching a few things simultaneously. Literally taking full minute before the final light comes on (this is with a subset of four lights…)
  5. Zwave plus security feels like too much of a hit on performance. It’s not usable with many devices operating (nearly) simultaneously.
  6. When switching off a dimmer, for some reason the communicated value is actively refreshed from the device multiple times. Unnecessary, because the dimmer communicates the correct values! Now knowing how easily the network can become congested this has to be eliminated. But what component is doing this. Home assistant? Openzwave? The python wrapper of openzwave?
  7. You want to enable debug mode for the openzwave library, good luck finding out how!
  8. Why is there ‘workaround’ code in a home assistant zwave component for specific zwave devices? Shouldn’t this be in Openzwave itself? That has al kinds of possibilities/extensions/code to handle these things.

Ad 1:
Initially I had things up and runnig quite quickly. Until one day, don’t remember what the exact trigger was or if there even was any, I couldn’t control my switches/dimmers anymore. The physical switches still worked, so it had to be something related to HA. Finally, after hours of getting nowhere, I found out that my entities changed names, or some received the same name. Don’t ask me how this happened, it just did. I found out that HA takes the names of all zwave entitites from the OZW cache file called ‘zwcfg_.xml’. This is the only place these names are administered. In an OZW cache file. (https://github.com/OpenZWave/open-zwave/wiki/Configuration, “Generally, users, and application developers should never modify this file, but sometimes it might be required to delete the file, so the library can refresh the network devices and configurations.” No wonder I didn’t find this quickly. I actually had to delete this file many times due to all other Zwave issues I was having. I did not expect any configuration to be done in a cache file. So, I ended up creating a script that renamed all nodes in the cache file, and fixed any duplicate names. So that I could delete that cache file when required, and quickly add all the defined names that my HA config was expecting. (If anyone wants to do something similar and needs some inspiration, here is my script: https://gist.github.com/jrkoiter/037acacc58a96753b2cc79dc7446a370)

Ad 2:
The OZW_Log.txt file is your friend. I noticed many timeout messages in the logs. Again many hours spent, eventually I stumbled upon the Log Analyzer on openzwave.net. It’s great! (They do advise you to delete the ozwcfg file btw…) I was told that timeout messages could be due to devices not responding to some commands. Because they advertise they support those commands, but not actually respond to them! Oh that really builds my confidence…oh well, there will be a firmware update for these things hopefully, as I was told zwave plus supports ‘over the air’ updates. (spoiler: no updates possible at all with openzwave, only with the proprietary conrollers like the fibaro thing, bummer! So whatever firmware version you get, you’re stuck with it.) Anyway, the timeouts I was seeing were connected to my Fibaro dual switch modules, specifically ‘commandclass COMMAND_CLASS_SWITCH_MULTILEVEL.’. I eventually learned that OZW has config files for many devices, to fix or work around these kind of quirks. In this case its in the ‘fgs223.xml’ file of the OZW distribution. But wait, it mentions command class 38 (which is COMMAND_CLASS_SWITCH_MULTILEVEL) as not supported, and has some config to work around that. But it’s not working, I guess?! OZW still tries to send this command to that device, I thought it was specifically on a refresh call. But I now knew my way around that OZW cache file a little bit, so I just removed the element regarding that command class for these devices, restarted, and gone were the timeouts! Oh and same story for command class 39 for these devices (COMMAND_CLASS_SWITCH_ALL). Not supported. But also not listed in that ‘fsg223.xml’ file, weird… Anyway, same fix: delete it myself from that OZW cache file and restart. And writing this workaround down somewhere so I can do it again when I need to recreate this cache file for some other reason…

Logging example of this issue:

2018-01-30 08:07:34.815 Info, Node034, Sending (Query) message (Callback ID=0x1c, Expected Reply=0x04) - SwitchAllCmd_Get (Node=34): 0x01, 0x09, 0x00, 0x13, 0x22, 0x02, 0x27, 0x02, 0x25, 0x1c, 0xd9
2018-01-30 08:07:34.820 Detail, Node034,   Received: 0x01, 0x04, 0x01, 0x13, 0x01, 0xe8
2018-01-30 08:07:34.820 Detail, Node034,   ZW_SEND_DATA delivered to Z-Wave stack
2018-01-30 08:07:34.835 Detail, Node034,   Received: 0x01, 0x07, 0x00, 0x13, 0x1c, 0x00, 0x00, 0x02, 0xf5
2018-01-30 08:07:34.835 Detail, Node034,   ZW_SEND_DATA Request with callback ID 0x1c received (expected 0x1c)
2018-01-30 08:07:34.835 Info, Node034, Request RTT 19 Average Request RTT 42
2018-01-30 08:07:34.835 Detail,   Expected callbackId was received
2018-01-30 08:07:44.816 Error, Node034, ERROR: Dropping command, expected response not received after 1 attempt(s)
2018-01-30 08:07:44.817 Detail, Node034, Removing current message
2018-01-30 08:07:44.817 Detail, Node034, Notification: Notification - TimeOut

Ad 3:
The timeouts that were left had to do with devices being out of range, or with bad reception. They usually work, but not always! But OZW already gave up after 1 try. Didn’t even retry. So I ended up changing MAX_TRIES to 2 in Defs.h of OZW (yes I already reached the point of running my own compilation of OZW…). And building a better mesh of course also.

Ad 4:
With these things worked out I finally could spend some time actually doing what I wanted: automate a few things! But with only four lights switching on/off/dimming as a group, the performance was very very bad. Sometimes it was ok (lights reacting quickly after each other), but most of the times some didn’t react at all, or with very long time in between. Ok, back to the OZW_Log.txt file again. First thing to notice: a lot of chatter to switch just four lights!! I must be able to bring that down and thereby solve the issues, or make it bearable at least…

Ad 5:
First candidate: the security related messages of zwave. It seems they are creating a LOT of overhead. So much that you actually notice it when switching things! Let alone multiple things at the same time. So I made the decision to ditch the security and save a ton of messages going back and forth. If someone wants to drive to my house to wreak havoc on my lights: be my guest. At least this way I can hopefully actually use the network for myself as well!

Ad 6:
Another thing that I noticed on OZW_Log.txt is that many values were ‘refreshed’. Even though they were correctly communicated to the controller. So the dimmer would say ‘I’m switched off now’. OZW would mention the values were ‘not verified’, and right after a message was sent by the controller to get an updated value from the dimmer. Why?? It was not at all clear where this refresh request was coming from. HA? OZW? The Python OZW wrapper? I literally had to spend hours to finally find out: it was the python wrapper! The thing I least suspected! I investigated and tried many things in HA, in OZW, and finally ended up in that python wrapper: https://github.com/OpenZWave/python-openzwave/blob/50bfa05c667449a7c9a5218c1d7ce61f0c193046/src-api/openzwave/command.py#L612. It has some code to work around some kind of ‘issue’ with dimmers not reporting their status correctly. And therefore it is sending TWO additional messages to refresh the value! Sure, only two, but they pile up and are killing my zwave network. And my dimmers don’t even have this ‘issue’. Why is there even this kind of code in a wrapper! Why isn’t this code in OZW itself?? Fix: comment out those few lines in command.py, and now all is well!

Logging example of this issue:

Refreshing node 29: COMMAND_CLASS_SWITCH_MULTILEVEL index = 0 instance = 2 (to confirm a reported change)

Ad 7:
HA has a ‘debug’ setting for the zwave platform that you can set in the configuration.xml file. But it doesn’t lead to messages of level ‘debug’ to end up in OZW_Log.txt. Instead it causes a lot of error and warning messages that were not there before?! And OZW itself has options to enable debug in its ‘option.xml’ file. But HA has two of those. One in the python site packages dir, and one in the HA homedir. I ended up adding ‘SaveLogLevel’ with value ‘8’ (debug) to both, but nothing changed. Oh well. This one I gave up.

Ad 8:
This one I only noticed, but didn’t actually run into any issues with. But why is there device specific workaround code in HA for zwave devices? https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/zwave/workaround.py . Can’t (shouldn’t) this be in OZW itself?

So, there you have it. Maybe it is useful to someone at some point. Hope I didn’t offend anybody, like I said before I think all components involved are excellent and I enjoy them very much. I just underestimated the time involved to get them to work reliably together, I guess.

13 Likes

Great work!

I’m sure this thread will help a lot of people.

I’ll definitely need to look into some of these things as I’ve had my share of Z wave issues. I thought it was hardware related (Aeotec G2 micro switches & Aeotec in wall dimmers - some I have returned/replaced). Maybe it was software all along.

Right now I have one more Aeotec G2 randomly not updating it’s status consistently and now occasionally showing as “dead” until I heal the network.

you did yoeman’s work for sure on this… thanks for posting these “deep dive” details, extremely helpful. I’m in the process of deciding which technology to invest in and was considering z-wave. Initially will deploy two thermostats and a small number of lighting controls to a vacation home and desire remote control to preheat and turn on the lights before arrival.

The logging issue is one to get an answer on, I would think.

So exactly one of your issues somewhat indirectly has anything to do with home assistant, point number one. And I say indirectly since its still and ozw issue renaming entities.

In the latest release HA now creates unique eneity ids so this issue with zwave changing names should go away.

  1. Debug in HA is for the HA component, not ozw

  2. Not sure about that, but maybe ask the openzwave guys why we have to put specific workarounds in?

That’s really unfortunate that you’ve had a bad experience.

My experience is the complete opposite. It’s been great and smooth with 12 zwave devices and counting.

So the workarounds, it looks like this was because of zwave config files not being updated, so someone hacked it to map devices to working devices. We recently updated open zwave so I bet these are no longer necessary.

And yeah, zwave has always worked great for me (besides the entitiy renaming) but ZigBee on the other hand…

I have had my frustrations as well. After switching out most of my 433 MHz network from Telldus to HA and Z-wave, I almost have nightmares from debugging and staring at the OZW log the last weeks :slight_smile:

Currently I have problems with Aontec dimmers and NorthQ power reader. Aeotec dimmers worked fine for a couple of months, but then it was just random (Z-wave issue - HA sending value 0). There is a thread about the NorthQ Power Reader, but I haven’t had the time to debug it yet (NorthQ NQ-92021 Power Reader).

I currently have 36 Z-wave devices. I have not yet noticed any large delays in my network. Looking at the log, It can be 10-20 seconds between a device-update on idle, so there is some breathing-room - but when I try to dim my Nexa dimmer it generates 713 lines in the OZW log, so I think there is something weird going on.

My conclusion is that using HA and Z-wave without the OZW log, is like using a rock instead of an hammer when building a house at this moment :slight_smile: This is mostly because missing feedback in the GUI and a lot of restarts.

Im reassured to read that more people face problems with zwave . I’m partially thinking to stop home assistant entirely but then I think after spending 100 of hours and more than 1000€ for all my stuff I think no…I must continue.

I have those remotec zwave ac ir device and even after using always listening mode they appear dead or just don’t react.nice at this period of the year.

I recently bought Intel nuc and I’ll setup home assistant with all automation and components from scratch.also zwave.

I hope after restarting with reset devices.empty files and fresh system it will work. I hope so as I also built my home security with zwave.

Problems with mixed non secured and secured (zwave plus) network should really not be a problem but I read those often here.

Well. I’ll come back here with a 100% fresh installed home assistant and reset zwave network/devices and will report back.

Till then I have to accept that my sh**** remotec devices won’t work as needed.pity for those extraordinary prices for zwave.80€ for one device. Sometimes I think zwave is more like for devs and play kids than serious devices.even those Chinese Xiaomi stuff works better costs 10% of the zwave price and even looks better.

We will see the future for my zwave network here.if not u can buy all my stuff on eBay the next upcoming weeks :grin:

Point 6 (and Ad6) needs to be addressed. It’s what causes timeouts in my network. Almost everytime I see the controller waiting for something it’s those checks that have piled up.

Thanks for writing this article.

Well, I finally gave up.
Zwave on Home Assistant is just horribly unreliable, and impossible to troubleshoot in any meaningful way.

I’m still using home assistant, but I’ve offloaded my zwave network to a Vera controller that connects in to Home Assistant. Immediate impressions:

  • Network is MUCH faster, responds nearly instantaneously to commands
  • Network is MUCH more reliable, responds to commands every single time
  • Easier to work with, Devices include or exclude first try every time.

As I go on, I’m finding that Home Assistant has amazing core functionality, unrivalled by any other product I’ve seen. But there is a lot of focus on “new and shiny” and not so much on fast and reliable. For my next task I’m looking at moving my GPIOs off of home assistant to something that registers the correct state every time and can handle debounce properly without getting stuck on the wrong state.

Thanks for replying so quickly to my comment. I almost thought as much, because the unstable nature of Z-Wave in HA couldn’t be representative of z-wave as a whole. If it were, no one would buy it.

I’m placing my hopes on the latest blog article.

  • Better Z-Wave. Our current integration has room for improvement. The owner of Z-Wave has announced a public SDK, which we should explore to integrate with Home Assistant.

I will pay for HA cloud if they fix the z-wave issues because my whole house relies on z-wave.

2 Likes

For reference, I just went through the same.

I’m a bit surprised. Stumbled on this post and have z-wave via Home Assistant running for more than a year now. Best combo ever. I have about 29 devices and although somethings feel spartan… I wouldn’t say unreliable.

I’m using the aeotec z-stick gen 5.
Perhaps there is something different with types of controllers?

@joost, what USB z-wave adapter are you using?

I’m using an Aeotec Z-Wave Gen5.

These are helpful observations and will hopefully help some others debig what’s going on with their networks.
However, do you remember what you paid for HomeAssistant and for OpenZWave? Probably nothing. I’m not knocking the amazing contributions of the people who volunteer to commit to projects like OpenZWave, but they are volunteers. If you want something that’s much more stable, why not purchase a solution like HomeSeer.
I started with OpenZWave, got frustrated and went to HomeSeer. I went back to OpenZWave because I thought there were improvements and I’m a developer at heart. OpenZWave gave me the ability to have much more control over the application. But now I’m back to HomeSeer I think once and for all because I value stability more than flexibility.
Like many other decisions, you do a cost/benefit analysis and decide what’s more important to you.

I have only recently started with Z-Wave on Home Assistant and have also had issues with it being flakey or unreliable.
The entity renaming issue hasn’t hit me, but issues with randomly freezing and slow responses due to the way Z-wave is handled definitely have.
I migrated from Openhab (also free and opensource) because the Java scripting used in that was a little technical for me, but I have found I have had to put a lot more time into ZWave trouble shooting with OZW and HA.
Issues, such as some devices (ZXT-120 in particular) not responding in OZW, yet respond perfectly in OpenHab have made this a bit frustrating.

I am going to take the Vera route to control ZWave until OZW in HA is more reliable. I don’t like extra hubs, but reliability is stability is key in anything to do with home automation.

With that said, I love Home Assistant so far and appreciate all the work that is put into it.
I also understand, as @swmcdonnell pointed out, it is free. Don’t take anything said as an attack, more observations, and a little frustration. I am not looking for instant fixes. These are just accounts of my frustrations with some bugs that currently exist.

Consider this a +1 for the OP’s issues… I opened a different thread hoping to start fresh, but no replies yet:
https://community.home-assistant.io/t/status-not-updating-seems-to-be-getting-worse/85790/5

It’s frustrating to hear all the people chime in and say they have no issues and most of them use the Aeotec Z-Stick as well. That was the reason I bought that device, it seemed to be the best supported and best reviewed by HA users. In addition to everything outlined in the OP I also have an issue where every time HA is restarted a different mix of Z-Wave devices are “Entity Not Available.” After a few more restarts eventually I can get it where all devices show up, but not much else has changed besides the # of reboots. The OZW Log shows the same type of chatter each time it boots up. Occasionally I do see “Z-Wave not ready after 300 seconds, continuing anyway” in the HA logs itself, but again OZW Log shows normal Network chatter. I’m not sure what makes it ready versus not ready… just a few more restarts of HA and it’ll eventually consider itself ready.
It’s nice to hear that there’s the possibility of starting from scratch with a different Z-Wave implementation (in lieu of OZW) but in my laymen’s perspective, the issue is not with OZW. When I fire up OZWCP, all of the devices are always ready and happy, respond instantly to commands, and instantly become aware of manual device changes.

I believe the issue is likely related to the OZW Python Wrapper. It seems to be a little less than ideal.
It will be good to have a ZWave revamp using the new public SDK.

There is talk behind the scenes in how to best move forward.

https://github.com/home-assistant/architecture/issues/81

1 Like