[DRIVER] NUT Discovery + UPS & Outlet Status

Using putty /telnet on port 3493 I get an "error command unknown" I am assuming that means it is open ?

After some fiddling around and leaving the user/password blank in the parent setup, I am now getting info in the live log and the dashboard is updating.
Thanks guys for all your help. I might tweek the info for my UPS.

I just uploaded a new version that authenticates properly to NUT... 10 hours late... :slight_smile:

:smiley::smiley::smiley::smiley:

Thank you for saying this. I found my old config of a PC I have receiving broadcasts from my NAS and I got HE connected to my NAS. I now just need to edit the code to parse the details provided by my NAS but this is great that I can now integrate these two.

@guyeeba thank you for posting this code!

1 Like

I put together the simplest app I could to notify me when the powerSource changes since it's not availalbe in RM/HSM. You can find it here: [Release] Send Alert when powerSource changes

I need to preface this by saying I know nothing Jon Snow, about NUT UPS's.

That said, I've got it working with my synology NAS. I have an EATON UPS. I tried firstly with passwords, based on this website, indicating usernames/passwords, which worked, but some errors. Then I tried without passwords/usernames, and got the same errors.

Are you experts able to help a newbie.

Is it normal to have that much logging, every 10 seconds? I realise I can turn off debug logging, but still that's a lot of stuff going on behind the scenes, every 10 seconds? Will that bog down my hub?

You may want to try my driver as others with Synology NAS has success using it. You can find a link here and it was based on @guyeeba’s work. He gave me permission to post my own version.

For anyone that has a Cyber Power System CP1500 AVR and you have debian you need to manually create /etc/udev/rules.d/52-nut-usbups.rules with

# set permissions for CyberPower UPS -jea 2010-06-02
SUBSYSTEM=="usb", ATTRS{idVendor}=="0764", GROUP="nut", MODE="0660"

Then plug the usb cable back in.

In your ups.conf file you need

[myups]
      driver = usbhid-ups
      port = /dev/usb/hiddev0
      desc = "My UPS"

Make sure you have MODE=netserver in nut.conf

Thanks, I'll have a look there soon. But maybe you can help with another issue I'm having. I've been using the awesome nodered integration for downloading HE backups. However, I've just got node-red going on my synology NAS. Took a while, since I had to chmod some directories, which was really unsual.

Anway, I can't figure out how to get it to download to the synology NAS. I've got the same flow as previously, just not sure how to structure the syntax.

This is my flow, copied from other node-red thread.

It downloads the backup from HE, but I'm not sure of the syntax in the third node (string).

I've tried
//diskstation etc
\diskstation etc (where etc is the backup path)
/diskstation etc
\diskstation etc
/volume1 etc
/etc

any thoughts? It's driving me crazy. I do have the data files stored outside of the docker container, under docker/nodered, and the backup file is not in there either.

I don’t own a Synology so unsure specific details. In my QNAP I did have to map a share folder when setting up my NodeRed container so it has access to the host NAS. I would expect Synology to have a similar feature. From there the path depends on your folder mapping.

Thank you for writing these drivers. Now I can properly shutdown my hub when my Cyberpower UPS is on battery and gets low. Very helpful!

Wanted to add my thanks to @guyeeba for these drivers. Getting NUT working on my RPi4 was the most difficult part. Your drivers were easy and look to be working great. So again, thank you.

1 Like

Is there a guide for how to set this up, including the NUT setup for a Raspberry Pi? I found this, but I think I am missing something. Any help you guys can provide would be great. For reference when SSH into the pi I can see and communicate with the CyberPower UPS, but Hubitat cannot see/connect to the pi.

Specifically, what are the setup parameters in Hubitat? I'm guessing the IP or hostname of NUT server is the IP or hostname of the Pi in my case, but is Username at NUT server the username to get into the pi, or is it another user I have to make within NUT? The same question for Password at NUT server is this the Pi password, or is it another password for NUT?

1 Like

What are you using to monitor your UPS? If you are using a Raspberry Pi, could you provide some guidance into how to set it up? Also @gd_brock if you have any input it would be appreciated since you appear to have it working properly.

I used the same guide that you referenced in your earlier post. I followed the steps outlined in the "Reconfigure NUT on the server" section. Make sure nut.conf is setup for MODE=netserver. In the upsd.users configuration I created a slave user I called "Hubitat" setup like the guide shows for the "upsmon-remote" users but on the line that declares the user as a slave account I have the full username. I think the guide is wrong and should have been "upsmon-remote slave". Then in the upsd.conf I'm setup to listen on the 127.0.0.1 loop back address and my wired IP address for the Pi that the Hubitat will connect to which for me is 192.168.1.55 for both I keep the standard port of 3493.

Back on the Hubitat in the master device preferences I filled in the IP of the Pi, the user name and password as I entered in the upsd.users configuration file. The port is the default.

Something else I've done is played around with node-red installed on the Pi where I use the upsmon user to monitor the UPS for better granular control to shutdown the Pi itself. From node-red I also have a redundant post sent to the Hubitat to make sure it shuts down.

1 Like

Yes, I’m using a raspberry pi to monitor my UPS. not sure what guide I used but it was one of the top google hits. I also am using a Homebridge plugin to monitor as well.

1 Like

Thank you so much, its all up and running now.

Is this still maintained ?

I cannot get it working. My ups is an APC Smart-UPS RT1000 (SURT1000XL).
I have the Raspberry setup running, i get a few stats with another driver [NUT UPS Device], but not with this one.

Setup:
nut.conf - set to netserver mode
upsd.conf - listen to 127.0.0.1 and raspberry ip on default port.
upsd.users - upsmon as master and hubitat as slave
hubitat - ip of raspberry and hubitat user credentials

My ups has an AP9631 network card. On the NUT page i cannot find neither the ups or the network card as supported, although i can find SURT2000XL and AP9630 (same family / gen).

In hubitat logs i get the following error: Parse: Couldn't process message: "ERR UNKNOWN-UPS"

I haven't looked at it lately because I was not running Hubitat due to a natural disaster but having recently plugged it in with the same NUT server that it used to be looking at running it picked up status right away and kept going. I see the Github at the top was last updated a couple months ago so appears reasonable efforts have been made to keep it going..

That error, and I'm no NUT guru, appears to be that the NUT server doesn't know what UPS is connected as the driver here isn't actually going through a big list of UPS's or anything. If NUT knows what it is it passes it along to Hubitat, the hub doesn't need to identify it.