# Help with a flow

**URL:** <https://community.homey.app/t/help-with-a-flow/32886>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [July 27, 2020, 7:03pm UTC](https://community.homey.app/t/help-with-a-flow/32886 "2020-07-27T19:03:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Nunes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricardo_nunes/32/30598_2.png) [@Ricardo\_Nunes](https://community.homey.app/u/Ricardo_Nunes)\
**Post date:** [July 27, 2020, 7:03pm UTC](https://community.homey.app/t/help-with-a-flow/32886/1 "2020-07-27T19:03:20Z")

</div>

Hi.  
I need help to create a flow.  
I’m a new user on homey and I’ve been creating my flows, unfortunately my knowledge is not that much on this kind of thing i’m a begginer.  
I would like to receive a notification (as an example) when the door contact is active for over a minute.  
I’ve a door sensor placed on a door, and i get a notification from a flow I’ve already created if the door opens, but I would like to be able to receive another notification or to play a sound on a speaker (just examples) after a certain time? Is this a easy thing to do?  
Cause I can’t find a way 😅  
Thank you soo much.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Nunes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricardo_nunes/32/30598_2.png) [@Ricardo\_Nunes](https://community.homey.app/u/Ricardo_Nunes)\
**Post date:** [July 27, 2020, 7:58pm UTC](https://community.homey.app/t/help-with-a-flow/32886/3 "2020-07-27T19:58:50Z")

</div>

Yes, but if i have a motion sensor on the same zone, that will not work.  
I need that specific device ( door sensor) to trigger the flow but only after a certain time.  
Like “when” door alarm on “and” 60 seconds past with that device on “then” send me push notification.  
Something like that just don’t know how to do the “and” part.

---

<div class="post-metadata">

**Author:** ![Shakesbeard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/shakesbeard/32/15112_2.png) [@Shakesbeard](https://community.homey.app/u/Shakesbeard)\
**Post date:** [July 27, 2020, 8:03pm UTC](https://community.homey.app/t/help-with-a-flow/32886/4 "2020-07-27T20:03:22Z")

</div>

Then you might want to look into Countdown or Timer apps. There are a few on the app store. Then you could basically start a countdown time with 60 seconds when the sensor becomes active. Cancel the countdown if the sensor becomes inactive. And finally do something if the time hits 0.

---

<div class="post-metadata">

**Author:** ![Tolga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tolga/32/12563_2.png) [@Tolga](https://community.homey.app/u/Tolga)\
**Post date:** [July 27, 2020, 8:04pm UTC](https://community.homey.app/t/help-with-a-flow/32886/5 "2020-07-27T20:04:02Z")

</div>

Use the countdown app. You need 2 flows. First flow, when door sensor is opened start countdowntimer xxxmin. Second flow, when countdown timer reached 0 and door is opened send push or etc. And cancel countdowntimer when door is closed

---

<div class="post-metadata">

**Author:** ![Tolga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tolga/32/12563_2.png) [@Tolga](https://community.homey.app/u/Tolga)\
**Post date:** [July 27, 2020, 8:04pm UTC](https://community.homey.app/t/help-with-a-flow/32886/6 "2020-07-27T20:04:25Z")

</div>

@Shakesbeard is faster 😀

---

<div class="post-metadata">

**Author:** ![Ricardo\_Nunes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricardo_nunes/32/30598_2.png) [@Ricardo\_Nunes](https://community.homey.app/u/Ricardo_Nunes)\
**Post date:** [July 27, 2020, 8:56pm UTC](https://community.homey.app/t/help-with-a-flow/32886/8 "2020-07-27T20:56:15Z")

</div>

I’ll try it, thank you!  
@RoyWissenburg @Shakesbeard @Tolga

---

<div class="post-metadata">

**Author:** ![RUTHINAS](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ruthinas/32/27846_2.png) [@RUTHINAS](https://community.homey.app/u/RUTHINAS)\
**Post date:** [July 29, 2020, 11:52am UTC](https://community.homey.app/t/help-with-a-flow/32886/9 "2020-07-29T11:52:43Z")

</div>

I had some trouble getting all the functionality I needed from just CountDownTimer or Chronograph, so instead I used BetterLogic to create a value that increments each second, and which could be pulled into the log:

Flow number 1:  
WHEN door sensor state changes  
IF door sensor is open  
THEN enable flow number 2  
AND set BetterLogic value door\_timer to 0  
ELSE disable flow number 2

This will fit into one flow both the enabling and disabling of functionality: when the door opens, flow 2 is enabled and the BetterLogic “timer” is set to zero; when it closes, flow 2 is disabled

Flow number 2:  
WHEN every 1 second  
THEN increment BetterLogic value door\_timer by 1

This creates a basic timer that measures seconds and stores the value in BetterLogic, from where it can be pulled into log entries

Flow number 3:  
WHEN BetterLogic value door\_timer is equal to 60  
THEN print to log “Door open for \<door\_timer\>”

Optionally, you can also create a logging flow to measure how long the door remained open:

Flow number 4:  
WHEN door sensor state is changed to closed  
THEN print to log “Door closed after \<door\_timer\>”

The THEN function of the above flow can also be merged into flow 1 as an ELSE function, as flow 1 already checks for door sensor state changes.

The value for door\_timer persists until the door is reopened, so it can be used by subsequent flows for whatever purpose deemed necessary, or it could be reset to zero as part of the THEN portion of flow 4 (with a 1 second delay so that the log entry will not print as 0). It would also make sense to create a log entry for opening the door, and perhaps grouping them together into a log group for legibility.

Building further functionality on top of this system is relatively simple, because BetterLogic values can be used as WHEN triggers, for IF comparisons and manipulated by THEN events.

Enjoy your time tinkering with Homey!

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [July 29, 2020, 12:55pm UTC](https://community.homey.app/t/help-with-a-flow/32886/10 "2020-07-29T12:55:05Z")

</div>

You don’t need timers. Just two flows will work fine  
First you need to create this flow. If you execute this flow, it will play a sound if the door is open:

 ![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/b/4b1f5798be181a099dc2c4d90bcf1886aa708608.png)  
And you activate this flow with this flow:  
 ![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/f/1fef040071eb8006a6759c3428290e3646fc8e03.png)  
It gets activated when a door is opened. And after a delay of 60sec it starts the first flow. If the door is still open it plays the sound. Otherwise not.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Nunes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricardo_nunes/32/30598_2.png) [@Ricardo\_Nunes](https://community.homey.app/u/Ricardo_Nunes)\
**Post date:** [July 29, 2020, 3:34pm UTC](https://community.homey.app/t/help-with-a-flow/32886/11 "2020-07-29T15:34:33Z")

</div>

I’ve been able to reach what i needed with cowntown, still it’s good to know other options and to get more knowledge about the capacities of homey, I’ll give it a try to your solution and even use it with other needs of mine.  
Thank you 👌
