Hi Guys
Here in Australia we dont have any contact closure devices that I’m aware of, which makes it hard to control anything other than lights, power IR etc. I have a garage door that that I want to operate and I have managed to write the following luup code that changes the state of the foscam hardware IO output.
[code]
– Operate Garage Door
– loads the HTTP module and any libraries it requires
local http = require(“socket.http”)
– 5 Second timeout
http.TIMEOUT = 5
– Close the contacts
result = http.request(“http://192.168.0.192/decoder_control.cgi?command=94&user=xxxxx&pwd=xxxxxxx”)
– Wait 0.5 Seconds
luup.sleep(500)
– Open the contacts
result = http.request(“http://192.168.0.192/decoder_control.cgi?command=95&user=xxxxxx&pwd=xxxxxx”)[/code]
I want to take advantage of the foscam input to use as a door sensor input. Using the get_params.cgi? in a browser
http://192.168.0.192/get_params.cgi?user=xxxxx&pwd=xxxxxx
returns ALL of the parameters in a list (the one i’m interested in is alarm_ioin_level
I’m unsure of how to get it to return just the alarm io level or handle this with luup code so that I can have the value in a variable cameraIoInput = …
If someone could help me with this that would be great.
It would be nice if the foscam plugin created IO devices for the hardware Input and Output similar to the ones it creates for Motion Sensor. Looking at the new foscam cameras though they dont seem to have hardware IO which is such a great added feature.