So, I got some magnet switches on the doors in the house. Now I want to make a flow that sends a push notification “Door has been open for X minutes” when the door has been opened and not closed for the given time period.
Just setting a delay sends the message whether or not the door has been closed already. Tried looking for an app that can do this, but didn’t really find anything.
Any good ideas?
As you said you need a delay that can be cancelled. There are many apps that can provide that functionality, my personal favorite is Chronograph - Adds precise timer, stopwatch and transition functionality to Homey. In the flow that is triggered by the opening of the door you can start a timer. Another flow needs to be triggered by: a timer has ended, that will send the notification. And a third flow will be needed: if the door closes: stop the timer.
I use App Coundown Timer and have two flows:
Flow No. 1 - flow to start the timer:
WHEN: Aqara door sensor - The contact alarm turned ok
THEN: start / update timer door_open 300 (this will start timer called “door_open” and set it to 300 sec.)
Flow No. 2 - flow do the action when those 300s are over:
WHEN: Countdown timers - Specific timer finished door_open
AND: Aqara door sensor - The contact alarm is on (so that the alarm is not sent if I closed the door in the meantime*)
THEN: Push notifications - Send “Door is open for 5 minutes!” to Frank
*) I could also solve this by adding third flow, that would stop the timer when the door is closed, so that the flow number two would not be executed (timer will never be finished until it is started again). But that would need 3 flows instead of 2
And that will be the only correct way in this case.
Have had 750+ flows running on a 2016 model with no trouble at all.
Scared to have too many flows: just make sure all 750 flows don’t run in the same time and ur good!