How do we all manage dev, when the hardware is tied up and working with the house?

I’m a dev noob. At best i’m a script kiddie with delusions of grandeur :wink: My HASS setup has grown to the point where it’s difficult to apply new elements, or implement & test creative development without taking the house offline! the WAF means I struggle to dev to my satisfaction whilst keeping the infrastructure i’ve already worked on up and running.
How do people manage the contstant upgrade cycle / new component integration / general automation dev, whilst still keeping the house working?

I have a HASS dev environment set up on my MacBook - you can find instructions how to set up a dev env on the website. Its also where I have the IDEs I need set up (mainly PyCharm and Arduino IDE, along with GitHub desktop) so that I can quickly iterate on code and run HASS to see the changes in action.

This way my production install of HASS stays clean and I don’t need to be restarting it constantly and disrupting lights and sensors etc around the house.

I can also use it to test config for new components before adding them to my production machine.

I use a separate instance to test new functionality/config.

For upgrade, I’m running hass in a docker container, when a new version is release, I simply create a new container with the new version.
If there is problem I can stop the container and restart the old one until I figure out what’s wrong.

1 Like

Does this play well with your current version? I have thought of having a separate instance like this but wondered if it would cause issues with two HA instances making requests to the same devices etc.

That’s where i start to get confused. I can imagine running dummy sensors in a dev env / seperate instance, to emulate features in my live environment - lights or booleans or whatever - but to actually test work on the actual hardware, i feel like i have to either duplicate hardware, or risk a booboo when i merge my new code into my live HASS config.

Can two HASS’s talk to the same hardware at the same time without it screwing up feedback / duplex / sync?

Depends on the hardware. Zwave for example can only be paired with a single controller. If your devices were wifi or certain rf it might work. I’ve thought about abstracting out the hardware from the HA stuff multiple times but it’s just easier to keep it all in one system. In my ideal world the hardware would speak mqtt and then I could just use anything I wanted to control it.

I have plans to just setup a dev environments but when I ever I get the free time I end up just spending the time working on another HA project. I’ve brought down my house before, luckily it’s not a huge deal when it goes offline.

absolutely the same here!

Ditto MacBook and a spare Pi

You could also just keep the config files separate so you have a “master” version that contains the working version and a duplicate that you mess with. If something goes wrong in the “branch” you could just revert back to it. Basically, use version control. :slight_smile:

I usually just use a partial configuration, for example I can use all my sensor (MQTT), light (MQTT), the presence detection, media player, as well as camera without causing problem.
The part I live out are 3 MiLight bulb (they are turned off when HA start).

So no, I cannot use the exact same configuration, but I usually use one yaml file per object, so I can develop a new object and integrate it to the main config later on.
I usually do update of HA and restart of HA when nobody’s home (per ssh), so that it doesn’t disturb anyone.

I have wondered about an unburstable HA setup? Whilst the software seems to be reliable, the hardware (Raspberry Pi’s in my case) may not be so reliable. I have some systems using keepalive to provide a live and backup environment but I doubt this would work for HA. Better might be a cluster approach with each system sharing the automation tasks so that if one unit fails, another will still be there, alive and well, to control the home. How that would work with two completely duplicated systems I don’t know. But waiting on fixing a HA server might not be very well received in the depths of winter or on a dark night! Or if the internet link is down!

Both my HA 'Pi’s have local UPS backup which have overcome some local instability issues with the public power supply - weekend switching spikes I suspect.

I have designed my system so that everything works while the internet or HA is down, which I think is very important. Automation should add convenience, not be the only way things work.

1 Like

Same here, you will never avoid a wifi/network/internet problem so every lamp I use also work with regular switch.
Mqtt just receive/send status/command but is not necessary for my appliance to work.
Same with aqara wall switch, they are not disturb if working in standalone.