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)
When…
– The contact alarm has been activated
Then…
– Turn on light
– Start Timer “Storeroom” with a duration of 7 min
Flow 2 (Close door)
When…
– The contact alarm has gone off
Then…
– Turn off light
– Stop Timer “Storeroom”
@jpcams, for this scenario you need a timer app. There are several apps in the app store, so it’s your choice. I use the Chronograph app, as Edwin already suggested.
That was it exactly! Thanks for helping me out. Now I will think about other things that I can connect with a timer.
Is there a topic already started where people talk about flows they use, especially flows more complex? I would be curious how I can strengthen my existing setup.
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.
I did it with two flows using the timer app.
First flow: Door open, start timer for xx seconds (timer will switch on the light and switch it off after xx seconds/minutes/hours)
Second flow: Door close, cancel timer and switch off light