I have an Aqara Zigbee door sensor on a storage closet under the stairs that turns the light on upon opening the door. It also turns the light off when the door is closed. However, I would like to have the light turn off if the door is left open, after 7 minutes.
Can I do this within the same flow or should this be handled separately? Not sure exactly how to connect the duration to an off card.
On the surface this will work, except for one caveat. In the scenario that you open the door, close it, and 6 mins later you open the door again, in this setup I am not sure what the delay of the first trigger does. Might be it sends the off signal within the minute, and again after 7 mins.
Using that you can start the timer when the door opens, and cancel it when you close the door. That way you are sure you won’t be surprised by inexplicable events caused by hidden delays.
With hidden delays I mean that in normal Homey delay operation you cannot see that an action is pending. With the above app you can see any running timers in the app configuration page, so you can see what is going on and debugging is way easier.
In that case you should be fine. If you ever find yourself in a situation with more complex needs: the app also supports things like resetting timers, less than second timers, checking if timers are running, starting a new timer if there isn’t one and keeping it as it if its already running, changing a value gradually over time, measuring time and much more.
@Edwin_D, you’re absolutely right. The delay doesn’t stopp. So in this example the light turns off after 1 Minute, if the door is opened the second time after 6 min (within in the delay time) again.
Don’t know if this behavior depends on the used app, but I guess not. I used the Fibaro app resp. Fibaro devices.
One way the flows might look:
Flow 1 (Open door)
– The contact alarm has been activated
– Turn on light
– Start Timer “Storeroom” with a duration of 7 min
Flow 2 (Close door)
– The contact alarm has gone off
– Turn off light
– Stop Timer “Storeroom”
There is a thread category called Tutorials with some interesting flows. Also you can search for „DIY“, „Tutorial“ and „How to“, because not all tutorials are in this category.
But there are a lot of more interesting tutorials in the „Flows“ category, for example from @Justin.