0.103 changed my zwave device names without asking

Upgrading to 0.103 changed a bunch of my zwave device names, for example

light.homeseer_hs_wd200_wall_dimmer_level_2
got changed to
light.homeseer_technologies_hs_wd200_wall_dimmer_level_2

But my Lovelace page was still referencing the original name so it looked as if the node/switch was dead. This happened to my Zooz switches, Qubino dimmer, Aeotec multi sensor and a few others. And when I down grade back to 0.102.3 the names change back and everything works. Is there a logical reason for this? It would be super annoying to comb through all my automations and node-red flows to update names if they’re just going to change again in the future.

What version did you upgrade from? I don’t think the zwave naming has changed in quite a while.

I upgrade with every new version, so went from 0.102.3 to 0.103.5. And when I down grade back to 0.102.3, the names change back.

Have you checked the release notes in the blog?

There were some zwave changes, one of them generic

I just upgraded to 0.104 hoping things would fix themselves, they did not, they got worse. Then I noticed the first line in my OZW_Log.txt file says
OpenZwave Version 1.6-962-gcbe2b60f-dirty Starting Up
I thought HA uses version 1.4? I do not have a config_path setup in my configuration.yaml file. Looking at an older version of my log file from HA 0.102.3, it says
OpenZwave Version 1.4.3440 Starting Up

Some how HA is using OZW 1.6 but it should be using 1.4??? I’m running on a Mac if that matters.

I just installed 0.104 using Docker:

x86_64
dev false
docker true
hassio false
os_name Linux
python_version 3.7.6
timezone America/Los_Angeles
version 0.104.0
virtualenv false

OZW looks fine:

2020-01-15 18:46:36.622 Always, OpenZwave Version 1.4.3452 Starting Up
2020-01-15 18:46:42.662 Info, Setting Up Provided Network Key for Secure Communications
2020-01-15 18:46:42.662 Info, mgr,     Added driver for controller /dev/zwave
2020-01-15 18:46:42.662 Info,   Opening controller /dev/zwave
2020-01-15 18:46:42.662 Info, Trying to open serial port /dev/zwave (attempt 1)
2020-01-15 18:46:42.675 Info, Serial port /dev/zwave opened (attempt 1)

Perhaps you have some rogue version installed? Have you ever built a development version yourself in the past? The version number would seem to indicate it’s build from a git clone (commit gcbe2b60f), with modified files (dirty). Do you have a zwave custom component installed that might be loading a different version of the module? What does pip say about your installed module?

/config # pip freeze | grep ozw
homeassistant-pyozw==0.1.7

Pretty sure I didn’t build a development version in the past. But it’s totally possible I installed something a long time ago not knowing what I was doing.

Here’s what pip lists for my version of ozw, not sure what the warning is about.

pip3 freeze | grep ozw
WARNING: Could not generate requirement for distribution -BB 0.1 (/usr/local/lib/python3.7/site-packages): Parse error at "'-BB==0.1'": Expected W:(abcd...)
homeassistant-pyozw==0.1.7

I do happen to have open-zwave installed in home-brew, not sure why home assistant would use that. Again, most likely installed it not knowing better. Let me try removing that and seeing what happens.

brew list open-zwave
/usr/local/Cellar/open-zwave/1.6.962/bin/MinOZW
/usr/local/Cellar/open-zwave/1.6.962/bin/ozw_config
/usr/local/Cellar/open-zwave/1.6.962/etc/openzwave/ (1185 files)
/usr/local/Cellar/open-zwave/1.6.962/include/openzwave/ (127 files)
/usr/local/Cellar/open-zwave/1.6.962/lib/libopenzwave-1.6.dylib
/usr/local/Cellar/open-zwave/1.6.962/lib/pkgconfig/libopenzwave.pc
/usr/local/Cellar/open-zwave/1.6.962/lib/libopenzwave.dylib
/usr/local/Cellar/open-zwave/1.6.962/share/doc/ (51 files)

Are you using a python virtualenv?

I’m on MacOS and python is installed through Home Brew so I don’t think I have any virtualenv going on. When I uninstall open-zwave, I get this in the HA log file when starting 0.104

2020-01-16 00:35:39 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Z-Wave (import from configuration.yaml) for zwave
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/config_entries.py", line 215, in async_setup
    hass, self
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/zwave/__init__.py", line 340, in async_setup_entry
    from openzwave.option import ZWaveOption
  File "/Users/mega_man/.homeassistant/deps/lib/python/site-packages/openzwave/option.py", line 29, in <module>
    import libopenzwave
ImportError: dlopen(/Users/mega_man/.homeassistant/deps/lib/python/site-packages/libopenzwave.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/open-zwave/lib/libopenzwave-1.6.dylib
  Referenced from: /Users/mega_man/.homeassistant/deps/lib/python/site-packages/libopenzwave.cpython-37m-darwin.so
  Reason: image not found

So it’s looking for open-zwave version 1.6 but can’t find it. But when I downgrade to HA 0.102.3, I don’t get this error and all my zwave stuff works like normal. The log files says I’m using open-zwave 1.4.

I would try uninstalling the homeassistant-pyozw module, and make sure the contents are gone from /Users/mega_man/.homeassistant/deps/lib/python/site-packages and then re-install it, or let HA install it when it starts up.

I uninstalled all the zwave packages I had from pip3 and home brew,

open-zwave
python-openzwave
homeassistant-pyozw

Running 0.104.1 zwave doesn’t work and gives a similar error I showed in the earlier post, in 0.102.3 zwave works 100% ok. Digging into your virtualenv question, I noticed the installation instructions for MacOS says to setup a virtual environment. That was not a thing when I first installed home assistant version 0.69, so I’ve never done that. Have I just been lucky until now? My limited knowledge of a virtual environment is that it keeps all the dependences correct?

I’ll give this a shot

These instructions seem to be a little more clear. I’ve never setup a virtual environment before

I got my install to work in a virtual environment, but I get the same exact effect

Error from the 0.104.1 run. Similar to before but the paths now point to the environment I setup

2020-01-16 21:38:04 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Z-Wave (import from configuration.yaml) for zwave
Traceback (most recent call last):
  File "/Users/mega_man/.homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 215, in async_setup
    hass, self
  File "/Users/mega_man/.homeassistant/lib/python3.7/site-packages/homeassistant/components/zwave/__init__.py", line 340, in async_setup_entry
    from openzwave.option import ZWaveOption
  File "/Users/mega_man/.homeassistant/lib/python3.7/site-packages/openzwave/option.py", line 29, in <module>
    import libopenzwave
ImportError: dlopen(/Users/mega_man/.homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/open-zwave/lib/libopenzwave-1.6.dylib
  Referenced from: /Users/mega_man/.homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so
  Reason: image not found

Running 0.102.3 in the virtual environment works for zwave.

One thing I noticed is HA 0.102.3 uses homeassistant-pyozw==0.1.4, not 0.1.7. So something in homeassistant-pyozw==0.1.7 it telling it to look for open-zwave 1.6 maybe?

I suspect it’s just an issue with your environment. I don’t use HA on my Macbook, but I just setup a venv and installed homeassistant-pyozw-0.1.7 without any issue. I have never installed openzwave with Homebrew. I posted my build log if you want to compare.

I would look and see what this line says:

Found library libopenzwave : False

If it’s finding something else, like a 1.6 library, then it won’t build the embedded one.

To get a build log, you can use the --log <filename> or -v flags when installing via pip.

pip install --log pip.log homeassistant-pyozw
pip install -v homeassistant-pyozw

I would try the install in a brand new venv in a new directory and see what the build logs say.

ok, I got something. I had to uninstall homeassistant-pyozw and its dependencies and run pip with the --no-cache-dir option, but I got this on my Mac mini.

Found library libopenzwave : True

I tried looking through the log, but I couldn’t find anything obvious. Here’s a link

https://paste.ubuntu.com/p/y7k2cSz2nV/

I really appreciate the help

Well, your logs indicate that it definitely built an openzwave library and packaged it. I don’t know enough about how shared libraries work on Mac OS. Are there any remnants of libopenzwave that are in /usr/local/lib?

I see these files when I search for libopenzwave in/usr/local/lib

Digging into the dependencies of libopenzwave.cpython-37m-darwin.so I noticed some differences between my mini and the test install I did on my MacBook.

On Mac mini, this library points to a library that doesn’t exist. libopenzwave-1.6.dylib

otool -L /Users/mega_man/homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so

/Users/mega_man/homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so:
/usr/local/opt/open-zwave/lib/libopenzwave-1.6.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)

Running same command on MacBook 0.104, it doesn’t reference that file

otool -L /Users/berns/homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so

/Users/berns/homeassistant/lib/python3.7/site-packages/libopenzwave.cpython-37m-darwin.so:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)

Something about upgrading homeassistant-pyozw (0.1.7) made it rebuild that library referencing the, I now know unnessisary, open-zwave 1.6 package I had installed. What fixed it was uninstalling all my zwave related packages and reinstalling homeassistant-pyozw with the no cache option. Ultimitally I did this to myself by installing everything with the word zwave in it a year ago trying to get my zwave network going.
I have open-zwave 1.4 working on 0.104 now, but my node list is screwed up from running initially in open-zwave 1.6, I think. I’m assuming these is some cache I need to delete or something.

Thanks again for the help, I learned a few things digging into this weird issue.