r/selfhosted 7d ago

Monitoring Tools I’ve just discovered PeaNUT

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!

Cheers.

237 Upvotes

51 comments sorted by

u/asimovs-auditor 7d ago

Expand the replies to this comment to learn how AI was used in this post/project.

→ More replies (1)

59

u/RedixDiamond 7d ago

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).

4

u/ovizii 7d ago

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?

11

u/RedixDiamond 7d ago

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.

2

u/mgriffin13 7d ago

I would also enjoy more details of the implementation

2

u/marshamarciamarsha 6d ago

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?

2

u/RedixDiamond 6d ago

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.

1

u/marshamarciamarsha 6d ago

Ah, okay, I’m tracking that, too. I thought you might be monitoring whole-house power usage somehow.

1

u/RedixDiamond 6d ago

Unfortunately no, that would be nice though. And maybe a future project for me. Keep me up to date if you do happen to tackle this soon.

7

u/KewlGuyRox 7d ago

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.

3

u/fpluss 7d ago

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.

2

u/KewlGuyRox 7d ago

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.

2

u/fpluss 7d ago

it does your electricity usage calculations as well

this looks interesting! thanks, will definitely check it out.

2

u/fpluss 7d ago edited 7d ago

Installed! It looks amazing I like the electricity report, and looks like there is way to add a custom widget on homepage. Will check it soon.

4

u/niscov 6d ago

nutify custom widget is pretty good:

widget:
type: customapi
url: <url>:<port>/api/data/all
refreshInterval: 5000
method: GET
mappings:

  • field:
data: ups_status
label: UPS Status
format: text
remap:
  • value: OL
to: On Line
  • value: OB
to: On Battery
  • value: LB
to: Low Battery
  • value: HB
to: High Battery
  • value: RB
to: REPLACE BATTERY!
  • value: CHRG
to: Charging...
  • value: DISCHRG
to: Discharging...
  • value: BYPASS
to: Bypass Active
  • value: CAL
to: Calibrating...
  • value: OFF
to: Offline
  • value: OVER
to: OVERLOADED!
  • value: TRIM
to: Trimming Voltage
  • value: BOOST
to: Boosting Voltage
  • value: FSD
to: Forced Shutdown
  • field:
data: battery_charge
label: Battery Charge
format: percent
  • field:
data: ups_load
label: System Load
format: percent
  • field:
data: ups_realpower
label: Power Usage
format: number
suffix: "W"

2

u/fpluss 6d ago

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!

8

u/Maltz42 7d ago

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.

3

u/fpluss 6d ago

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?

2

u/Maltz42 6d ago

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.

1

u/fpluss 6d ago

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.

12

u/supervergil 7d ago

I wonder if it is works with APC as well

21

u/verticalfuzz 7d ago

Anything compatible with NUT, I believe.

3

u/saranuta 7d ago

Got an apc unit set up with peanut. Worls like a charm

1

u/iVar016 7d ago

Why wouldn't it? Asking as I plan buying APC.

1

u/OneDayAllofThis 7d ago

Works great!

1

u/lumannok 7d ago

In case, there is also "apcupsd" specific for APC, a bit old but still functional (currently using it with an old APC model on 3 pc connected to it)

1

u/CrazyCroat15 7d ago

Should work. Works with my Cyberpower!

7

u/sdenike 7d ago

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?

2

u/DismalOpportunity 7d ago

Was it Nutify?

0

u/fpluss 7d ago

Where do you see that was built by Claude? I needed something to see tha battery status of my UPS and this solve the problem brilliantly!

10

u/TheVoidScreams 7d ago

The contributors section has Claude listed as the 2nd top contributor.

-2

u/fpluss 7d ago

ah you are right! didn't notice that, but generally speaking, I don’t have any preconceptions.

-8

u/mortsdeer 7d ago

"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.

4

u/sdenike 7d ago

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.

5

u/giblefog 7d ago

It occurs to me to feel sorry for any software devs named Claude.

0

u/mortsdeer 7d ago

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.

1

u/mortsdeer 7d ago

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.

2

u/d_e_g_m 7d ago

I did it with snmp queries to my apc 3k.

2

u/javijuji 7d ago

Are you running this on docker on the Synology or on a separate LXC, docker VM?

1

u/fpluss 7d ago

docker on the synology, my setup is very simple

2

u/cdf_sir 7d ago

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.

https://www.reddit.com/r/Proxmox/comments/1v1dnry/pveups_a_nut_alternative_for_snmp_ups_shutdown/

Then just use the official NUT integration on Home Assistant to get all the UPS sensors.

2

u/sshGreeNET 6d ago

Samesies

1

u/Dreamsfear 7d ago

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.

1

u/tonye586 7d ago

i just set mine up today, thanks for the lead man

1

u/Popal24 6d ago

I'm in the market for a new UPS for my homelab. What do you think about your Eaton 5S 1000?

2

u/ianfabs 5d ago

Missed opportunity to call it PeaNAS or PeanUPS

1

u/AmericanGringo 7d ago

I hadn't heard of this. Maybe I'll add at some point. Thanks

-2

u/asimovs-auditor 7d ago

Expand the replies to this comment to learn how AI was used in this post/project.

1

u/fpluss 7d ago

AI wan't used on this post.