This object is in archive! 
Create a rule - door is left open
Need Answer
How do I create a rule, if a door is left open (between 10: 00-15: 00) and I want to get the alarm to close it. have a Nexa - magnetic sensor.
No connection
Real-time notifications may not work
Forgot to write that I just want to get an alarm if the door is open for more than 15 minutes between these times ...
Forgot to write that I just want to get an alarm if the door is open for more than 15 minutes between these times ...
Try this one, and feel free to ask if you have any questions.
You obviously need to change the sensors and alarm with your devices.
Try this one, and feel free to ask if you have any questions.
You obviously need to change the sensors and alarm with your devices.
Thanks
Thanks
Is it working? :)
Is it working? :)
With the example I provide (similar to Marijan) you will be able to get a notification if you OPEN the door between this time frame and left it open for more than 15 seconds. My rule and the other example won't work if you open this door one minute before 10:00 and leave the door open for whatever time. If you need this functionality too, another (more complex) aproach needs to be taken, let me know if you need this and I can provide an example of how I think you could solve this.
With the example I provide (similar to Marijan) you will be able to get a notification if you OPEN the door between this time frame and left it open for more than 15 seconds. My rule and the other example won't work if you open this door one minute before 10:00 and leave the door open for whatever time. If you need this functionality too, another (more complex) aproach needs to be taken, let me know if you need this and I can provide an example of how I think you could solve this.
You could also use a loop that iterates 90 times with a 10 seconds wait in it. This way, you could stop the rule I If the door is being closed within the 15 minutes time span.
DO 90 times
Refresh-all
If door.closed
Stop
End if
Wait 10 secs
End loop
Siren.playSound
EDIT: Sorry, the formatting of the pseudo code disappeared after posting
This would ensure that the alarm will only sound if the door is actually _left open_, not just coincidently open again after 15 minutes.
You could also use a loop that iterates 90 times with a 10 seconds wait in it. This way, you could stop the rule I If the door is being closed within the 15 minutes time span.
DO 90 times
Refresh-all
If door.closed
Stop
End if
Wait 10 secs
End loop
Siren.playSound
EDIT: Sorry, the formatting of the pseudo code disappeared after posting
This would ensure that the alarm will only sound if the door is actually _left open_, not just coincidently open again after 15 minutes.
Marius, the solution I posted accounts for your last thought - hence the JOIN command.
And the ELSE clause triggers on ANY changes on the door controller, so as soon as you close the door, the ELSE clause triggers, and the timer/siren stops.
Marius, the solution I posted accounts for your last thought - hence the JOIN command.
And the ELSE clause triggers on ANY changes on the door controller, so as soon as you close the door, the ELSE clause triggers, and the timer/siren stops.
The solution I was thinking is using a minutely blinker (using scheduler and virtual switch or sensor) to inspect the state of the door, if it's open and within the time frame then WAIT and ACTION. For this you need at least two rules.
The solution I was thinking is using a minutely blinker (using scheduler and virtual switch or sensor) to inspect the state of the door, if it's open and within the time frame then WAIT and ACTION. For this you need at least two rules.
Thanks.
Thanks.
try this, let me know if it works for you
try this, let me know if it works for you
Replies have been locked on this page!