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

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

If I understand you correctly try something like this

[{"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":[]}]
1 Like

Hoi E1cid

That was quick response, i did having my diner after posting the message :frowning:
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

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