Search

Wednesday, February 1, 2012

Overide the scheduler. The master Virtual SWITCH

I have tried for a long time and asked several forum questions how to make a scene that will overide other scenes. Now in UI5 (and this is also possible in UI4) there is a virtual switch that you can use for this purpose. Let say that you don't want your alarm to go on when youre home or to go off during the schedule when youre traveling then the virtual switch is perfect.

Install the Virtual ON/OFF Switches to you Vera
You could also use this plugin:
http://apps.mios.com/plugin.php?id=1408




And then add this luup code in your scene that you like to be checking if the switch is on / off:


Code: [Select]
run = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",DeviceID)
if(run=="1")then
return true
else
return false
end

You have to replace "DeviceID" with the ID of your Virtual Switch.

So once the scene is triggered, this code will stop the scene if the virtual button is off. If the virtual switch is on the scene will run.

To add aditional switches in UI5 see this forum therad
http://forum.micasaverde.com/index.php/topic,9219.msg60722.html#msg60722