[Nut-upsuser] Using 'dummy.ups' for a real application, not just testing...

Tom tomdiviney at gmail.com
Sun Feb 19 13:18:44 GMT 2023


Good Morning,

I am working on setting up a 12V DC UPS that will power a NAS and a router
for a few hours.  It contains some lithium-ion batteries, and a BMS to
control charging.  Since it is just a dumb box with batteries, it has no
intelligence to inform the NAS of its status.  This is where NUT comes in...

I would like to incorporate a Raspberry Pi NUT server into this scheme.
The Rpi can measure input voltage, and output voltage & current to
determine the status of this simple UPS.

With some of the excellent documentation online, I have gotten a NUT server
running on the Rpi, and my NAS (a Qnap) has been able to read the status.
I used the 'dummy-ups' driver for testing this and it worked great.

Now, for the real business - Since this is entirely homebrew, there is not
an appropriate driver available.  I read about creating my own driver using
'skel.c' as a template.  But, nobody else would have any interest in my
very specialized driver.  Plus - it seems overwhelming to me when I attempt
to understand how to build NUT and I fear getting totally bogged down in
all the minutiae of that.

But, it occurred to me - Why can't I just use 'dummy-ups' for this as-is?
I can have a simple 'c' or Python program to read my values (to determine
status) and then just write a few relevant lines into a '.dev' file to be
served out to the LAN with the factory NUT server tools?  My file would
contain something like this:

ups.mfr: Tom
ups.model: My Contraption
battery.charge: 100
ups.status: OL
input.voltage: 1.02
battery.voltage: 11.5
output.voltage: 11.2
output.current: 3.4
battery.runtime: 1000


I write this file periodically (maybe every 15-60 seconds) and the Rpi NUT
server would be none the wiser and just keep supplying the
constantly updated contents of this file to the NAS.

Am I overlooking something with this approach?  I am completely new to NUT
and would appreciate any feedback from more seasoned users...

-Thanks
 Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20230219/d3246b1e/attachment.htm>


More information about the Nut-upsuser mailing list