[DRIVER] NUT Discovery + UPS & Outlet Status

What do you mean by this? AFAIK, this interfaces a RPi that hosts a NUT server and connects, often via USB on the Pi, to the UPS and sends that interface to HE. Did you manage to connect the UPS directly to HE?

i am not sure those stats are avail. via the command line call.s do you know the command to get that data?

ok found the command will work on it.. make sure you post in my other thread as this is not really for my device handler .. I will post updates in my thread.

done: added all attributes i could, check the thread:

In your driver i have the ups ip set up not the ip of the raspberry / nut server. I assume the connection is directly to the ups. I have not tested wih the rpi unplugged, but your driver does not know the ip of the server so how could it make a connection?

Thanks for the update. I will test it as soon as posible.

Interesting, I would not have expected this to work, but if it does great. What brand/model of UPS do you have out of curiosity?

I can confirm it works directly. No need for rpi / nut server.

My ups is: APC RT1000

1 Like

Setup NUT on Asus Merlin as per here:
http://www.giuseppeparrello.it/en/net_router_install_nut_server.php

need to change start upsd on asus to your loin user as there is no root.
my router 192.168.1.2

Add/edit the following lines in these files. 
/jffs/scripts/service-event
/tmp/mnt/32gb/entware/sbin/upsdrvctl -u admin start

/opt/etc/nut/
nut.conf
MODE=standalone

ups.conf
[ups]
    driver = usbhid-ups
    port   = auto
    pollinterval = 10

upsd.conf
LISTEN 127.0.0.1 3493
LISTEN 192.168.1.2 3493

upsd.users
    [admin]
                password = pass
                actions = SET
                instcmds = ALL
        actions = fsd
        
 [upsmon]
                password  = pass
                upsmon master

upsmon.conf
 RUN_AS_USER admin
MONITOR ups@localhost 1 upsmon pass master

/opt/etc/init.d/
S15upsmon
ARGS="-u admin -p"

S15upsd
ARGS="-u admin"


config on Hubitat:
192.168.1.2
user: upsmon
pw: pass

Used the RM rule above and it's working great! Thank you for the driver!

Quick question:
I have a cyberpower 1000PFCLCD and the driver created one child device.

What's the outlet driver NUT Child UPS Outlet.groovy for?

Also getting lots of couldn’t parse message. How would I go about adding them to be parsed?

1000: ParseUPS: Couldn't process message: "[timer, shutdown] - -60"

dev:4832021-01-30 22:41:16.904 debugHUB NUT ASUS : Received: VAR ups ups.timer.shutdown "-60"

dev:4842021-01-30 22:41:16.899 debugUPS CyberPower 1000: ParseUPS: Couldn't process message: "[test, result] - Done and passed"

dev:4832021-01-30 22:41:16.892 debugHUB NUT ASUS : Received: VAR ups ups.test.result "Done and passed"

dev:4832021-01-30 22:41:16.879 debugHUB NUT ASUS : Received: VAR ups ups.status "OL"

dev:4842021-01-30 22:41:16.873 debugUPS CyberPower 1000: ParseUPS: Couldn't process message: "[serial] - 000000000000"

dev:4832021-01-30 22:41:16.867 debugHUB NUT ASUS : Received: VAR ups ups.serial "000000000000"

dev:4842021-01-30 22:41:16.861 debugUPS CyberPower 1000: ParseUPS: Couldn't process message: "[realpower, nominal] - 600"

dev:4832021-01-30 22:41:16.855 debugHUB NUT ASUS : Received: VAR ups ups.realpower.nominal "600"

dev:4832021-01-30 22:41:16.844 debugHUB NUT ASUS : Received: VAR ups ups.productid "0501"

dev:4832021-01-30 22:41:16.833 debugHUB NUT ASUS : Received: VAR ups ups.model "CP1000PFCLCD"
‘’’

Thanks for this NUT Driver. I have my Cyberpower UPS plugged into my Synolgoy and took the credentials from their config files and added the IP address of my Hubitat to the Synolgoy UPS config page. Installing and configuring the driver was easy and it immediately discovered the UPS. I find using this is much more flexible than running a bunch of shell scripts that do posts from a slave raspberry PI that has the NUT monitor on it.

I am able to shut down more equipment quicker to give longer battery life to my core network devices. My end goal is that devices like NAS, Hubitat, and others that could be damaged by pulling power and provide no functionality during a power failure should be shut down after 5 minutes on UPS. Thus my router, residential gateway, DNS, and AP's continue to run to keep my work from home network operational.

I had a good test of this last night as we lost power, I don't have the timer in the actions yet just used battery percentage, power came back up after about 4 minutes but everything looks like it's going to run well. Below is my rule machine code as it sits now, if I get some free time I will incorporate runtime vs. percentage of battery.

I finished up my rule for using time on battery vs. percentage battery remaining this is what I came up with. Just figured I would share it with the community.

Just a minor edit, forgot to make the delayed events cancelable.

2 Likes

Anyone else see this being broken with 2.2.8? I'm not sure if it was 2.2.8 or if it was upgrading my Synology to DSM 7.

Looks like if I enable Debug on the parent NUT driver, things work. If I disable Debug, logs just show:

dev:21092021-07-19 13:09:29.331 errorParseOK: Couldn't process message: "[]"

dev:21092021-07-19 13:09:28.304 infoOpening telnet connection

Though looks like it's still closing connection.

dev:21092021-07-19 13:10:43.819 errorParseOK: Couldn't process message: "[]"

dev:21092021-07-19 13:10:43.813 debugIntegration - NUT: Received: OK

dev:21092021-07-19 13:10:43.790 debugIntegration - NUT: Sending USERNAME monuser

dev:21092021-07-19 13:10:42.772 infoOpening telnet connection

dev:21092021-07-19 13:10:36.529 warntelnet input stream closed

dev:21092021-07-19 13:10:36.478 errortelnetStatus: receive error: Stream is closed

Everything working fine for me!

1 Like

Yeah, it seems to be working. Odd though.

Will keep an eye on it.

I checked it was working on my C4, before upgrading to 2.2.8. It was.

I upgraded, and now it's showing errors.

(edit: synology NAS on 7.0 also)

Are all of these added as App code or Drivers code?

They are all device drivers, there is no app front end to this integration, all setup is done in the device preferences of the main driver.

1 Like

This is good, thanks!

Question: I'm trying to monitor watts using this. I see volts, battery volts, and a suspicious "load" but the associated # isn't making sense, Anyone have any insights into figuring out what I'm looking for? The load (in watts) should be more in the 300-400 range... So it ain't watts,... or amps
image
Logs show:

dev:8622021-11-07 09:29:14.693 am debugSynology UPS Monitor: Processing of values for "ups" finished
dev:8622021-11-07 09:29:14.692 am debugSynology UPS Monitor: Received: END LIST VAR ups
dev:8622021-11-07 09:29:14.682 am debugSynology UPS Monitor: Received: VAR ups ups.vendorid "0764"
dev:8622021-11-07 09:29:14.673 am debugSynology UPS Monitor: Received: VAR ups ups.timer.start "0"
dev:8622021-11-07 09:29:14.663 am debugSynology UPS Monitor: Received: VAR ups ups.timer.shutdown "-60"
dev:8622021-11-07 09:29:14.654 am debugSynology UPS Monitor: Received: VAR ups ups.test.result "No test initiated"
dev:8622021-11-07 09:29:14.643 am debugSynology UPS Monitor: Received: VAR ups ups.status "OL"
dev:8622021-11-07 09:29:14.633 am debugSynology UPS Monitor: Received: VAR ups ups.serial "FCEJZ2002184"
dev:8622021-11-07 09:29:14.624 am debugSynology UPS Monitor: Received: VAR ups ups.realpower.nominal "900"
dev:8622021-11-07 09:29:14.614 am debugSynology UPS Monitor: Received: VAR ups ups.productid "0501"
dev:8622021-11-07 09:29:14.604 am debugSynology UPS Monitor: Received: VAR ups ups.model "ABMT1500"
dev:8622021-11-07 09:29:14.594 am debugSynology UPS Monitor: Received: VAR ups ups.mfr "CPS"
dev:8622021-11-07 09:29:14.583 am debugSynology UPS Monitor: Received: VAR ups ups.load "53"
dev:8622021-11-07 09:29:14.573 am debugSynology UPS Monitor: Received: VAR ups ups.delay.start "30"
dev:8622021-11-07 09:29:14.563 am debugSynology UPS Monitor: Received: VAR ups ups.delay.shutdown "20"
dev:8622021-11-07 09:29:14.554 am debugSynology UPS Monitor: Received: VAR ups ups.beeper.status "disabled"
dev:8622021-11-07 09:29:14.544 am debugSynology UPS Monitor: Received: VAR ups output.voltage "138.0"
dev:8622021-11-07 09:29:14.534 am debugSynology UPS Monitor: Received: VAR ups input.voltage.nominal "120"
dev:8622021-11-07 09:29:14.523 am debugSynology UPS Monitor: Received: VAR ups input.voltage "122.0"
dev:8622021-11-07 09:29:14.513 am debugSynology UPS Monitor: Received: VAR ups driver.version.internal "0.41"
dev:8622021-11-07 09:29:14.501 am debugSynology UPS Monitor: Received: VAR ups driver.version.data "CyberPower HID 0.4"
dev:8622021-11-07 09:29:14.491 am debugSynology UPS Monitor: Received: VAR ups driver.version "DSM7-0-1-NewModel-repack-42200-210809"
dev:8622021-11-07 09:29:14.481 am debugSynology UPS Monitor: Received: VAR ups driver.parameter.synchronous "no"
dev:8622021-11-07 09:29:14.472 am debugSynology UPS Monitor: Received: VAR ups driver.parameter.port "auto"
dev:8622021-11-07 09:29:14.461 am debugSynology UPS Monitor: Received: VAR ups driver.parameter.pollinterval "5"
dev:8622021-11-07 09:29:14.452 am debugSynology UPS Monitor: Received: VAR ups driver.parameter.pollfreq "30"
dev:8622021-11-07 09:29:14.442 am debugSynology UPS Monitor: Received: VAR ups driver.name "usbhid-ups"
dev:8622021-11-07 09:29:14.432 am debugSynology UPS Monitor: Received: VAR ups device.type "ups"
dev:8622021-11-07 09:29:14.422 am debugSynology UPS Monitor: Received: VAR ups device.serial "FCEJZ2002184"
dev:8622021-11-07 09:29:14.411 am debugSynology UPS Monitor: Received: VAR ups device.model "ABMT1500"
dev:8622021-11-07 09:29:14.401 am debugSynology UPS Monitor: Received: VAR ups device.mfr "CPS"
dev:8622021-11-07 09:29:14.392 am debugSynology UPS Monitor: Received: VAR ups battery.voltage.nominal "24"
dev:8622021-11-07 09:29:14.381 am debugSynology UPS Monitor: Received: VAR ups battery.voltage "27.3"
dev:8622021-11-07 09:29:14.370 am debugSynology UPS Monitor: Received: VAR ups battery.type "PbAcid"
dev:8622021-11-07 09:29:14.361 am debugSynology UPS Monitor: Received: VAR ups battery.runtime.low "300"
dev:8622021-11-07 09:29:14.350 am debugSynology UPS Monitor: Received: VAR ups battery.runtime "600"
dev:8622021-11-07 09:29:14.340 am debugSynology UPS Monitor: Received: VAR ups battery.mfr.date "CPS"
dev:8622021-11-07 09:29:14.330 am debugSynology UPS Monitor: Received: VAR ups battery.charge.warning "20"
dev:8622021-11-07 09:29:14.319 am debugSynology UPS Monitor: Received: VAR ups battery.charge.low "10"
dev:8622021-11-07 09:29:14.299 am debugSynology UPS Monitor: Received: VAR ups battery.charge "100"
dev:8622021-11-07 09:29:14.292 am debugSynology UPS Monitor: Processing of values for "ups" started
dev:8622021-11-07 09:29:14.288 am debugSynology UPS Monitor: Received: BEGIN LIST VAR ups

Load is supposed to be the load on the UPS in percentage of it's capacity, for mine here:

image

at at my mom's house:

image

My UPS has battery run time secs of around 6000, but in a test, it shut down the synology NAS after about 60 seconds. What do you have in the Synology UPS page?

I'm wondering why this is the case. I know it's got nothing to do with this driver, btw.

Head over to the SynoForum there is a full thread on the UPS settings page and behaviors and PROBLEMS. :japanese_goblin:

https://www.synoforum.com/

1 Like

Does this thing still work? I have installed it on HE and am getting connection refused. It is flooding the HE log with connection attempts and won’t stop even after I delete the device in Hubitat. I have to reboot Hubitat to get it to stop after deleting the device.

Do I have to set up a slave user on raspi NUT for HE? Do I have to set up different permissions on NUT, or different user id? I am trying the driver without any user ID and password like suggested earlier, and with the NUT Monitor userid I set up. I even tried it with the NUT admin user ID. Do I need a slave ID?

LJ