21 Minutes of Outage a Year: Why My Home Assistant Box Still Needs a Battery

A high-voltage transmission tower on a misty forested hillside under grey cloud

Switzerland’s electricity regulator publishes a number every year that quietly undermines half the reasons people give for buying a UPS. In 2024 the average end consumer here experienced 21 minutes of interruption in total — 11 minutes of it planned, 10 minutes unplanned — across an average of 0.34 outages. Ten unplanned minutes. For the whole year. Spread across everyone.

So when I put a battery behind the HP EliteDesk 800 G4 that runs my Home Assistant OS install, I had to be honest about what I was buying. Not insurance against the grid — the grid is fine. Insurance against a much dumber category of failure. Framing it that way made the sizing questions easier and the shopping questions harder.

The grid is not what takes my house down

Every power loss my automation stack has actually suffered originated inside the building envelope. An RCD tripping because a cheap appliance decided to leak to earth. An electrician flipping the wrong breaker, because the labelling in this building was done by an optimist. Me, moving a freezer and discovering that the socket I unplugged shared a spur with the cupboard the server lives in.

None of those show up in a SAIDI figure. They are house events, not grid events, and they are far more frequent than ten minutes a year. Where supply is genuinely shaky, the case for a UPS writes itself. Here, the case is subtler, and it is entirely about what an ungraceful shutdown does to software that was mid-write.

What you are protecting is a SQLite file

Home Assistant’s recorder writes constantly. Every state change lands in home-assistant_v2.db, and with a few dozen Zigbee devices and some power meters that is a steady trickle all day. A mini PC with an NVMe drive shrugs at the wear — one of the reasons I moved off a Pi and an SD card. What it does not shrug at is losing power mid-write.

Modern SQLite in WAL mode is resilient and most hard cuts cost you nothing. “Most” is the operative word. The failure mode is not a dramatic explosion; it is a database that comes back slightly wrong and a history graph with a hole in it you notice three weeks later. Add a Zigbee coordinator yanked mid-firmware-operation, or an add-on’s config rewritten at exactly the wrong instant, and the argument becomes simple: I would like the machine to be told about the outage and shut itself down, rather than being executed.

That is the whole feature. Not “keep running through a blackout.” Just: find out, and land the plane.

Lightning arcing over a dark city skyline at night
The dramatic version of power loss is rare. The boring version — a tripped RCD in your own cupboard — is the one that actually gets you. Photo: Pexels

Sizing is the easy part, and it is where everyone overspends

The EliteDesk 800 G4 Mini idles around 10 to 13 watts depending on configuration — HP’s Energy Star figures land just above 13 W, reviewers measure a little lower. Mine sits at roughly 12 W with a Zigbee stick and an NVMe drive, and does not meaningfully move under Home Assistant’s workload.

Twelve watts is a rounding error to any UPS on the market. The smallest sensible line-interactive units start around 650 VA — roughly 360–400 W of real power — so the box loads one to about three percent. The temptation is then to buy either the cheapest thing on the shelf or something enormous because the runtime charts look impressive. Both are wrong. Cheap units frequently have no data connection worth using, and a UPS your automation system cannot query is just a slightly better power strip. Enormous units are wrong because runtime at three percent load is not something manufacturers characterise honestly — published curves usually start at 50 percent — and because sealed lead-acid packs in this class want replacing every three to five years regardless of how gently you treat them. Twice the capacity mostly buys twice the eventual replacement cost.

The box is not the only thing that needs to stay up

This is the part I got wrong on the first pass. I plugged in the server, felt clever, then realised that during an outage I would have a perfectly healthy Home Assistant instance that could not reach anything and that I could not reach either.

The Zigbee mesh illustrates the problem. My coordinator is a USB stick on the server, so it survives — but every mains-powered Zigbee device in the house is a router, and all of them die with the power. What is left is a coordinator talking to whichever battery sensors are close enough to reach it directly. Door contacts keep reporting; anything routed through a smart plug does not. Fine, as long as you know it — and a good reason not to build outage-critical automations on top of mains-powered relays.

More importantly: the router, the switch, and the fibre ONT. Without those, the mobile app cannot reach the box, the notification you carefully configured to warn you about the outage cannot leave the house, and remote access is gone. Together they are another 15–25 W in my case. That is what pushed me from “any small UPS” to “one with enough outlets and enough runtime to cover the whole networking shelf for long enough to matter.”

Sine waves, transfer times, and when the spec sheet earns its keep

Line-interactive units — the ordinary consumer kind — pass mains through directly and switch to the inverter in a few milliseconds when the supply drifts out of range. That transfer time is a non-issue for computer power supplies, which hold up easily across it. Online double-conversion units remove the transfer entirely at the cost of price, noise, and standby draw. For a home server cupboard, line-interactive is the right answer. The waveform question is the one worth reading carefully. Many line-interactive units output an approximated or stepped sine wave on battery rather than a true one — Eaton’s Ellipse PRO range, for instance, is line-interactive with an approximated sine output, and you have to move up to something like the 5SC to get pure sine. Power supplies with active PFC can behave badly on a stepped waveform: coil whine, extra heat, and in bad cases a reset at the moment of transfer — precisely the moment you needed it not to reset.

Here I have to be honest rather than dogmatic. The EliteDesk Mini runs on an external 65 W laptop-style brick, not a desktop ATX supply with active PFC, and small bricks are generally far less fussy about waveform — same for the router and the ONT. So for my specific load, the stepped-sine objection is weak. It stops being weak the moment a NAS or a desktop joins the same UPS, and most cupboards grow in exactly that direction. If there is any chance yours will, pay for pure sine now.

Making Home Assistant actually see it

A UPS your system cannot query is worth very little, and this is where the local-first setup pays off. Home Assistant’s Network UPS Tools integration is a Platinum-quality, local-polling integration used by about 4.1 percent of installs. It exposes battery charge, load, estimated runtime, input and output voltage, and a human-readable status sensor, polling every 60 seconds by default.

The detail the docs state plainly and people still miss: the integration cannot talk to a UPS directly. It is a NUT client. Something has to run the NUT server that owns the USB connection — a NAS, a separate small machine, or the Home Assistant host itself via the community NUT add-on. Running HA OS bare metal with the UPS plugged into that same box, the add-on keeps everything in one place. Point the integration at localhost:3493 and the sensors appear.

The automation in the official docs is the right starting point — trigger on the status sensor moving to On Battery, Battery Discharging, send a notification. Then extend it: wait for battery charge or estimated runtime to cross a threshold before shutting anything down. React instantly to every brownout and you will shut down cleanly for a two-second flicker, which is worse than not reacting at all.

Two documented limitations shape the rest: the integration reads NUT variables but cannot set them, and it does not support commands that take parameters. Anything more elaborate belongs in NUT’s own configuration.

The chicken-and-egg nobody warns you about

If Home Assistant shuts itself down gracefully and the UPS keeps happily supplying an empty socket, then mains returns two minutes later, you have a house that is dark in a different way: the automation server is off and will stay off until someone walks over and presses a button. That is a worse outcome than the corruption you were avoiding.

Solving it properly means the UPS cuts its own output once the shutdown completes and restores it when mains returns, with the machine’s BIOS set to power on when AC is applied — on the EliteDesk, an “After Power Loss: Power On” firmware setting worth checking before you need it. The UPS half varies by manufacturer, and NUT’s shutdown handling is well documented but genuinely fiddly. Budget an evening for it, not twenty minutes.

What I would tell someone starting this

Buy for the network shelf, not the server. The server is a 12-watt afterthought; the router and ONT decide whether you ever find out there was a problem. Check the NUT hardware compatibility list before you buy, because a supported data connection is the entire difference between a UPS and a heavy power strip. Prefer pure sine if a NAS or desktop might join the cupboard later. And size for a graceful shutdown plus margin for flickers, not for riding out a blackout — riding it out is a different and much more expensive project.

And accept that in a country with ten unplanned minutes of outage a year, this will look like a waste of money for a long time. It is the same bet as a backup routine: the value is entirely in the one evening it saves you, and you will not know which evening that is until it arrives.

Leave a Reply

Your email address will not be published. Required fields are marked *