core: Z-Wave Devices (Undefined/Undefined) after restart
The problem
Either when upgrading from 0.107.6 -> 0.107.7, or when upgrading the supervisor, or just on a random restart I noticed that some of my Z-Wave device stopped working. I have almost 50 devices, and about 15 of them now showed up in the Z-Wave configuration tab as (Node:undefined undefined) instead of the normal node ids.
I tried opening/closing a door sensor and I got the following log entries in the Z-Wave log:
2020-03-31 17:08:37.245 Info, Node028, ApplicationCommandHandler - Unhandled Command Class 0x71
2020-03-31 17:08:44.511 Detail, Node028, Received: 0x01, 0x12, 0x00, 0x04, 0x00, 0x1c, 0x0a, 0x71, 0x05, 0x00, 0x00, 0x00, 0xff, 0x06, 0x16, 0x00, 0x00, 0xbc, 0x00, 0xd8
2020-03-31 17:08:44.512 Detail,
2020-03-31 17:08:44.512 Info, Node028, ApplicationCommandHandler - Unhandled Command Class 0x71
2020-03-31 17:08:47.444 Detail, Node023, Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x17, 0x02, 0x98, 0x40, 0xc7, 0x00, 0xfb
I then started browsing the forums and found this thread of people having problems with Z-wave, and there was some mention of replacing the zwcfg.xml file from a backup.
I pulled my backup did a WinMerge with the existing file and I found that the existing file that particular node that I was having problems with (Node 28) had nearly all of its CommandClass tags missing in the new file. In fact, all of the nodes that I had listed as undefined undefined were missing data. Attached are my two files below I think some process is deleting data from the zwcfg.xml file in the latest versions of Home Assistant.
Environment
arch | armv7l dev | false docker | true hassio | true os_name | Linux os_version | 4.19.106-v7 python_version | 3.7.7 timezone | America/Los_Angeles version | 0.107.7 virtualenv | false
- Home Assistant Core release with the issue: V0.107.7
- Last working Home Assistant Core release (if known): V0.107.5
- Operating environment (Home Assistant/Supervised/Docker/venv): HASS
- Integration causing this issue: Zwave
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/zwave/
Problem-relevant configuration.yaml
Traceback/Error logs
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 66 (6 by maintainers)
I have also been having issues after reboots or shutdowns however it appears to be easily fixed by shutting down the HA docker pulling out the Zwave stick and putting it back in, then starting again.
I SUSPECT that something isn’t being released correctly on HA reboot or shutdown.
@geeak @binbin2000 That is an already known problem. https://github.com/home-assistant/core/issues/33048#issuecomment-602032390. Re-create your docker container, removing a run argument if you have one set.
@Insension HA doesn’t use python-openzwave, it uses homeassistant-pyozw. Downgrading it won’t do anything either because the version number is fixed in the component code. HA will just upgrade it on startup if it finds the wrong version. You’d need to modify the source code to set a different version.
I’ve had the same issue, though I (tisk tisk) upgraded directly from 0.94 to 2020.12. Since the upgrade I’ve had general OZW issues with nodes staying unavailable for hours after a restart, a bunch of node-related entities not working at all, and nodes missing their names. After a restart this morning, all of my Zooz 4-in-1 sensors stopped working… which was a real pain because most of my lights are now motion-controlled using them. I’ve had this setup for 2 years, for most of the lights in my house, and never had a problem until this upgrade. Post-upgrade, I was also noticing a LOT of “Unknown command class” errors in the log.
Sure enough, going by the earlier replies in this thread, I restored my zwcfg.xml from a 2-week-old (pre-upgrade, I think) backup, and everything seems fixed now, values are showing up correctly, and the “Unknown command class” messages are gone. The zwcfg.xml from backup is nearly twice the size of my current/previous/broken one.
I do daily backups of my HASS config directory. For the time being, I’ve added an hourly cronjob that calls
/api/zwave/saveconfigand then copies the zwcfg.xml to a per-hour file. Hopefully that’ll let me retrieve the most recent but good config when needed…I have not been able to investigate this properly, but I noticed that my OZW log on 107.7 complains about not being able to get an exclusive lock on ttyACM0 (which is my z-wave stick). And checking the open files there are two python instances, one python and one python3 having /dev/ttyACM0 open. Starting up HA with a zwcfg restored from backup does not help.
My guess is that the two processes are clobbering each other and both end up getting partial and corrupted data, and mayhem ensues.
0.106.6 does not exhibit this issue.
Running the official docker images.
Yes, it will create a new one. If you are having network errors though, that will prevent it from working.