[Nut-upsdev] new variable for battery charge indication?

Berge, Matthijs ten M.tenBerge at awl.nl
Wed Apr 11 14:24:41 UTC 2018


While writing a new driver for Siemens UPSes, I encountered the following problem:
The UPS is not able to indicate the current battery charge level as a numeric value, but only as a Boolean value: below or above 85%.
(Apart from that, it can also signal a Boolean 'critical' level, which is used to activate the 'LB' status in NUT. This works fine.)

There is currently no variable in nut-names.txt that can hold such a battery charge indication, all existing variables are percentages, voltages or other numeric values.

What would be your preferred solution?
- Create a new variable (for example 'battery.charge.indication') with an opaque string value, such as "<85%" or ">85%",
- Place such as string in the variable 'battery.charge', (this would probably confuse software that expects a number there),
- Place some numeric value in 'battery.charge' for the two (or actually three) situations (which values?),
- Leave out the charge indication altogether,
- something else...

Reference: https://github.com/networkupstools/nut/pull/545/files#diff-b5c12d721382ba690193509feb1b7012R231

Kind regards,

DISCLAIMER: For our full disclaimer, please visit www.awl.nl/en/about-us/disclaimer

More information about the Nut-upsdev mailing list