Trigger a flow if an action is repeated multiple times with in a set period of time

Hi all,

I'm using Node Red with my Home Assistant and have a question I haven't been able to figure out. I want to change the profile of my Blue Iris NVR when motion is detected on a camera or cameras multiple times with in a set period of time.

I have the camera motions in Home Assistant and know how to get their states in Node Red, but I don't know to only trigger the next action (changing the Blue Iris Profile) if the state changes several times with in two minutes.

Any help would be much appreciated.

Thanks!

Here is a low code example if true is received 3 or more times within 120 seconds the message is passed

[{"id":"9e8b475e121dbc44","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":1220,"wires":[["273f7fa9926adcd2"]]},{"id":"273f7fa9926adcd2","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"120","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":1220,"wires":[["f3112e493a231754"]]},{"id":"f3112e493a231754","type":"switch","z":"b9860b4b9de8c8da","name":"","property":"$count($$.payload)","propertyType":"jsonata","rules":[{"t":"gte","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":1220,"wires":[["315ace8e8c6cecae"]]},{"id":"315ace8e8c6cecae","type":"debug","z":"b9860b4b9de8c8da","name":"debug 288","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":1220,"wires":[]}]

How to import a flow

1 Like

Thank you, this is exactly what I was looking for!!!

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