First of all I am 100% begginer on the openhab world. Installed OH2 before 3 days on a Raspberry Pi and yesterday I managed to enable two Aqara Wall Switches on my Google Home app. So I am totally new and I have no experience on scripts.
I installed on paperUI the Script add-on and I am trying to figure out how I will make the scenario below:
A switch which will trigger the “Alarm” scenario (ON/OFF)
Motion sensor to trigger the Gateway sound “alarm”
Gateway “alarm” (or motion sensor in this case) will trigger all lights in my house
From those three above the hardest part for me is the first. Can I create a switch like this and how I can do that?
rule "Auto ON Garage Motion Detection after One Hour when Garage is Open"
when
Item Proxy_Motion changed from ON to OFF
then
if(startMotionTimer === null && Proxy_Motion.state == OFF){
Echo_Plus_TTS.sendCommand('The garage motion suspended for one hour')
startMotionTimer = createTimer(now.plusMinutes(60)) [|
Proxy_Motion.sendCommand(ON)
Echo_Plus_TTS.sendCommand('Garage motion is now on')
startMotionTimer = null
]
}
end
I use the rule to turn off the Alexa motion notification (for 1 hour) when I’m planning to be moving around in the garage and don’t want the constant message.
FYI, I could also use the expire binding with the proxy switch and not have the timer in the rule.