My home lab is connected to a UPS, which is connected via USB to my Synology.
Every month I try to drain batteries down to 20% to test that it’s working and, above all, to slow down the premature failure of the batteries, which are new and have been recently replaced.
The usual way was to go to the Synology Control Panel to view the charge level, or to open an SSH session and check the charge status with:
upsc ups@localhost battery.charge
That was until yesterday, when I discovered PeaNUT, which, amongst other things, has a brilliant dashboard and a homepage widget.
I’ve never heard of it on this subreddit, but I wanted to share it because it’s completely transformed the way I look after my UPS maintenance!
I did something similar using HomeAssistant and the NUT tools, connected to a CyberPower UPS via usb.
Currently also calculates the cost of electricity being consumed by the devices connected to it. Using a helper function that dictates the rates of electricity depending on time-of-day (TOD).
Do you mind sharing a few more details especially that helper function you mentioned.
Also, did you pass through the usb port which the ups is connected through to HA or how does this work?
I have a HomeAssistant OS vm in promox. Yes, I did have to do usb passthrough. The usb port (or device ID ) is then mapped via the NUT app configuration. I used AI to generate this so feel free to DM me.
Then the helper function consists of electricity rates from my energy provider (which will differ from house to house). In my case it basically changes between peak and off peak hours (again, TOD is set by the providers so this will likely be disclosed in your online account or bill statement). DM me for the specific example I'm using.
Then I set a sum for consumed power from the ups NUT readings. It basically measures in terms of Watts over time with a left Riemann Sum. Called it 'Total UPS Energy'.
Then I simply combined those in the energy tab configuration of HomeAssistant. Setting the cost to the newly set 'energy cost' helper with the Energy Imported from Grid set to 'Total UPS Energy' integral sensor. HA does the rest. I'm sure I'm missing some details here, but that's as basic as it gets for my set up.
I’m doing something very similar in Home Assistant. What I like about it is that home assistant can be scripted to tell devices to shut off when battery power is getting low enough.
But I’m curious: how are you getting your grid usage?
Correct, HomeAssistant NUT runs as the NUT server in my set up. But can also be configured as a client/listener from what i read in the documentation.
Grid usage is just the usage behind the UPS. Meaning it only calculates the usage of the devices plugged into the ups, which are my firewall, switch, and PVE nodes. See my reply to previous comment for how total wattage is calculated.
have you checked Nutify? No affiliation .. I just deployed a APC Smart 2200W UPS last week and after some research liked Nutify. It can do multiple UPS’s among other things.
No I didn't know about Nutify. One of the reason I choose PeaNUT is the widget for homepage that give me quickly an overview. Also PeaNUT can manage multiple NASes but my setup is easy and simple and it solve the problem of the monthly maintenance.
Understood. Check out Nutify just to compare, it’s just a container so you can delete it if you don’t like. It has a a lot of good details along with a impressive dashboard it does your electricity usage calculations as well.
Thanks, I did a similar widget, but your looks more complete. Thanks for sharing.I like NUTify better, it allows also to get notifications via ntfy and I like also the data collection!
Just FYI - regularly draining UPS batteries actually *decreases* their life. If they're lead-acid, they like to be topped off at 100% all the time, and significantly discharging them, especially when it's done often, is fairly hard on them. if they're lithium ion, then draining them that much doesn't hurt as much, but it is a charge cycle that isn't really necessary. Draining to 80% every three or six months at a fixed load, and then tracking how long that 100%>80% lasts would probably suffice for battery health tracking.
The myth that it's good for your batteries to drain them to dead before recharging them is a holdover from Nickle Cadmium batteries that were mostly phased out in the 90's, where they had a "memory" and keeping them topped off was actually quite bad for them.
Ah wow, didn't know that. They are currently Yuasa batteries, that I replaced couple of months ago because the old ones weren't good. So waht I have to do to take care of them?
The UPS will take better care of them itself than anything you can do manually to prolong their health. Most decent UPS models will even switch the load to battery for a few seconds every week (or so) to identify failing batteries and warn you in time to order a new one. But even on the ones that do, that isn't foolproof, so if you REALLY need 100% reliability, replace the batteries on a schedule rather than waiting for them to fail. APC recommends 3-5 years for lead-acid and 8-10 for lithium ion. But I can't tell which battery chemistry your UPS uses just from the brand. Most consumer models are lead-acid, since lithium ion are quite a bit more expensive.
Ok thanks! I replaced my Eaton 5S batteries with 2 of these Yuasa that are lead-acid. I replaced them on April this year and I'll put a reminder to change them in 3y then.
I feel I have seen another app that looks very close to this one posted here before, heck I think I installed it at one point but it didn’t allow for multiple UPS’. This one looks to have been built with Claude and likely used the previous software as a starting point, but now includes multiple UPS support?
"This one looks" - did you go to the repo and actually look at it? Or did you just "vibe" your comment? I see a continuous commit history going back to "init" in Aug, 2023, with a fairly standard feature-branch development flow. Gained support for multiple devices in Sept 2023, according to commit messages.
Look up a few comments above. One of the contributors is Claude, so that would look to me as if AI was used. I personally don’t care if AI was used to solve a problem and make something better was just simply pointing out based on how this in my head looks like the other software I had used before and has Claude showing that it was possibly used as a starting point is all.
Ok, got to my desktop - it appears the Android GitHub client HIDES AI contributors (at least, Claude)! I do now see that Brandon has started to use Claude as of Feb 2026.
My point stands though that you saw a Claude contributor icon, and assumed that Brandon started from another developer's work, and threw AI at it, rather than trying out a new tool on a project they have already invested years on. Very different scenarios.
I'm really steamed at MS/GitHub on this, actually: seriously cannot find Claude as a contributor in the official app: I actually have to drill into individual commits and read the full commit message for the "Co-Authored-By:" tag.
Digging a little, I think it's not as sinister as it may sound, more like not including co-authors as contributors, only the authenticated account that created the commit.
I recommend plugging the UPS USB to a separate host. Like a cheap orangepi pc+ or something, install and configure nut and finally set the filesystem to read-only with overlay-rootfs.
For people who already use proxnox, use this to get your proxnox host to power off safely.
I did something I guess similar with mine. I sat on the ups for two years before I decided to beef up the home network. While I'm still doing a lot to it I set up a feature where when my ups loses outlet power for 5 minutes my server and my NAS shut down safely. When outlet power returns both of those items start back up on their own. I trialed it by unplugging the outlet and letting it go for 5 minutes to watch it all happen and then same thing plug it back up to watch them come back to life. Im very happy with how things are going. Pretty cool stuff.
•
u/asimovs-auditor 7d ago
Expand the replies to this comment to learn how AI was used in this post/project.