[DRIVER] NUT Discovery + UPS & Outlet Status

Logs > Device Stats (tabs at the top of logs page)

1 Like

Question. In the middle of your actions in your rule I see a "Wait for events" between your While and your ORR statements. How did you do that? I can't seem to find out how to insert the wait and then insert an OR. Can you explain?

LJ

The OR is part of the Wait, the indenting does not show that very clearly. It might make more sense shown with the new grid layout:

Once you add one Wait event, you just add another to the bottom (there is a button) and it puts in the OR. The Wait for Event page has a really confusing layout I see now, and there is no way to remove an event if you add too many.

2 Likes

Steve,

I know this old but I tried your code change above and I am still getting the "telnetStatus: receive error: Stream is closed" message in my logs each time it tries to reconnect. It does seem to reconnect after a retry and download the required information, but the error message is still flooding my logs. you seem to think this fixed your instance. Any other suggestions or changes you made to get this to work?

LJ

What is your update interval set to? I found if it was more than 30 seconds the telnet would have to reconnect. I have modified the code myself to add a sort of "NOP" keepalive command so that I can refresh less often but the connection stays active. I could post it on a Gist later today for you to try out if you want.

My update interval is 15 seconds. Might there be a setting in the RPi that would keep the connection alive longer? These are my settings in Nut UPS Server.

"Gist"?? Not familiar. but any help would be welcome. Just trying to keep things clean in the logs and smooth functioning.

Thanks,

LJ

I found mine worked without the user/pass so maybe try that out. Mine is running on a Debian variant OS so should be similar. For me it will only disconnect if it goes more than 30 seconds. Checking every 15 seconds it should not be getting disconnected.

You could just find that line of code where it logs the error and comment it out.

I was asked for my modified version of this driver set, so I have posted it in a Gist linked below.
I posted the original first then my version so if you click on the "Revisions" tab you can see the changes. Make sure you get all 3 files.

This could probably be further optimized to only process the data points every refresh that we would expect to actually change. The rest could be checked once a day or something. If there is interest I could look at adding that as well.

2 Likes

I ran into the same issue: with or without a password, the NUT server on my Synology NAS would disconnect 60 secs after the most recent Telnet message. Rather than generate a "keep alive" NOP message every minute I restructured the driver so that it doesn't use a persistent Telnet connection to the server, instead it reconnects each nutPollingInterval period and then closes the connection once it's finished refreshing all the UPS parameters.

I actually switched over to this driver now, and recommended it:

@jtp10181 Thanks, had no idea there was an alternative to your original.

Access denied when connecting to NUT server on Synology (NAS DS918+, DSM 7.1.1 ) from C-7 (2.3.6.144)

Using the driver from GitHub here.
Log
Configuration

Help please.

Post on the thread of the driver you are using, looks like this one: [RELEASE] Network UPS Tools (NUT) monitor and shutdown controller (upsmon)

1 Like

That's it
NUT upsmon driver cococafe PowerSource, Refresh, Battery, Initialize


The Nut server is connected to a Cyber Power CP1500PFCLCD using a USB and connected to a 2nd NAS and working fine, powering off when the power is lost.

As Jeff noted, you should post questions in the forum thread associated with the driver you are using.

How do I set up the server or hubitat to stop getting the "telnetStatus: receive error: Stream is closed" message. There must be some setting on the machine I am running NUT server on that can keep the connection open longer.

LJ

There is no server side setting that I know of to keep the connection from being closed. The way to keep the connection is for the client to actually login to the UPS via the NUT protocol. To my knowledge, this driver does not do that.

There is another NUT driver which does perform a login, which you can find here.

1 Like

I would highly recommend the driver from @dennypage that he linked to. It is much more streamlined and efficient than this old one, and is being actively supported. I switched over to it and removed the NUT discovery driver from my hub a while ago.

2 Likes