Hello all,
I'm trying to create a virtual device that holds the on/off state based on if *any* of the predefined lights are on or off.
For example, I will have a virtual device called: vUPSTAIRS_LIGHTS with simple on/off value.
IF any of the lights upstairs are turned on, then this virtual device value will change to ON.
IF all of the lights upstairs are off, then this virtual device value will change to OFF.
I have managed to get an event working with lots of OR IF/AND IF statements, but thought this could best be managed long-term (as device ID's are added/removed) via a script.
Can someone give me an idea of how to accomplish this via scripting? I can figure out the vb logic, but I'm most confused by the actual trigger that executes the script.
thank you,
Marco
I'm trying to create a virtual device that holds the on/off state based on if *any* of the predefined lights are on or off.
For example, I will have a virtual device called: vUPSTAIRS_LIGHTS with simple on/off value.
IF any of the lights upstairs are turned on, then this virtual device value will change to ON.
IF all of the lights upstairs are off, then this virtual device value will change to OFF.
I have managed to get an event working with lots of OR IF/AND IF statements, but thought this could best be managed long-term (as device ID's are added/removed) via a script.
Can someone give me an idea of how to accomplish this via scripting? I can figure out the vb logic, but I'm most confused by the actual trigger that executes the script.
thank you,
Marco
Comment