How to set polling interval for networkupstools

I’ve been using networkupstools for a short time now with 5 UPS units each on their own Pi. Both NUT and the networkupstools binding are performing well for me. That being said I’d like to be able to change the polling interval for the binding so that it doesn’t hit my network and log files so hard. I think I found 3 distinct polling intervals:

  • UPS Status: hardcoded to 3 seconds
  • UPS Properties: hardcoded to 1 hour
  • Channel Properties: configured by user

I’d really like the ability to change that UPS Status interval to something different. Is this something a user can do? Thanks!

No it’s not possible for the user to change this. What logging do you get? An change to the binding could also be to see if the logging can be reduced. If you have ideas please open an issue on the openHAB-addons GitHub repo

With default log setting, I see no log for this binding in my own logs.
So I would be also interested by the concerned logs.

One of my 5 UPSs is flapping status between OL and OB every 3 seconds so I’m getting ItemStateChangedEvents for it. It’s about a $1500 USD unit and no longer under warranty so I’m not going to replace it because as far as I can tell the only issue is this status flapping. OpenHAB, networkupstools, and NUT are all behaving well, it’s the UPS that’s misbehaving. I was just hoping there was something I could do to shim for this bad UPS behavior.

I tried to work around this by creating a custom channel on ups.status, but that polls every 3 seconds. I then started a deep battery test and witnessed the battery.charge updating every 3 seconds or in intervals of 3 seconds. My “Refresh” configuration on the Thing is 60 seconds. At this point I don’t understand what that Refresh configuration value does. Based on my testing I would conclude that it does not affect the frequency in which the nut-server network service is polled for channels or the frequency in which openHAB state changes are updated. I had previously assumed that it would affect at least one of these. I’m running openHAB 4.0.0 Build #3294.

Based on how I understand NUT to work, I doubt that the binding polls for status. It most likely subscribes as a client and it’s the monitor that is pushing these updates. So setting a polling period probably won’t do anything anyway. (This is not based on the code but on my experience using NUT so I could be totally off).

However, the ups.conf file itself does have a polling period property. Have you tried changing that?

I think that “refresh” controls just how long between updates to the Channels even if the state hasn’t changed. But if there is a change reported the Item will immediately be updated/

Brilliant! Thanks so much for the suggestion to update the polling interval in ups.conf, it worked like a charm.