I know this may sound very easy but this is my first time programming with lua.
Scenario:
I have a tilt sensor on my garage door. The device ID for the tilt sensor is #6
Device Type: urn:schemas-micasaverde-com:device:MotionSensor:1
I have a scene called “Open/Close Garage Door” - scene #4
As of now, I can open and close the garage door and see its status, but I want to create a new scene that will CLOSE the garage door IF it is open.
I have tried a lot of different code with no luck. Here is the code I am currently working with.
if( luup.variable_get(“urn:upnp-org:serviceId:MotionSensor:1”,“Tripped”,6)==“1” ) then
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”, “RunScene”, {SceneNum = “4”}, 0)
return true
end
Any help would be GREATLY appreciated!!!