Colourful Norwich skyline illustration

Michael Sage

IT, Digital & Culture

I must be nuts…

The Internet - IT Crowd

Safe shutdowns... and startups

I have not idea how stable the power is at the static, but most of the time we will be turning it off when we leave (it might be on for most of the summer when we leave the fridge on). There might also be times we want to preheat the van in the colder months. 

I was working on another project to deliver “internet-in-a-box” for outside broadcasting. This lead me to the open source project NUT, a project designed for controlling UPS units, especially ones whose software sucks (or doesn’t exist for your operating system)

Basic UPS VI 650

Following on from the work I did for the project I decided I could run the van off a UPS which was controlled by the primary Pi and that the home assistant Pi would shutdown should the UPS battery get too low.

 It would also mean that should someone else use the static they would just be able to turn off the power and nut would take care of the safe shutting down of the devices.

UPS Back
Screenshot of NUT UPS Graphs

I selected a cheap UPS (PowerWalker) that seemed to have reasonable compatibility with NUT and set about configuring it.

The basic NUT configuration was easy. I  setup the netmaster and the CGI site really quickly. Getting the NUT client to work on Home Assistant was easy too, I then setup an automation to shutdown the pi. 

Notifications however were another level of hard, there isn’t that much information out there and it looks like at some point in the past NUT changed formatting in the configs. However, with a bit of work it all came together.

As you can see from the image above I am hardly using any power, the UPS will keep the static active for about an hour after it loses power, while this is great, the main benefit is I don’t need to leave instructions for people to turn the internet or the Pi’s off when they leave!

Why, oh pi!

Originally I was going to setup a Pi Zero just to manage the UPS, this was the original spec for the “internet-in-a-box”. I had found a PoE Injector with Ethernet on a single Micro USB (Uctronics PoE), I was excited by this discovery, as it would mean I could power and add wired ethernet to the Pi Zero… I am still waiting for the devices, but a fatal flaw has stopped this working. The Pi Zero only has one USB port… The PWR port only carries power. So although I could power and network the Pi, I had nowhere to plug in the UPS. I will do some more digging at some point as £4.80 for a UPS controller would be amazing!

Pi Zero PoE
Pi Zero v1.3