a UPS isnât cheap but is worth it when the power goes out. I have all my networking gear plugged into mine and its really nice when there is even a tiny blip in the power that I donât have to resync everything.
You wouldnât need a very big one for a Pi and a router/switch/modem. Keep an eye out for holiday deals or amazon prime day deals. I picked up a larger one for about half its normal retail by just watching the prices for a bit.
As @rabittn said, you setup a nut server and monitor it that way with the Pi. Donât pay extra for a âsmartâ network connected one. One with a USB output should be fine.
The wife really enjoyed being able to watch her netflix show during the last power outage.
Yes, but Iâd like to hear about the recommendations of the HA users. Plus, many of these links are sort of special homebrew projects and I was more looking for a reliable solution. Plus, with the Raspberry Pi consuming only 4 Watts, I donât want to have a UPS that consumes 100W for standbyâŠ
I agree that real life recommendations are worth 1000 web adverts!
I think the first thing with UPS is to define what you want. Do you just want something that will keep your pi going for enough time to shut down without file corruption? Or do you want to keep it running to control your home until power comes up (and donât forget whatever it is controlling is probably power dependent too). Also you need to work out what period your power is likely to be out. You could plan for a tree down on the lines - power company will probably fix it within 3 hours. But if you have an earthquake or flood or hurricane, you might be waiting a week, a month, 6 months - been there done that.
Do you just want something that will keep your pi going for enough time to shut down without file corruption?
Power outages are rare where I live. Most often itâs a fuse blowing/or being turned off because of some repair works in the house. So what I would need is the HA RaspberryPi to survive about one hour and if it is longer than that, ideally a safe shutdown trigger.
The problem I had trying to use one of the RPi UPS boards was that they require software to run on the Pi. Not an issue if you are running Raspbian but no good for things like HassIO.
Just use a USB powerbank (the ones used to recharge phones etc) connected to the Pi, then always on charge at the same time. Then you can have an automation to shut down the Pi on power loss if you want. A cheap and non-invasive way of detecting power loss using a plug-in wifi controlled power socket (compatible with HA of course) and leave that âonâ, having the automation trigger based on that device falling off the network. If you have other things like wifi globes that never get turned off at the switch you could use one of those as the trigger.
Thanks Dave, that looks a good idea. So I would just plug in the RPi in the USB powerbank and continually charge that external battery?
A cheap and non-invasive way of detecting power loss using a plug-in wifi controlled power socket (compatible with HA of course) and leave that âonâ, having the automation trigger based on that device falling off the network.
Any helpful link you could share here? So basically, then the wifi connection is down, a shutdown sequence would be initiated?
Thatâs right, just monitor a device (or preferably a group of many, using an âandâ condition) as being available. You can use the ping_sensor for that. If a bunch of devices have dropped from the network there is a good chance that the power is out (or your router has shat itself).
For example, I use Yeelight globes in my house and have then switched on permanently, turning them on and off via HA (using ZigBee switches) only, so they always have power to them and are therefore always online. I could (I donât yet have this set up) have an automation to trigger a Pi shutdown if all the Yeelights were offline at the same time, being a fairly good indication that there is no power⊠Of the router is having a problem. You could mitigate the router issue by having the automation only run the Pi shutdown after a particular duration just short of the powerbank running dead and hope that either a) the power comes back on in time, or b) the router sorts itself out and the devices are seen on the network again.
If you are handy with making up a modified USB cable and some circuitry you could actually splice into the USB cable that charges the powerbank, drop the voltage down to 3.3v and run it into the GPIO of the RPi to provide a charging/not charging signal and use that for your automation
I am using a couple of products together for this. My system is mainly ip cameras which use POE, and PIR sensors running security system on the pi.
I used one of these for the battery backed power âCCTV 12V 8A 9ch Switching Power Supply with Backupâ
Together with âLCD Display DC Buck Step-down Voltage Converter Regulator 5v-23vâ configured for 5.2 volt (allowing for voltage drop with thin power cables - I cut down a thin phone power cable):
This runs the pi3. Then, outside of the scope of the question but I added a âDC 12V to 48V 4A 192W Step-upâ module to get 48v for POE
And connected that in to a POE smart switch. This battery backs the cameras too. Several VLANs and a pfsense router allow me to isolate IoT devices and cameras, and the TV, (all I consider untrusted) and only allow the TV out to the internet for streaming content and firmware updates. My trusted network PCs can connect in to the other vlans to use those devices, but not the other way around.
Of course you could just run a normal mains voltage UPS to the pi but I had a lot of fun building this and I think it doesnt hurt to consider security at the same time if the HA components tie in to your security system.
Usb power bank will keep charing when connected and power during outage.
Would assume you need a smart battery that cuts off charge when full and directs power straight to the ports (avoiding charge > usage > charge > usage 24/7)
The difficulty seems to be that the manufacturers donât advertise what power level the battery can supply, only the storage capacity. Tried a 12000mAh Anker powerbank today, that didnât work. I did also read that some powerbanks donât work with simultaneous charging and releasing. If anyone has identified a good powerbank that works with a Raspberry 3B+⊠make yourself known!
Thinking that I could use the USB ports to supply power to the Raspberry Pi.
Never really got to test it as I moved to an Intel NUC and would think that it is really underpowered for the NUC. I will most likely use it to backup my modem and router.
Also not sure why they are so expensive now, I think I paid like $45 about 6 months back.
But if this release power as it charges, this would be a nice solution.
If you could find one at a reasonable price, you could use the power plugs instead of the USB port . I have no idea what the power consumption is though.