Greg Troxel
2023-May-19 13:11 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
My $0.02: LB is baked in to nut behavior. So if a UPS doesn't report LB, then it makes sense to synthesize it. Synthetic LB is the cleanest fix at the earlier processing point. One could have a config that is basically synthetic-lowbatt-percent that generates LB if (as Jim says) on battery, not calibrating, and batt% <= that. One could have a similar config synthetic-lowbatt-voltage same thing except voltage. The mapping from voltage and current (and history) to % is difficult, but this lets people have another option and is easy to implement. I think it makes sense to allow this even when the UPS will report LB. I want to shut down earlier than max runtime to be nicer to the battery. Once the outage is over an hour it's usually 4, for me. It might make sense to also be able to ignore UPS-provided LB via ignore-hardware-lb: true but probably there is little need as most UPS units seem to throw LB later than wanted vs early. But again easy. Yes, this could be in upsmon, but that's not synthetic LB, it's choosing to shutdown if battery is below X. We should be clear on "critical" vs "LB" and clean up the language to be consistent. Beware that I'm a bit fuzzy on details beyond my comments and even some on things I commented on, so take them as such.
Greg Troxel
2023-May-19 13:26 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
I should add that my thinking is in part due to having a python script that does the equivalent of upsc and reports status to Home Assistant over MQTT. If I had a UPS that didn't do LB, I would still want to see LB reported via this mechanism at the right time. With this support in upsmon, that wouldn't happen. I see a lot of the point of nut as regularizing all UPS units into defined semantics so that one can manage them without knowing about the unit specifically.
Willcox David
2023-May-22 02:44 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Interesting. I?ve been thinking along what sounds like similar lines myself. I have a very simple setup, one UPS that powers a NAS plus all of the boxes that provide Internet and WiFi to the house. The NAS is the largest power user, and the least critical. I have a RPI with NUT connected to the UPS?s USB and the NAS gets status from the RPI. When the NAS sees LB it quiesces itself until the UPS reports OL, but the UPS doesn?t report LB until the battery is down to 10%. I want the NAS to quiesce at more like 50%. So, I?d been thinking of adding a check in the server: When a client requests status and the UPS reports OB, the NUT server optionally check the battery level from UPS and returns LB if it?s below a configured threshold. I?d started to look where to do that but got sidetracked by other tasks. If someone?s already considering this I?d love to see what the plan is. Pull request someone? In other news, I was surprised to find that the NUT build (maybe not the actual build, but maintenance?) uses a tool that I wrote in 1976. Many fingers have touched it since then, but the core logic is still there.> On May 19, 2023, at 8:11 AM, Greg Troxel <gdt at lexort.com> wrote: > > My $0.02: > > LB is baked in to nut behavior. So if a UPS doesn't report LB, then > it makes sense to synthesize it. Synthetic LB is the cleanest fix at > the earlier processing point. > > One could have a config that is basically > synthetic-lowbatt-percent > that generates LB if (as Jim says) on battery, not calibrating, and > batt% <= that. > > One could have a similar config > synthetic-lowbatt-voltage > same thing except voltage. The mapping from voltage and current (and > history) to % is difficult, but this lets people have another option > and is easy to implement. > > I think it makes sense to allow this even when the UPS will report LB. > I want to shut down earlier than max runtime to be nicer to the > battery. Once the outage is over an hour it's usually 4, for me. > > It might make sense to also be able to ignore UPS-provided LB via > ignore-hardware-lb: true > but probably there is little need as most UPS units seem to throw LB > later than wanted vs early. But again easy. > > Yes, this could be in upsmon, but that's not synthetic LB, it's > choosing to shutdown if battery is below X. > > We should be clear on "critical" vs "LB" and clean up the language to > be consistent. > > Beware that I'm a bit fuzzy on details beyond my comments and even > some on things I commented on, so take them as such. > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
Carsten Aulbert
2023-May-22 09:48 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hi all, On 5/19/23 15:11, Greg Troxel wrote:> LB is baked in to nut behavior. So if a UPS doesn't report LB, then > it makes sense to synthesize it. Synthetic LB is the cleanest fix at > the earlier processing point.I fully agree and thus this ought to be done in/near uspd IMHO. I glanced over the server/ directory and was not sure where even to begin hooking this in. Should this be directly in upsd (upsd.c) or rather in/near the driver level (driver/main.c)?> > Yes, this could be in upsmon, but that's not synthetic LB, it's > choosing to shutdown if battery is below X.Yeah, this should be independent and fully on the client side (and thus upsmon) where each client can choose how to react to a UPS on battery.> We should be clear on "critical" vs "LB" and clean up the language to > be consistent.For upsmon, I would stay with critical as this is already mentioned in upsmon(8) and I guess "LB" could stay for the server part as each user could decide whether she wants to rely on LB from the UPS itself or on the self-defined override.> Beware that I'm a bit fuzzy on details beyond my comments and even > some on things I commented on, so take them as such.Same here, quite at a loss what is handled where on the server and always low on time due to other projects/tasks. Cheers and any pointers appreciated! Carsten -- Dr. Carsten Aulbert, Max Planck Institute for Gravitational Physics, Callinstra?e 38, 30167 Hannover, Germany, Phone +49 511 762 17185 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4827 bytes Desc: S/MIME Cryptographic Signature URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20230522/d77291d4/attachment.bin>
Possibly Parallel Threads
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?