I have HA on a Rpi4 (8gb ram + 250gb SSD) at a client location and very recently HA stopped running. This happened thrice over the course of a week. Each time I had to manually reconnect the power supply. I’m not sure why this is happening. The last time this happened (ie. yesterday), I noticed through logs that the database crashed. Error in logs said something like database malformed, and then a couple hours later, all of the add-ons stopped running ie. MQTT, SSH Terminal, etc. Everything was running fine (I installed it 4 months ago) up until last week. I have like 3 wifi based presence sensors - they sort of spam the network with 3-4 readings every second - 9 lorawan sensors that update every 2-3 mins. and 3 six-channel relays that turn on/off once every few hours on an average. I was hoping the 8gb Rpi would easily handle all this but clearly something’s up.
My first thought is the SSD is corrupt. But now I’m starting to think maybe it’s the power supply that’s causing all of the this. The location is pretty commercial/industrial. They have outages once/twice every month and also I suspect voltage surges do occur occasionally - not sure though since HA was running super smooth all this time. I also don’t like how Rpi4 has its own specialized power supply adapter. It’s almost like their manufacturers are telling us “any variation in voltage and you’re f*cked”. I’m afraid to even use any UPS with this.
So with all this in mind, I’m thinking I’ll just switch to a NUC/mini PC. Does anyone have any suggestions? At least 8gb RAM with 200gb ssd space. We’ll be installing many more sensors (around 50 in total) so I want to make sure any hardware HA runs on is super resilient - to power surges and outages especially. Does anyone have any suggestions?
Not the nuc (or pi or - insert machine name here)'s job.
That is the job of a well designed good quality surge suppression device and protecting your HA rig. Probably a UPS as well. Don’t put that job on your NUC
And highly recommend any x64 minipc over a pi these days you almost can’t miss with what’s generally available. SSD are dirt cheap. Buy two and keep one as your backup.
Built in battery means it’s got a built-in Ups, which might handle brown outs better. Just remember to set charging mode in bios to “always powered” or similar to avoid keeping the battery charged constantly at 100%. Dells have this option, but not sure about other manufacturers.
Set the bios to automatically power on when power is restored - this will automatically turn it back on if the battery drains.
Finally, set an automation to gracefully shut down HA once the battery goes below a certain level. I remember this was a bit tricky since system monitor integration doesn’t show battery status.
I had to mess around with cron & a pubsub client to pass this info to HA. You might have an easier time with glances or a power monitoring plug in a pinch.
My assumption was miniPCs handle surges better than Rpis. In fact I think literally any legit, branded low voltage device handles surges better than Rpi does.
They have so many wifi APs, desktops, laptops, etc. and only my Rpi ate sh*t. Anyways, I appreciate the advice.
Thanks, this makes a lot of sense. Do know any that’s sleek and compact (and doesn’t look like any regular laptop prefrebly)? I just don’t want people looking at it and going “eh, who’s laptop is that” and then bringing the thing to lost and found. Of course I can inform the staff there to not to have anyone touch it but aesthetically it won’t look too pleasing
Shadow man I rarely disagree but I’ve had way too many shoddy old laptops die for no good reason. You’ll never convince me a laptop is a better choice than a minipc +ups. But that’s why we’re all here choice is good.
Well, the simple answer to that is not to get a shoddy old laptop, just like you wouldn’t get a shoddy old nuc.
When I chose mine, it was a refurbished G-series dell gaming laptop. Way overkill for what I need, but the price was extremely reasonable for a model which had been launched a couple of years earlier.
My point is I can get any minipc prob with a 12gen and decent ram for less than a two year old refurb. That’s been pretty true since covid.
So two year old refurbish (yes don’t buy crap so I have to roll back to 2023 to get a good price) or new with nice ram and two SSD (I always buybtwo of my main storage on a new rig for backup swap) and a cheap ups… Yeah no. Dude I’m not gettin a Dell… For this.
From my recent experience, there is a lot of advancement going on in the minipc space right now. Which is great but makes for a lot of comparing time. Four variables in choosing a device you might want to weight :
Power consumption at idle and work levels.
USB 4, Thunderbolt 3/4 for external GPU support in future for local voice/AI.
Number of NVMe slots and design of their PCI interface (aka speed), NVMe cooling design.
CPU/Memory for Docker, VM and AI workloads. You are pretty much locked into CPU at purchase, however RAM configuration and upgrades are very possible or not in different of these devices. And RAM is a very low cost 'future proofing.
There is a lot of debate/navel gazing over internal power supples vs. external brick supplies. I’m not sure I’ve seen enough definitive data to select one over the other. To your possible input power instability, if you have a little electronics skills, you can consider an external ‘brick’ mini pc and build a pretty robust custom UPS/Continuous/Monitorable power input using the vast selection Lithium type/Lead Acid storage and BMS device.
If you are really having problems, another relative low cost addition level of ‘shock absorber’ is adding a device such as this :
Thats a VERY good point Dave if you’re not springing for a GPU for local inference a TB4 or better interface means eGPU/NPU is possible. I’d almost filter out any that don’t support it at this point. It makes the box WAY more expansive.
Thank you for the suggestions. I’m not so much an electronics enthusiast/expert to be able to pull that kind of stunt with batteries. I have no doubt UPS is a must here.
There’s no real “mission critical” equipment barring HA hardware and so I don’t think they’d want to invest in some heavy duty UPS system. It’s just the Rpi that’s been giving us issues due to outages, not any routers, sensors, cctvs, etc. And I probably should have mentioned before, these outages last for no more than a min. or two. So I’m 100% certain I wouldn’t be powering anything on batteries for over 5 mins.
I’m looking at something basic and compact that can output 12V 3A, like this. It says surge protection too so I’m drawn to that. I’m just not sure if a mini pc such as this, running on 100% load, will draw power more than 3A, even momentarily. Also, I’m not sure if a mini PC would throttle when it hits a peak current draw (like the Rpi does when it hits a peak temperature value). My “full load” here would include turning on/off up to 40-50 relay switches, using 50-60 motion detection sensors (20% WiFi based that sort of spam values and the rest 80% LoraWAN based) - no fancy face or voice recognition sh*t using cctv footage.
Your ‘gut’ to stay on the KISS type systems is the right way for long term operation, low acid reflux, minimizing alcohol consumption and maximizing ‘significant other’ happiness . Verses my ‘on the spectrum’ solutions which have resulted in a number of ‘bottom drawers’ full of failures….
The 12/9/other DC volt battery/power brick is a good idea, and I should have stated is kind of the ‘entry point’ to my blab about a ‘custom’ UPS solution. There are number of these devices at low cost that are nice. Make sure the device you select can handle various input power failures and not ‘hiccup’ the output power. Buy from Amazon with their easy return ability . Get a simple A/C power switch, put it on the input and toggle the crap out of it to see how it behaves in various ‘edge’ cases. I would check the batteries in the selected device and find one where you a can replace them, they will fail a some point and a low coin cost battery replacement is a longer term happy place when you find a overall system that is working for you. Learn the different types of 18650 Li-ion batteries (most likely type of battery in these units) : capacity, cycles, protected vs unprotected.
On the minipc front, from my experience with Rpi and too many of the minipcs, getting a motherboard that has good support for the various system temperature monitoring is very important. CPU cores, NVMe temps, SSD Smart and NVMe Smart are the subsystems I have found most useful to be able to monitor.
Take a little deep dive on Youtube on minipc/NVMe temperature ‘fun’/issues. The video by Jeff Geerling below is a good watch. I tried this minipc he cites (and returned it to Amazon after my testing and before I a saw his video).
It’s not only these ‘packed with NVMe stick’ devices that can flake out and leave you head scratching. One of my earlier tries on a device similar to the one you cite (I have no experience with the one you cite, so I am NOT bad mouthing it), where the NVMe drive would get to a temperature and just drop off the buss (not good Dave). And at time I did not have a good handle on how to monitor NVMe temperature and errors.
Another opine by me. I started down the minipc blackhole with using Proxmox as my host OS. An amazing ‘master’ system, however way over kill. I have moved to UnRAID and other than the fact that it requires some coin to purchase (worth it IMHO, the team behind it is really sharp and committed) gives you a great monitoring of the above cited motherboard subsystems (again as long as you have a supported motherboard). I’m down this rant, because I do think for long term success UNRaid (or similar ‘hypervisor’ OS) is a better route (and worth the effort) vs. running Home Assistant’s hypervisor install directly on bare metal. This if you have the need for most any CCTV or other slightly more complex/streaming to/from disk integrations. The ability to spin up vast universe of docker containers in isolation from you Home Assistant instance is really worth the effort to learn Docker. And with sufficient RAM you get the ability to run VM’s as well. And while I do not have much direct experience with Home Assistant OS, I do not think you as yet can do the type of motherboard subsystem monitoring that you can with a hypervisor like UNRaid and running Home Assistant in a container within.