I noticed that my networkupstools binding stopped working. I am guessing this happened over the last couple of months as there were some OpenHAB updates propagated from the Debian repos around that time.
Here’s what I’m seeing in /var/log/openhab2/openhab2.log
:
2019-03-24 09:29:29.974 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'nut.things' has errors, therefore ignoring it: [1,1]: no viable alternative at input 'networkupstools'
[2,1]: no viable alternative at input 'networkupstools'
[3,1]: no viable alternative at input 'networkupstools'
[4,1]: no viable alternative at input 'networkupstools'
…followed shortly after by:
2019-03-24 09:29:31.505 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService, id=410, bundle=245/mvn:org.openhab.binding/org.openha
b.binding.networkupstools/1.14.0.M1]: Updating property ups:refresh of configuration org.openhab.networkupstools caused a problem: Invalid configuration setting. Configuration key must contain a period ('.'), but does not.
org.osgi.service.cm.ConfigurationException: ups:refresh : Invalid configuration setting. Configuration key must contain a period ('.'), but does not.
at org.openhab.binding.networkupstools.internal.NetworkUpsToolsBinding.updated(NetworkUpsToolsBinding.java:167) ~[?:?]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) ~[9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1113) [9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1069) [9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [9:org.apache.felix.configadmin:1.9.10]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.10]
at java.lang.Thread.run(Thread.java:834) [?:?]
Here is my /etc/openhab2/services/networkupstools.cfg
file:
refresh=5000
ups1.device=myups1
ups1.host=localhost
I have experimented with ups1.refresh=5000
and that did not fix the issue.
Here is my /etc/openhab2/things/nut.things
file:
networkupstools="ups1:battery.percentage"
networkupstools="ups1:input.voltage"
networkupstools="ups1:ups.load"
networkupstools="ups1:ups.status"
To illustrate my UPS communication is working:
$ upsc myups1@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 40
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 1140
battery.runtime.low: 600
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CST135XLU
device.serial: CR7GT2000910
device.type: ups
driver.flag.ignorelb: enabled
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 10
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.parameter.vendorid: 0764
driver.version: 2.7.4
driver.version.data: CyberPower HID 0.4
driver.version.internal: 0.41
input.voltage: 120.0
input.voltage.nominal: 120
output.voltage: 136.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 31
ups.mfr: CPS
ups.model: CST135XLU
ups.productid: 0501
ups.realpower.nominal: 810
ups.serial: CR7GT2000910
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764
Note that the default port is used and user/pass not needed.
I realize the documentation is lacking for this binding. I also see lots of questions in the forums but I didn’t see anyone discussing this. For me, it was working as recently as January so I’m thinking something changed with either the binding or OpenHAB.
I don’t understand the missing ‘.’ that it is complaining about. It would be greatly appreciated if someone could shed some insight on this, and anything else that might need to change.
Here are the details of my setup:
- OpenHAB and NUT run on the same server
- Server is Debian testing (buster)
-
dpkg -l
reports OpenHAB version 2.5.0~M1-1 - Binding version is
binding-networkupstools1 - 1.14.0.M1
as reported in Paper UI
Thank you very much!