Parallel HA install for development?

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.

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

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.

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.

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…

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

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

Same here. I want a dev environment. Ideally running totally independent on a 2nd laptop. This should even work when I am abroad. I am running HA core in docker. I want to develop when I am not at home as well (traveling a lot). But on the laptop for sure I don’t have access to some of the integration (hue, KNX, etc.). Anyone an idea how this can be achieved?

I’d say VM is the way to go here. Though you must take in account that some integrations can only be setup once (e.g. Homekit accesoires can only be paired to a single device).

Though, is it entire HA you want or just lovelace? Because if it is the latter you can simply move folders (or wait til we can have multi lovelace setups, which is in the works to my knowledge).

Hi,

i would even like to have a totally independent dev system. Think me/my laptop being in Spain and my home system runs in Germany. So there is no KNX bridge which can be reached on the dev system. Can I bring the dev system to a state where it ignores the KNX part (KNX stands for any other binding).

Regards
Ralf