Network UPS Tools (nut) setup issues

Now you see why its confusing.

Do you need a nut client on OH2? or is the binding a replacement!

1 Like

EDIT: just came up. Is there anything else I need to do to OH2 to have it receive a power signal to shutdown if the UPS sees power loss?


18:11:55.792 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Battery_Runtime changed from NULL to 1050
18:11:55.797 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Current_Load changed from NULL to 33
18:11:55.799 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Input_Voltage changed from NULL to 237.0
18:11:55.801 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Input_Voltage_Nominal changed from NULL to 230
18:11:55.804 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Battery_Voltage changed from NULL to 26.4
18:11:55.806 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Battery_Charge changed from NULL to 80

I have the nut-client installed on the OH2 machine, but I don’t think it is required.
Actually, I think it’s unconfigured. The file /etc/nut/nut.conf is the default one.

1 Like

OK, cool. Do you use any Windows VMs on the QNAP or other VMs you signal a shut down for?

yeah, it seems that the NUTS Binding acts directly as a client to the NUTS daemon
the other client components are used to shutdown the O/S on the remote host and they are not needed by the binding

1 Like

This is what the documentation needs to spell out :slight_smile:

1 Like

Correct.
My OH UPS setup is just for monitoring and alert purposes only.
I don’t take any action on power failure.
I setup my QNAP NAS to suspend the VMs when entering low battery.

1 Like

there you go:
Docs entry link with edit mode on: https://github.com/openhab/openhab1-addons/edit/master/bundles/binding/org.openhab.binding.networkupstools/README.md
:slight_smile:

Thanks!

@Mihai_Badea have you seen this for your battery?


18:19:36.693 [WARN ] [.rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state '1050' on item 'UPS_Battery_Runtime' with pattern 'JS(duration_from_seconds.js):%s': An error occurred while loading script.

this has something to do with the JS transformation
is the addon installed on your OH2 system?
You also need the actual JS file (duration_from_seconds.js)

Yes Sir, its installed. 1050 is the run time in seconds.

Then Mihai should share with you the duration_from_seconds.js contents :slight_smile: (to be placed under $OPENHAB_CONF/transform/ folder)

1 Like

Yes haha! just realised that :smiley: @Mihai_Badea

1 Like

I use 2 Items and a rule to do this: Ubiquiti Unifi Binding Feature Discussion

but it should be better with a JS xform

/etc/openhab2/transform/duration_from_seconds.js:

// computes nicely formatted duration from given seconds
(function(i){

        var date = new Date(null);
        date.setSeconds(parseInt(i)); // specify value for SECONDS here
        return date.toISOString().substr(11, 8);

})(input)

:laughing:

2 Likes

QNAP UPS info:
image

OH UPS section - BasicUI:

1 Like

Wow over 1 hr!! Thats impressive. Ive got a 1500VA unit and mines 18 minutes :smiley:

Its powering a Cisco 3945 with UCS module, QNAP 880 and a Cisco 2960 :stuck_out_tongue:

The important thing here is estimated protection time :laughing:
I had a power outage a few weeks ago, in the middle of the night

Funny stuff
 The beeper of the UPS was enabled (at that time) and I had to wait for the battery to run out to get rid of the alert beeps.
I wasn’t over an hour
 maybe 50 minutes, but those were the longest 50 minutes of my life. Cursing the damn beeper cause I wasn’t able to close my eyes :laughing: :laughing: :laughing:
The power came back 15 minutes after the battery ran out and guess what? As I couldn’t sleep anymore I had to disable the beeper to prevent future wake-ups :slight_smile:

1 Like

hahah! :slight_smile: Mines in the garage, where i wont hear it!

Has anyone configured NUT client on another unix box?? I cant get it to function either.

I added the user in and also defined the mode as slave


Network UPS Tools upsmon 2.7.2
fopen /var/run/nut/upsmon.pid: No such file or directory
Unable to use old-style MONITOR line without a username
Convert it and add a username to upsd.users - see the documentation
Fatal error: unusable configuration

Hi Guys

Is this Network UPS Tools binding meant to accept shutdown signals from the Master NUT server (in this case, the QNAP NAS) or does it ONLY monitor the status of the UPS health?

I just tried a test shutdown and it didnt signal my OH2 box to shutdown

:frowning: