Home Assistant Community

Parallel HA install for development?

#1

I’m this king about poking at some component code, and would like to set up a development environment as per the instructions on the web site. But I also have my live version of HA, and don’t want to take that down. I’m wondering how folks handle having two HA installs in parallel.

My current set up is a VM on an ESXi server running Ubuntu with Docker. Hass.io is installed as a container thereon.

Can I install the development environment in a second container on the same system? And change the port for the development one from the default 8123 to something else? I have an Aeotec Z-stick that’s passed to the VM, and when I set up docker and HA, it automatically picked that up, with no effort from me. What would happen here? Can I tell the system which HA instance should have access to the Z-stick? Would the both have it and share it in some way?

Alternatively, I can spinnup a second VM and have a whole other installation, with a different IP, which would make things easier in terms of Port management, but then I couldn’t access the USB device - afaik, the server can only pass it to a single VM.

I can also throw the second install onto an RPi, but I don’t really see any benefit to that over a second VM.

The other aspect is devices. I’d want access to at least some switches and sensors on the development instance, but not sure if there’s any way to share them? I can see mqtt-based items being fairly easily shareable, especially sensors, but not other things? Do I just need to set up some dummy devices to use for development, or is there a good way to share?

Thoughts? Advice?

Thanks.

#2

I had this with 2VM’s, 1 is my production HA and the other was for testing purposes. They work simultaneously, though the app can only be paired with a single instance (obviously browser works fine).

The only thing that you can’t do is to have devices which need pairing (for example homekit controller devices) to pair with both instances. Some might like IKEA Tradfri, but I have Koogeek buttons passed to HA via the Homekit controller (not the component). They can only be paired to one instance at a time.

All other stuff seemed to work without problems, that includes mqtt. I would not advise installing both instances in the same vm or even worse on the same OS (if it is not a VM). Not only would you have to setup different ports, but it is likely that you’ll run into other problems.

1 Like
#3

Does that also include z wave & zigbee sticks? Can those be paired to two instances running on the same machine but on different http ports? I’m running HA on Docker.

#4

Personally I don’t use z-wave and zigbee runs through my ikea/xiaomi hub. But if the device allows for pairing with 2 instances then yes (I doubt it though).

But it really is fairly simple to try. Just try to pair it, I don’t know how hard it is to setup z-wave in HA, but if it is as easy as just click on integration and have it pair then I would just try it (for example the IKEA hub is easy to pair/unpair. As should any other integration that can be selected from the HA UI, I think.

#5

ok thanks. I didn’t think those devices would work like that since the usb can only be accessed by one process at a time. I think…

#6

I also have a “prod” and “dev” VMs. The “dev” one usually uses a very simple configuration so it can be restarted faster, i can focus on just the thing that I need and so on… I dont do this but I saw some discussion about using MQTT event/state stream component to overcome the zwave/zigbee sticks limitation. Possibly another way should be using this https://github.com/lukas-hetzenecker/home-assistant-remote

1 Like
#7

I actually just started looking into this a couple of weeks ago trying to help another user and the statestream is more useful and user friendly than eventstream.

I’ve also set up a MQTT bridge that I’ve used to transmit messages from one instance to another in the past. That works well too but there is more configuration that is needed on both instances to subscribe to and publish to the correct defined topics. Statestream just automatically creates topics for you.

1 Like