Skip to content

Instantly share code, notes, and snippets.

@yajrendrag
Last active February 5, 2021 21:20
Show Gist options
  • Save yajrendrag/1d771173c9865b8480f445f9c557a231 to your computer and use it in GitHub Desktop.
Save yajrendrag/1d771173c9865b8480f445f9c557a231 to your computer and use it in GitHub Desktop.
homeassistant migrate from zwave 1.4 to zwavejs

Intro

I'm offering this as some additional detail on how my migration went - both to get any suggestions on what i should "fix" at this point as well as to provide some insight on what else you might run into in doing this migration.

i'm not sure if my troubles were due to irregularities of my setup, my impatience with battery powered sensors, or what, but this was a a lot of work - and i only had 32 devices - a variety of wall switches, a few outlets, some external plugs, and a half dozen motion sensors. Took me 9+ hours. In hindsight, i think the big issue i had was all related to the 5 or 6 battery powered devices and how long those took to fully show up in hass.

Hass Setup

My hass setup is homeassistant core in a venv and i run it in an LXD container so i had to use zwavejs2mqtt server and i chose to download the pkg and i run it inside the hass container - i couldn't figure out the container networking in order to just use one of the docker implementations of zwavejs2mqtt. On the host on which this all runs, i also run a docker instance of grafana on port 3000 - dunno if that contributed to my networking issue, but essentially would have needed to get the websockets port from the docker zwavejs2mqtt container to the hass LXD container... in the end it was much simpler to do what i did and run the zwavejs2mqtt in the hass container.

Migration Begins...

(I'm referencing a few comments and procedure from here - https://community.home-assistant.io/t/switching-from-zwave-1-4-to-zwavejs2mqtt/276721/9)

Once the server choice was resolved the first part of the instructions all worked as described and the network is discovered pretty quick - within minutes. i tried to wake all of the battery powered devices, but the zwavejs2mqtt dashboard never really showed them all awake. I proceeded anyway. i had already deleted the original zwave integration and powered down and rebooted / restarted everything, & once hass came back up, all of the zwave devices came into hass pretty quickly again - even the battery powered devices. so far so good.

then, i did all the renaming - just as Marcel indicated - rename at the device level which carries through to the entities if you opt to answer yes to the prompt.

Problems start here..

here's where the problems started. the battery powered devices showed up without any entities - so rather than do Petro's 7.1 through 7.4 (maybe this was a mistake on my part?), i simply deleted the zwave device and re-added it. which mostly worked, but for whatever reason, i had to do this about 3 or 4 times for 4 of the devices - these were all Aeotec multisensor 6 sensors and their water sensor 6. all of this time i tried to leave the zwavejs2mqtt server running but a few times the zwave integration became non-responsive and showed no network so i had to stop / restart both the server and hass and the battery devices had to be deleted and re-added again.... this could have been my impatience - maybe those devices just take a longer time to come up in the integration and i wasn't letting them finish? not sure. and the water sensor was even worse. it just sat there - i waited 30 minutes or longer just for it to get discovered and even still it required me to restart hass to go from showing as "NodeXX" in the devices list to "Water Sensor 6" and then not all of the entities were available... another hass restart and finally the water sensor 6 showed up with all of the entities.

Entity Name issues

The other thing is that the entity names are different. It's not simply taken care of by renaming the devices. For example, in my original zwave implementation, the motion sensor entity names were all named something like "sensor.den_burglar". In zwavejs2mqtt after the renaming that entity still didn't exist - there was only "binary_sensor.den_home_security_motion_detection". there were also 6 disabled (by the integration) entities one of which was a sensor related to motion detection, so i enabled it and changed the entity name to sensor.den_burglar.

Entity Value issues

Additionally, in my original zwave implementation, all of those burglar sensors were numeric - 0 for no motion, 3 was raised for physical movement and 8 was raised when it simply detected movement. In the new implementation state for both the binary sensor and the sensor i renamed are text strings (idle, clear, motion detected, detected, on/off) although the sensor does have a value attribute that you can capture as a numeric value. So, the net of all of this is that all of my automations that use these entities had to change.

Again, not sure if my implementation was so old and quirky and this was simply a result of that, but it took me awhile to work through all of this. Also, not sure if i would have avoided some of frustration and saved some time by giving the zwave integration more time to absorb the battery powered devices. but now i have a lot of unused zwave node IDs - i'm up to device 72 and i only have 32 actual devices... i forget how many you can have on a single controller - i'll probably not reach the limit, but at some point i may have to completely start over simply to reclaim the unused node ids...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment