rule "Garasjedorr"
when
Item Garasje changed to ON or
Item Garasjedor changed to ON or
Item VoiceCommand received command "garasje"
then
sendCommand(Garasje, ON)
postUpdate (Garasjedor, OFF)
sendCommand(Garasje, OFF)
sendHttpPostRequest ('http://192.168.2.242:2015/cgi-bin/CGIproxy.fcgi?cmd=ptzGotoPresetPoint&name=2&usr=Admin&pwd=XXXX
')
Thread::sleep(20000)
sendHttpPostRequest ('http://192.168.2.242:2015/cgi-bin/CGIproxy.fcgi?cmd=ptzGotoPresetPoint&name=1&usr=Admin&pwd=XXXX
')
end