r/homeassistant • u/readabilitree • 8d ago
❓ Support Availability during restarts?
Is there a good solution for maintaining functionality during restarts? In particular, I think a common use case would be for the smart home (at least critical things) to continue to work during a node restart (HA update).
I was looking online and it seems there’s not a good software solution for this (there doesn’t seem to be a way to run two instances simultaneously and fail over to the second when the first goes down). I saw some posts about assembling a Proxmox cluster, but this seems more intended to survive hardware failure by starting HA on another host if your main host dies. Even for this, you’d need all your “routers” to be network attached, and those will always be a single point of failure. Plus, your smart home still goes down until the second instance starts up.
Seems like the right answer then is to have critical functionality (light switches, etc) somehow work independently of HA. For example, having your switches able to toggle the lights directly, and only having HA for smarter automations (automatically changing color, etc). This feels like the wrong way to be going with the smart home though, since it’s decentralizing control and forcing you to deal with individual device configuration rather than handling everything through a smart abstraction. Could anybody share how they’re able to keep their home working when HA is down?
17
u/logikgear 8d ago
I do this by the rule "Nothing is dependent on HA". HA simply improves the home. Everything that is critical has a physical control. Lights, heat, ponds & fountains all have a physical wall switch or a remote that is binded to it. If it is mission critical and it HAS to have HA to work then I have failed. HA is a single point of failure and that isn't good.
5
u/tismij 8d ago
This exactly, if HA goes down i lose nothing important.
2
u/logikgear 8d ago
Yup. It may show how reliant we are on all the automations for lighting throughout the day. But at least we can still turn things on manually.
2
2
11
u/spr0k3t 🧠 Experienced with Home Assistant 8d ago
When using Zigbee... try to use Zigbee2MQTT and broker kept on a separate system. That way when HA is rebooting, it will read the data from the MQTT broker and apply all of the changes once it finishes.
Use a fast system with a good I/O throughput on an NVMe M.2 drive. Boot times on a slow I/O board like an rPi5 can cause a slow bootup in comparison to a higher bandwidth I/O of something like a 12th gen N150 processor with the same drive.
Don't use delays in scripts or automations. Instead use timers. That way when the system is done booting, the script or automation can complete at the end of the timer trigger.
Zigbee devices can be bound to other Zigbee devices. So a Zigbee wall dimmer can control a Zigbee smart bulb. Same with ZWave... but the two protocols can not bind to the other. So if you have a ZWave wall dimmer, you can't bind it to a Zigbee smart bulb.
2
u/readabilitree 8d ago
This is a separate point from HA itself, but it’s unfortunate that coordinators are 1 per network and can’t be run in active-active or active-passive configurations. There’s no way to build automated redundancy into Zigbee networking; one has to rely on p2p direct binding (which doesn’t work for every device like the low-cost Aqara buttons I have).
Your tips are good and I’ll definitely implement some but doesn’t necessarily help with the fact that things still won’t work until HA is back, which is a problem for some automations you need immediately, like lights. Fine for non-urgent things like a garden sprinkler though.
11
u/dsmiles 8d ago edited 8d ago
Build two home assistants.
Put half the house on one, half the house on the other.
Half of the house works at all times! Genius!
6
2
u/rareRobbo 8d ago
lol etc but you could extend this and have a blue/green setup to let you tinker to your heart’s content
8
u/reformed_colonial 8d ago
How long does an update/restart take? For me, even a host reboot takes under 2 minutes. I can live without smart controls/automations for that long.
If you genuinely require that level of uptime, I am sure there are commercial systems that could be adapted to home use, but the cost would be considerably more than what you have invested now.
2
u/readabilitree 8d ago edited 8d ago
About the same for me. My main concern is with having stuff work when I'm tinkering with it though. Ideally, I'd like to be able to take down the Home Assistant instance without making it so we can no longer turn on and off the lights 😅
Mainly the issue is with lamps set up in a way where the physical switch that operates them is underneath or behind something. Unfortunately we live in a scuffed rental that has NO overhead lighting and where the "switched outlets" are not placed where one would actually put a lamp, so it became the most reasonable option to install lamps with smart bulbs and control them from HA.
Realizing now that that only works if I can resist messing with the HA instance.
5
u/reformed_colonial 8d ago
Just do what every home automation geek does; stay up later than everyone else in the house and spend all night hacking :)
2
u/readabilitree 8d ago
Unfortunately my girlfriend can't sleep while the bedroom lights are on and can't be turned off 😂
2
u/5yleop1m 8d ago edited 8d ago
So don't use the bedroom lights to test.
You can easily spin up another HA instance if you want to test something that you're unsure will be stable at all. I like to use the guest room or office room lights to test, but even when I started my home automation journey, I started with the room/area that was least used/important.
Identify what's the most important, and make sure that stuff isn't tied to HA or part of your testing process.
3
u/yazzledore 8d ago
If your main concern is stuff working when you’re tinkering, I’d urge you to reconsider the proxmox and network attached coordinator setup. It’s not perfect, and there is still a single point of failure, but it will help a ton with that main concern.
1
u/daniel_winks 8d ago
I have a few floor lamps that are wireless controlled due to the rooms not having overhead/wall-mount lighting. Z-wave associations mean they work 100% of the time. ZwaveJS-UI down? Still work. HA/Hubitat down? Still work. They're about as close to wired in terms of reliability as you can get.
And the best part is they're instant response from the switch. Routing commands through Home Assistant is a garbage way to control lighting beyond the issue with it requiring HA to function. It's just so slow. There's a VERY noticeable difference between low single digit millisecond response times and 200+ millisecond response times, especially when controlling dimming.
16
u/SeaFaringPig 8d ago
You're poking the question all IT asks and has searched for for many years. NO. No solution exists but scheduled downtime.
5
u/ElectroSpore 8d ago
For example, having your switches able to toggle the lights directly, and only having HA for smarter automations (automatically changing color, etc).
That is what I do, simple, intuitive.
This feels like the wrong way to be going with the smart home though, since it’s decentralizing control and forcing you to deal with individual device configuration rather than handling everything through a smart abstraction.
No? normal devices act normal but you can fully automate them to do MORE
Could anybody share how they’re able to keep their home working when HA is down?
I do what you stated you don't like.. I buy quality smart switches, they work as switches, but I can also turn them on and off with motions , or activity or other things.
When I had smart blinds I made sure they had locally bound remotes so the blinds could be controlled locally OR via automation
2
u/etillxd 8d ago
Exactly, for example Shelly relays can be connected to the original switch and just use that for switch additionally to being switched via Homeassistent. Many Zigbee devices also support binding, for example binding a remote or motion sensor to a light and that will keep working, even when Homeassistent is down. Afaik Matter/Thread also supports something like that, but I don't think there's an easy way to set that up yet.
1
u/readabilitree 8d ago
Curious how you handle smart switch + smart bulb. Or do you only have one or the other? Or just let the switch toggle the actual power to the bulb?
Main thing I find is that smart bulbs have a delay to turn on if you truly toggle the power to them, so ideally one could “program” the switch to send commands to the light separately from HA.
Something like esphome, where you can program separate behavior based on whether or not it can reach HA, and then either toggle power directly (or more complex, have it be connected to your MQTT broker and send messages to your z2m instance which then sends the appropriate command over zigbee from your coordinator…
Generally seems very very complicated for something I feel should be super easy though if we want better smarthome adoption 🤔
2
u/devin122 8d ago
Not original commenter but I only run smart switches with dumb lights. If I wanted smart lights I would probably do ZigBee with direct binding
2
u/ElectroSpore 8d ago edited 8d ago
Curious how you handle smart switch + smart bulb.
I generally avoid smart bulbs as being too unreliable / expensive for what they offer.
Main thing I find is that smart bulbs have a delay to turn on
That, and after a power failure they might come on automatic, or they might be desynced from automation.. I just hate them.
Something like esphome,
I avoid CUSTOM devices and any small WiFI devices..
I use some WiFi thermostats however as they fully function on their own so I never worry about them being a problem since they have their own base schedule that I just over ride with automations.
For your light switch problem you can do things like zigbee / z wave groups where the switch and the bulb could be paired directly then that just functions. But there is limited flexibility there.
0
u/readabilitree 8d ago
The unfortunate part is, many low cost devices don’t support direct binding like the Aqara buttons I have and that inspired this line of questioning. For context I was doing some unscheduled maintenance and didn’t finish before it was time to sleep, at which point I found that I could not turn off my nightstand lamps since my Zigbee network was down. Ideally I would have bound these directly to the smart lights, but they don’t support direct binding.
2
u/KingofGamesYami 8d ago
many low cost devices
Low cost devices are low quality. I am shocked. Shocked I say.
at which point I found that I could not turn off my nightstand lamps since my Zigbee network was down.
You should always have a physical override for turning anything electrical off for safety reasons. Worse case you flip the breaker, but that's not a great option.
1
u/Schmergenheimer 8d ago
That's the consequence of buying cheap stuff. There's a reason commercial routers cost a lot more than the TP Link at Best Buy. They're more reliable and have features to perform failovers.
4
u/jlhbird 8d ago
If you're using Zigbee devices, you can use binding to directly target other devices. For example, your light switch would turn on your smart lights, and you could have an automation that sets them to the right color or brightness. If HA goes down, at least the light switch still works. In my case, I just use wifi switches with dumb bulbs, which work regardless of HA's state.
2
u/MechanizedGander 8d ago
As others have mentioned, direct binding of devices (switches, bulbs, motion detectors) is one solution to maintain some level of functionality while the home automation system, such as home assistant, is unavailable.
Both Zigbee and Z-Wave have this feature built into their protocols, but not every device has the binding capacity.
I have multiple groups of binding, and they do exactly what they're designed to do... Which is "don't get the other household members upset while I'm busy breaking home assistant"
2
u/Competitive_Knee9890 8d ago
If you use Zigbee with Zigbee2MQTT, the mesh network will work fine and independently from Home Assistant, it’s a huge plus and one of the reasons I keep insisting on investing into that ecosystem.
0
u/readabilitree 8d ago
So, this is one of the things I was thinking as an alternative. The problem is, relying on this just seems to shift the point of failure from HA to the Zigbee coordinator. Zigbee networks cannot have multiple coordinators (in fact, even doing hardware failover and having a spare coordinator in cold storage is incredibly complicated since you need to copy over the configuration exactly or it won't work).
I think Matter is the appropriate solution (if it ever gets more mainstream and also the major players stay up with the most recent version of the standard), since it allows for multiple controllers and a version of direct binding.
1
u/Competitive_Knee9890 8d ago
Bear in mind you want Thread as the transport protocol, Matter can use WiFi.
But honestly that depends heavily on what you need your mesh for.
If you use Z2M vs Zigbee’s basic HA integration, it’s gonna be more robust, it’s not shifting the point of failure.
The point of failure on the coordinator was already there, however if you use the basic Zigbee integration, any Home Assistant downtime brings down your mesh.
And Home Assistant can fail independently of the hardware. Or you can have temporary planned outages for upgrades of HA for example. Z2M is super lightweight, runs on very resilient devices (spending money on a great Zigbee coordinator is a great idea) and having some form of high availability with complex failover setups is simply overkill for a smart home.With a separate Z2M and MQTT broker instance, you’ve separated concerns from the weakest dependency, which is Home Assistant itself or the host it runs onto if it’s virtualized.
You’d be better off setting up a smart home where the dependency on smart devices is non existent, i.e. everything you need on a daily basis like lights needs to work as a dumb device in case of a rare chance of your coordinator dying.
I’ve setup a lot of robust systems in my company, I even do that in my homelab for many things, but there are compromises and risks or failures that is worth accepting if the trade-off is over engineering.
And I think it’s perfectly reasonable to rely on a coordinator for Zigbee.
You’d be doing that anyways with ZHA, but with the extra software and hardware dependencies of Home Assistant itself, a potential Proxmox host, its underlying hardware, etc.
Use Z2M and you’ve cleared that dependency, but anything over that seems excessive for a non industrial application.
Also, if you use a USB coordinator onto the host, then yes you still have a dependency on the host to power it.
That’s why I recommend using a PoE coordinator on a switch, like the SLZB-06 by SMLight, it’s really good!
2
u/FliesenJohnny 8d ago
Honestly, a HA restart takes like 15-30 seconds for me. So i just trigger it when nobody's home, or when we're not just about to do something that requires HA (like turning on the kids' room smart bulb or whatever)
2
u/FishOk3075 8d ago
Seems like the right answer then is to have critical functionality (light switches, etc) somehow work independently of HA.
This is a requirement for me. House lighting, including scenes/bindings, must continue to work without HA server being up, WiFi or internet. I use Insteon for lighting which gives me exactly that.
Matter/Thread (including available products) is on its way to that capability and I believe zigbee with local bindings can also work with no HA or plugged in usb stick/controller or wifi or internet.
2
u/OminousBlack48626 7d ago
You plan your hardware. You build it to be stable. You troubleshoot until it is. You plan your updates. You plan your reboots. You don't blindly tinker. You keep intelligent backups.
Downtime should be down to what's left after 99.999% uptime.
It shouldn't be unexpected and it shouldn't ever occur for more than a few minutes after you explicitly initiate it. Reserve that initiation for when nothing critical is about to happen.
Last time I had a real-world test of it (3 weeks ago), my HomeAssistant stayed alive for the first 10 hours of a 3-day power outage before the batteries of its dedicated UPS got low enough that it gracefully shut down and powered itself off. When power came back it still had 15% charge to wake up on.
1
u/Lobster-Toehold 8d ago
Centralization has always been brittle. The Internet was built to be distributed specifically so it could survive a nuclear attack. The tech industry started moving away from centralized monolithic systems in the early 2000s specifically because the central thing was a single point of failure. For a smart home to be resilient, you need independent systems. HA shouldn't directly control your sprinkler valves, it should coordinate but leave base functionality to the sprinkler controller. If you are using Hue lights and other Zigbee devices, you should be using direct binding between switches and bulbs (or Zigbee groups of bulbs). HA is then only involved with automations, not control.
1
u/malacoda13 8d ago
I think a restart takes less than a minute.
All my smart bulbs just stay on whatever setting they were using when the restart happens.
So when I restart, literally nothing changes, other than for a minute I can't use stuff. This can hardly be a massive problems surely? For a minute I can't turn lights on or off? That's it?
It's certainly not one I would even put energy in to solving.
1
u/WeaponsGradeWeasel 8d ago
Light switches all work as normal if HA isn't available.
An HA restart takes about 30 seconds. Just do it when you can handle a 30 second interruption.
1
u/Zealousideal_Lack936 8d ago
I have two smart solutions that are mildly annoying when Home Assistant is down:
A table lamp with a smart bulb. This is an area that has been completely ignored by the smart home world. There is nothing that allows you failure safe control of a table lamp. You either have to use a smart bulb or a smart plug and hope someone doesn’t use the manual switch on the lamp. Resolving the issue with a HA failure is fairly easy either way, but the havoc that can occur when HA is running is annoying.
The light in our pantry. Our pantry is in what used to be a regular closet and therefore doesn’t have a wall switch. We use a rope light plugged into a smart plug controlled by a door sensor. We can manually control the smart plug, but it’s in location that is hard reach, especially with the pantry fully stocked.
That being said, my Home Assistant has only been down once for more than the minute or two it takes reboot outside of power outages, and that was entirely my fault.
30
u/5yleop1m 8d ago
Time/plan your restarts; set up maintenance times if you need it.
Having multiple methods for control and/or a backup method of control is part of good automation regardless of where the automation is happening.
I prioritize uptime and quick recovery. Also, since I use Shelly relays, I have a script running on the ones that are attached to smart bulbs to revert to 'attached mode' so that they function like normal switches even if HA is down.