Hi,
I have a problem with an “alarm rule”
This is what I want to do.
When my dummy switch “Alarm_state” is ON and the door is opened :
if nobody set the alarm inactive within 10 seconds, then send a pushbullet.
this is my rule :
rule “Alarm”
when
Channel ‘XiaomiDoorWindowSensor_OpenStatus’ triggered OPEN
then
if (Alarm_State.State == ON)
{
Thread::sleep(10000) /* wait for 10 seconds */
if (Alarm_State.State == ON){
sendPushbulletNote("Alarm", "Door Opened")}
}
end
But… althoug my switch is set “ON”, nothing happen when I open the door.
Can you please tell me what is wrong with my rule ?
You don’t want to use a Thread::sleep for ore than half a second, it’s a bad idea
rule “Alarm”
when
Item XiaomiDoorWindowSensor_OpenStatus changed to OPEN
then
if (Alarm_State.State == ON) {
createTimer(now.plusSeconds(10), [ | //* wait for 10 seconds */
if (Alarm_State.State == ON) sendPushbulletNote("Alarm", "Door Opened")
])
}
end