In a defined time 2 payloads to pass

Hi guys how could I make a node that only pass data when in 3 seconds 2 times something comes in.

I have an remote and on that I have an main switch for the entire apartment. And with that node I wanne avoid to press it accidentally. I just wanne press it 2 times and then it should activate.

Thx in Advance

Many options to do this... One would be to use a trigger node and the trafic light:

[{"id":"5ba9f88.9c32408","type":"trigger","z":"4b860295.c5a50c","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":2320,"wires":[["f13d1f61.f5fd3"]]},{"id":"f13d1f61.f5fd3","type":"traffic","z":"4b860295.c5a50c","name":"Trafic","property_allow":"payload","filter_allow":"on","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"off","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":750,"y":2360,"wires":[["85c12147.1443d"]]},{"id":"f34afbbf.8c0288","type":"inject","z":"4b860295.c5a50c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":2360,"wires":[["5ba9f88.9c32408","f13d1f61.f5fd3"]]},{"id":"85c12147.1443d","type":"debug","z":"4b860295.c5a50c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":2360,"wires":[]}]

The first message put the trafic light to green and arm the trigger.
If a second message is received within three seconds the trafic light being green it goes through. The trigger put it back to red after 3 seconds.
GV

1 Like

Thx a lot for this!

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