Need help to use AND in a scene

Hi

I want at scene only to run af the motionsensor is tripped AND a virtual switch is turned on.

Help please Vera3 UI5

Thanks

This has been answered a few times this past week. A search should yield you some results.

Create a scene that has the motion sensor as a trigger. The trigger for the motion sensor would be “A sensor is tripped” and select the motion sensor device as well as “Device is tripped” as the trigger value. In the luup tab add the following:

[code]
virtualSwitch = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,88)

if(virtualSwitch == “1”)then
return true
else
return false
end[/code]

Where 88 is the device of the virtual switch.

  • Garrett