# Need help with to creat a flow checking a saf condition for 5 minutes

**URL:** <https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544>\
**Category:** General\
**Created:** [12 January 2022 17:02 UTC](https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544 "2022-01-12T17:02:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [12 January 2022 17:02 UTC](https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544/1 "2022-01-12T17:02:47Z")

</div>

Hoi iam stuk and i have no idea how to solve that.

I have node which report safe or no safe as 1 or 0. every 15 seconds

by safe

1. the flow most validate the out com of this node if it is safe every 15 seconds for 5 minutes the pay load is X otherwise it is Y  
2 if in that period of 5 minutes a unsafe is report. the payload is Y and we start at 1 again we start measuring time again by the first safe

I hoop you have some ideas for me

Chrs

it must wait to the first safe and the 5 minutes the 5 minutes for save start from that point

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 January 2022 17:42 UTC](https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544/2 "2022-01-12T17:42:11Z")

</div>

If I understand you correctly try something like this

```auto
[{"id":"3632a93e.af1496","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":150,"y":740,"wires":[["e759132a.fac86"]]},{"id":"e759132a.fac86","type":"switch","z":"c791cbc0.84f648","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":280,"y":780,"wires":[["fc24f89f.bd8ff8"],["f26706b2.dbef28","fc24f89f.bd8ff8"]]},{"id":"fc24f89f.bd8ff8","type":"trigger","z":"c791cbc0.84f648","name":"","op1":"","op2":"x","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":470,"y":780,"wires":[["02f1fafdc71e278d"]]},{"id":"75495fca.b5a0a","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":150,"y":800,"wires":[["e759132a.fac86"]]},{"id":"f26706b2.dbef28","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"y","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":820,"wires":[["02f1fafdc71e278d"]]},{"id":"02f1fafdc71e278d","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":710,"y":780,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [14 January 2022 12:39 UTC](https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544/3 "2022-01-14T12:39:08Z")

</div>

Hoi E1cid

That was quick response, i did having my diner after posting the message ☹  
I look in it I think it does the job. to be clear when the time is done is pass the regular payload through the flow until the state change right. I will add it in my flow, Thanks an special for that quick response

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 January 2022 12:39 UTC](https://discourse.nodered.org/t/need-help-with-to-creat-a-flow-checking-a-saf-condition-for-5-minutes/56544/4 "2022-01-28T12:39:58Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
