Anyone who’s been in home automation for a while quickly learns some of the common limitations.
A good example of a common problem is the inability to quickly and temporarily disable motion-activated lights in a user-friendly way (i.e. disable motion lighting when someone manually turns the switch on/off). Before switches with scene capability existed, one of the only ways to solve this would have been to use a complex set of proxy items and logic.
Now that I’ve been using inovelli’s for a while, I’ve adjusted my openHAB rules to use the expire binding and trigger an “automation pause” timer for that room whenever someone pushes a switch manually. In this example, pushing the switch either on or off will create a timer for 1 hour. The lighting rules check if the timer is running or not. If not, proceed with usual automation.
Sample below (pardon the hard to read formatting. this message board strips everything out). This sample is written for openHAB, but the same concept should be applicable to any hub.
expire.items
Switch bathroomLightsDimmerPause { expire=“1h,command=OFF” } //requires expire binding
scenes.rules
rule “Bathroom Light Scenes”
when
Item bathroomLightsScene changed
thenval String bathroomscene = bathroomLightsScene.state.toString
switch bathroomscene {
case “2.0”: //1x tap up
{
bathroomLights.sendCommand(100)
//check existing timer
if(bathroomLightsDimmerPause.state == ON) {
// cancel existing Timer
bathroomLightsDimmerPause.postUpdate(OFF)
}
//Start timer to disable auto lights
bathroomLightsDimmerPause.sendCommand(ON)
}
case “1.0”: //1x tap down
{
bathroomLights.sendCommand(0)
//check existing timer
if(bathroomLightsDimmerPause.state == ON) {
// cancel existing Timer
bathroomLightsDimmerPause.postUpdate(OFF)
}
//Start timer to disable auto lights
bathroomLightsDimmerPause.sendCommand(ON)
}
}
bathroomLightsScene.sendCommand(99) //reset to neutral
endrule “Bathroom Lights ON”
when
Item bathroomMotionSensor changed to OPEN
then
if (bathroomLightsDimmerPause.state!=ON) {
bathroomLights.sendCommand(100)
}
end