How do you handle binding errors if the device is not in network. For example i have a binding for Sonos and Denon. When i do not need them i power of the switch so they are not longer connected to power. They are not reachable until i am back home and power them up. But openhab bindings are still trying to reach them and output errors.
The errors are not that big problem but as i am a developer i do not like see errors in my log.
How do you handle them, is there a way to disable bindings temporaly or another way i do not know?
optionally I could have used the “ss” command like this:
osgi> ss org.openhab.binding
"Framework is launched."
id State Bundle
222 ACTIVE org.openhab.binding.ntp_1.8.0.201508130117
223 ACTIVE org.openhab.binding.weather_1.8.0.201508130117
224 ACTIVE org.openhab.binding.tivo_1.8.0.201508130117
225 ACTIVE org.openhab.binding.mqttitude_1.8.0.201508130117
228 ACTIVE org.openhab.binding.nest_1.8.0.201508130117
232 ACTIVE org.openhab.binding.zwave_1.8.0.201508130117
then just disable the one in question like so:
osgi> stop 232
osgi> 2015-09-21 07:31:41.431 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been shut down
You can re-start it with the start command:
osgi> start 232
osgi> 2015-09-21 07:34:11.249 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
Not the system, only some parts of it. I do not want my devices in standby
and consum energy. I have devices like sonos, denon AV receiver, tv, that
are not needed when I am not at home so I power them down. Saving energy,
but the bindings are throwing errors if devices are not reachable.
Probably this is what should be addressed then
In openHAB 2, devices that are not reachable definitely won’t log any errors (at least if not being used).
I have the same “problem” as the thread owner. Harmony, Denon and my TV are turned off most of the day. But as Kai already said, the binding should handle this. But is there no workaround with osgi?
So it is not possible to execute a script that calls osgi commands?
This works pretty well
For all who are interested an example below using the network health and exec bindings: if the radio leaves the local network, the radio binding is disabled. if the radio appears in the local network, it is (re)activated. The bindings jar files are removed and added by the exec binding - make sure to adjust the paths!
Items:
Switch presentRadio "Radio [%s]" <network> (gPresence) { nh="radio" }
/*
* this items can be used to enable/disable binding as follows:
* switch on: copy binding jar from runtime/addons-all/ to runtime/addons/
* switch off: delete binding jar from runtime/addons/
* input: this is only needed if the jar files are modified externally, so a very log refresh rate is sufficient (e.g. once every 6 hours: 21.600.000)
*/
Switch binding_radio (gBinding) { exec=">[ON:/bin/sh@@-c@@sudo cp /home/pi/o/runtime/addons-all/org.openhab.binding.frontiersiliconradio-*.jar /home/pi/o/runtime/addons/]
>[OFF:/bin/sh@@-c@@sudo rm /home/pi/o/runtime/addons/org.openhab.binding.frontiersiliconradio-*.jar]
<[/bin/sh@@-c@@sudo test -f /home/pi/o/runtime/addons/org.openhab.binding.frontiersiliconradio-*.jar && echo ON || echo OFF:21000000:]" }
Rules:
rule "radio binding off when radio leaves LAN"
when Item presentRadio changed from ON to OFF then
binding_radio.sendCommand(OFF)
end
rule "radio binding on when radio appears in LAN"
when Item presentRadio changed from OFF to ON then
binding_radio.sendCommand(ON)
end