I’m using OH2 on a RaspberrPi. I have configured a switch in OH2 through which I can toggle my patio light. This works just fine. The light icon changes from yellow to gray anytime the light goes from on to off, and vice versa, perfect. Now, I also have a python script, controlled by a light sensor and it turns the light on at dusk, but the when this happens, the state of the switch in OH2 (PaperUI oriOS) does not reflect the new state. Specifically, I’d like the like icon and the switch’s slider to reflect the state of the patio light. How can I make this happen, if at all? Here are my configs:
I have a Thing configured in OH2 as:
Patio_Light_Status -> exec:command:e3c40992:exit
It runs a script that checks the state of the light every 5 seconds and its exit value is a Number (0/1). There is a log statement within the script that logs to the system console and I see that it is running and exiting with the exit status, but the state of the Patio_Switch never changes in PaperUI or the iOS app. I have tried using various combinations of mappings, e.g mappings=[On=1] in my items file to no avail. Can I make this work? If so, how?
I found this example in another script:
’/usr/share/openhab2/runtime/bin/client send frontdoorTriggered ON’
I’m going to try this when I get home this evening. I have a rule which gets executed when I tried the switch through OH2. The script currently communicates directly with the switch via BT and I’ve been trying to get the OH2 interface to update when the switch is triggered. I the commanline above provides the best way to accomplish this task.
I find that this command /usr/share/openhab2/runtime/bin/client requires authentication. This is a problem as this command needs to be executed from a script. Sort of defeats the purpose of home automation. I can’t find any documentation on how to setup a user to automatically login. I did find a post that said this authentication was removed for the GA release. I installed my OH2 from Bintray. I have version 2.0.0 Release Build as reported via the console. What is the mechanism for upgrading, if thats necessary to fix this issue?