Z-Wave devices and Docker/migration

I’m new to Z-Wave, but if I understand things correctly you have to add the devices through the network controller via “inclusion” which requires you to physically go to each device and hit the learn key or the like. Is there no way of automating this? If you use docker to rebuild your service from scratch, this seems like a major hassle.

yes, that’s the only way to do it. No matter what system you use it will be the same.

I’m not sure what you mean by this.

Once you pair your device with the z wave controller the device info is in the controller. HA just reads the info from the controller and sets up the devices from the info in there.

If you move from one HA install to another (like docker) then you just need to transfer the z wave controller address and such in your configuration file. And if you already have all of your configuration files including the registry you should just be able to reference those files in the new install and it will be pretty seamless.

I’ve done it and it wasn’t any trouble at all from what I recall.

Unless I’m misunderstanding…

So if I restart HA from scratch, HA will discover the same devices using the same entity ID?

The entity id (entity registry) has nothing to do with Zwave and it’s pairing/inclusion process.

But HA does define the entity ID for you.

If I’m understanding you correctly, then, yes.

If you’ve paired your devices with your Z stick properly then if you wipe your install and start over from scratch then HA should read the info from your controller and repopulate your devices (including the default entity_id).

I kind of do that every time I update HA using Docker. I remove the old container and rebuild it entirely from a new image.

But your zwave config lives on in your config directory. You don’t delete that every time

True but if the XML file doesn’t exist then it will create it from the z stick just like it does on initial installation.

Now, I agree that you will lose any information in the registry file. Which is why you shouldn’t use the GUI to modify the entity ids generated by the XML file. And its another reason why things need to be able to be modified directly on the controller. Kind of like it used to be. :roll_eyes:

Don’t get me wrong. I think the way z wave is being implemented now is inconvenient to say the least but the inclusion process isn’t the problem.

And if you’re migrating from one HA install to another and you still have your config files it won’t be painful at all.

I f you lose your config files then z wave will just be one of many more catastrophes to recover.

Ideally you should only have to backup the .yaml files, and possibly some state files like homekit, nest, etc.

And conf files, like Plex, etc.

Seems easier to backup the entire config directory ignoring a few files like the DB and logs…

That’s exactly what I do.

Is there a list of these files anywhere that would get you from a working Home Assistant (and Hass.io) to a new instance? From iOS devices, nest, etc. I’d like to find a way to completely automate my setup on a new device.

Just copy the entire config directory except for the log file and the DB.

Ok, I think I’m being dense on this but re-reading the thread what you are asking is “how do I migrate an existing good install of HA over to Docker?”

Is that right?

If so, you just need to create your Docker run command (or docker-compose file) that points the container to your existing configuration directory.

Then the container will automatically pick up the configuration exactly the way it was before migrating - including the z wave config as long as you give the container access to the z wave device. You will also specify that in your Docker run command.

Here is an example of how that command should look:

sudo docker run -d --name="home-assistant" --restart=unless-stopped -v /home/finity/docker/hass-config:/config -v /etc/localtime:/etc/localtime:ro -v /home/finity/docker/sshkey/.ssh:/root/.ssh --device /dev/zigbee:/dev/zigbee --device /dev/ttyUSB-ZStick-5G:/dev/ttyUSB-ZStick-5G --net=host homeassistant/home-assistant

Close, what I’m trying to do is to be able to completely setup hassio, including pulling all of my configuration files (including addons) from my settings repository. So I would run the hassio install script which would setup the supervisor, which in turn installs the home assistant container, then (my script which installs hassio) would clone my repo into the data directory so I have not only have config files for home assistant, but so that the supervisor knows which addons to create containers for and to use the config settings I put in the GUI.

I actually created this post while you were typing your response.

Ah, I don’t use Hassio so I’m not going to be of any use for anything that deals specifically with that.

Don’t sell yourself short. You’ve been very helpful (to me at least) with many things related to docker.

1 Like