I got a webcam in my garage, where I have made an item to control its position, so I can rotate it.
When I split the rule up into more individual rules for each position value, it works fine, but when trying to make it a bit more compact, it stops working again. Can anyone see my error?
rule "Garage cam position"
when
Item GarageCamPosition received command
then
sendHttpGetRequest("http://openhab:password@ip/decoder_control.cgi?command=" + receivedCommand.toString)
end
It might even be a better solution, but still, I would like to know what I did wrong the first time, so will wait a bit to add solved to the title. I will no doubt run into another scenario where the switch case would be handy to use.
Disclaimer: I use JSR223/Jython rules so I may be way off here, but here is a wild guess…
The GarageCamPosition is a String item, but the switch statement cases are looking for integers. In the working rule, you are using the command as a string so it’s not a problem.
I followed the post, but the camera (foscam) does not take command
in the rule I entered so:
sendHttpGetRequest (“http: //ipaddress: portnumber / decoder_control.cgi? command = 39”)
while directly from the browser it works
some idea?
thank you
David