I’ve put a plugin onto apps.mios.com that should remove the need for Luup programming for a whole range of common scenarios.
The Combination Switch looks like a binary light. Instead of you turning it on and off manually, the plugin watches the state of other devices on Vera. You set conditions (“This dimmer is between 10% and 70%”, “That light is off”), and a threshold number. The plugin counts how many conditions are true, and when the count equals or exceeds the threshold, the Combination Switch turns on. When the count goes below the threshold, the Combination Switch turns off.
If you set the threshold to 1, you have the equivalent to a Boolean OR. If you set the threshold to the number of conditions, you have the equivalent to a Boolean AND. You can also use thresholds in between to get a kind of consensus sensing.
The Combination Switch fires events when the threshold is met and when it is lost. You can use these in notifications or you can use them as triggers for other scenes.
More in the following posts.