[RELEASE] Network UPS Tools (NUT) monitor and shutdown controller (upsmon)

interesting.
OK I will use 30 seconds. But I don't see any reason to have such a frequent poll.
and I couldn't find hostsync in the NUT documentation.

You poll that frequently because it's what NUT is designed for. The NUT daemon will timeout and log out clients that don't poll frequently enough.

There is a link directly to the HOSTSYNC documentation on the driver page. See item 1 in the Important Notes section.

I am also running into the access denied issue. I am running a NUT server on a raspberry pi with 3 UPS plugged in. I have tried using all 3 names in the UPS Name field and none have worked.

Like others I am seeing the correct information come back in the logs but not showing the info in the device itself.

Any ideas?

I posted some diagnostic instructions last October. It was about connecting to a Synology, but it should get you started:

Maybe I'm missing something here. I'm not using Synology, I'm using a Raspberry Pi.

I have also confirmed all of my login information matches what is in the upsd.users file and I have confirmed the name in the ups.conf file.

The post has instructions for diagnosing/ confirming remote access to your NUT server using telnet or equivalent. It’s the easiest and quickest way to confirm your NUT configuration.

Sorry - still not understanding. Everywhere I have attempted to type this in it tells me it is not a valid command. Where should I be typing these commands?

Sorry, I assumed that since you are using a Pi, you would b re familiar with Telnet.

If you don’t have Telnet or equivalent, the easiest thing is to post your NUT configs. ups.conf upsd.conf, upsd.users, hosts.conf. You can skip the comment lines.

Also, post your configuration for the device in Hubitat, and current log with debug enabled.

[Are you a Husker?]

Unfortunately my knowledge is whatever the YouTuber Techno Tim shows me haha! Not sure if this is the best way, but here is all you requested:

ups.conf

pollinterval = 1
maxretry = 3

[apc-network]
driver = usbhid-ups
port = auto
desc = "APC - DM SE & Modem"
vendorid = 051D
productid = 0002
serial = XXXXXXXXXXXX

[ups]
driver = usbhid-ups
port = auto
desc = "APC - NAS & Plex"
vendorid = 051D
productid = 0002
serial = XXXXXXXXXXXX

[apc-misc]
driver = usbhid-ups
port = auto
desc = "APC - Misc Network"
vendorid = 051D
productid = 0002
serial = XXXXXXXXXXXX

upsd.conf

LISTEN 0.0.0.0 3493

upsd.users

[monuser]
password = secret
admin master

hosts.conf

MONITOR apc-network@localhost "APC - Dream Machine & Modem"
MONITOR ups@localhost "APC - NAS & Plex"
MONITOR apc-misc@localhost "APC - Misc Network"

I didn't attend UNL, but all of my family is from Nebraska, so big fan :slight_smile: .

You have 3 UPSs defined. Do you really have 3 UPSs on one Pi?

You have an error in your upsd.users file. Have you noticed error messages in the log when you start upsd?

Try this content instead:

[monuser]
  password = secret
  upsmon slave

That worked! Thank you!

1 Like

Thank you @dennypage for this fantastic driver. Using it now to keep an eye on my UPS, this is great.

Was wondering, see through debug log that you are only exposing status, load, charge, runtime.

Would it be possible to expose more variable from nut status, such as battery temperature, input low/high, output status, etc?

Thank you

I consciously chose not to do this. The goal of the driver is low overhead, safe reliable shutdown of the hub rather than general UPS monitoring. Discussion earlier in the thread:

1 Like

This makes perfect sense, apologies for not realizing that earlier.

Thank you very much

1 Like

I have installed this and its connected just fine, however I want to send out a message with the battery level using %battery%. It shows "null" in the rules machine.

I don't know RM well enough to answer definitively, however the help text in RM implies (to me) that %value% would be the appropriate choice:

Use %device% to include event device name,
%value% to include event value,
%text% to include event description text,
%time% to include event time,
%date% to include event date,
%now% for current time.
To include a variable value use %variable-name%.

The Notifications app has similar help text:

Use %device% to include event device name,
%value% to include event value,
%text% to include event description,
%time% to include event time, and
%date% to include event date.

Perhaps someone more knowledgeable about RM/Notifications will weigh in with a more definitive answer.

1 Like

Yes if you trigger the rule with the battery attribute then the value will be dropped into %value% when the rule triggers. Also you can create a variable in the rule and then have the rule save the battery value to that each run, then use that variable in your notifications.

2 Likes

Got it. Thanks!!!

Hi Denny, FYI came across this odd behaviour in the hour just prior to the clock going back 1 hour:

This kept repeating until the clock rolled back to 1am and everything was fine after that:

On the NUT server (RPI) side, nothing special logged, all I see is the repeated attempts to log in every minute or so.

Not sure there's anything you can do about it, but FYI.

Very interesting. Thank you for letting me know. I checked my four hubs and they all show the same behavior during the 1 hour period. I'm guessing that it's a general issue with telnet on the hub.

@gopher.ny, can you offer any thoughts on this?

2 Likes