I run my MQTT on a separate R.Pi, but only because it was there (along with my original Python script based automations) before I started playing with HAā¦ Was planning on migrating it onto the HA Pi so Iād have one spare for experimenting onā¦ Until the 4ās came out, and I got one of those, of course.
So get twoā¦ or threeā¦ or fiveā¦ Then, you have your main system, and your development system. You do your experimenting on the development system (could also set it up as a satellite system, I believe), and if you mess it up, just restore it from the main one. Then when youāve got it how you like, go the other way, replacing the main one from the development one. rsync works well there. I Git my main config, but that doesnāt work so well for passwords and stuff, if you ever might possibly plan to make it public (or if Microsoft one day decides you want to make it public)ā¦
You reboot your HA? Why? What image are you running? Restart the HA image every so often, sureā¦ Takes it offline for a minute or two, which is a pain, so do it while people are out, or asleep, and wonāt get annoyed at you (unless all the lights turn themselves on, or something, in which case wait till people are out).
But my HA Piās current uptime (actually, both of them, since it was a blackout that last caused them to be restarted) is 263.5 days. I run Hass.io, and the HA itself gets restarted anywhere between when I feel like the latest updates are worth trying out, and several times an hour while Iām tinkering, but the other containers keep on running, so MQTT should too. Linux isnāt Windows. When I used to run Linux as my sole system, I was less than a month short of a full year uptime a couple times, and thatās with everything updated regularly except the kernel (which Iād upgrade, often several times, before the next restart ā usually by blackout). Seriously, Linux isnāt Windows.
But even then, a HA restart takes all of a minute or two. And if you have split main/dev systems (I believe with Docker ā what Hass.io uses ā it should actually be possible to run them both on the SAME system, though it could get tricky and/or confusing), then thatās a minute or two downtime only when you feel confident with your new setup to apply it to the main system. And a duel system like that, you can even do things like bridge the two MQTT servers only one way (so dev gets updated from changes in the house, but the lights donāt go crazy if you screw up your automation), and then you can selectively bridge back the other way, too, so, like, only the lights in that one room are actually being controlled by the dev system. You can do all those things.
But, if youāre comfortable putting the logic on the nodes, then thatās just as good. Teach the relay driver board to toggle individual relays, and have the switches send toggle messages, and youāre all sweet. As I said before, I did that, but I donāt use it, itās just there in case I feel like it at some point. Iād probably use the MQTT as the data store, though, because otherwise youāll be wanting to fiddle with the controllers EEPROM and all that, and then thereās the question of what state should they come up in after a blackout. Some devices you might want to default ON, or OFF, others you might want to remember their previous state. Easiest way to do that, is with the MQTT retain flag. Retain will make it resume itās previous state, where not using retain on individual messages lets you retain the initial state you want them to be in ā just have to be consistent with a given device. That too, is easy to do if your switch messages come into HA, and get sent back out to your relays on a different topic, then the HA logic that binds them can decide whether to retain or not.
But definitely get a second HA instance for experimentation, either way.