[Nut-upsdev] Python and NUT

Greg Troxel gdt at lexort.com
Fri Dec 3 00:30:45 GMT 2021


Jim Klimov <jimklimov at gmail.com> writes:

> Just in case, regarding the spin-off topic of Python scripting: note there
> is a sort of binding in NUT sources, as used in GUI app etc.
>
>   I am not sure what practical state it is in, e.g. if it may need more
> attention for NUT data points and concepts added in recent years, but I
> suppose fixing it in upstream (if needed) is better than everyone
> reinventing their wheel ;)
>
>   In master branch, it was recently fixed to pass self-test with both
> Python 2.x and 3.x (several sub-versions).

Thanks for pointing that out.  I had found it in the last release, and
then found the master branch fixed versions.   I will see about making
any enhancements there and submitting them; you are entirely right that
any parsing and utility functions belong there.

I also intend to publish my code someplace.  It just checks status every
2s and reports json over mqtt, but it only sends a report if there is a
meaningful change or a minute has passed.  This avoids spamming Home
Assistant recorder database with every 2s voltage readings, but reports
immediately if it goes on battery or line voltage drops to 0.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20211202/f03da08c/attachment.sig>


More information about the Nut-upsdev mailing list