Extend a trigger without triggering it

In the bedroom I have two presence sensors: PIR and Audio. Both are wired directly into a Trigger node used in "wait for" and "extend delay" mode. The lights turn on if there is movement or noise, and they stay on for a period of time after those things have ceased.

How can I make the lights turn on ONLY when there is movement, but have the trigger extend when there is noise (and movement)?

I guess this is not possible with the Trigger node, as the only inputs are delay and reset, there is no extend.

Is there an elegant solution, perhaps using another node?

Have you tried enabling the "extend delay if new message arrives"?

image

AZtKOSzJBz

I'm pretty sure that satisifies your question "Extend a trigger without triggering it"

Hi Steve, that's how I have it set up already. Problem with that is the audio would also turn on the light in the first place, I don't want it to - I just want it to extend the time the light is turned on.

i.e.
PIR -> trigger AND extend
Audio -> extend only

Ah. I see. That was a little unclear (to me). Ok so add a memory flag...

Demo flow...

[{"id":"a2749959.e0c2a8","type":"trigger","z":"a86654ec.266648","name":"","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"3","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":876,"y":736,"wires":[["9fcad2c0.f7ee"]]},{"id":"f29ce16c.80426","type":"inject","z":"a86654ec.266648","name":"PIR","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":690,"y":704,"wires":[["a2749959.e0c2a8"]]},{"id":"c422f53d.f4a8c8","type":"inject","z":"a86654ec.266648","name":"AUDIO","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":530,"y":752,"wires":[["d00ff19c.5ee9d"]]},{"id":"7a62d5fe.7e521c","type":"debug","z":"a86654ec.266648","name":"Light","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1218,"y":736,"wires":[]},{"id":"9fcad2c0.f7ee","type":"change","z":"a86654ec.266648","name":"","rules":[{"t":"set","p":"light1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1056,"y":736,"wires":[["7a62d5fe.7e521c"]]},{"id":"d00ff19c.5ee9d","type":"switch","z":"a86654ec.266648","name":"is light1 on?","property":"light1","propertyType":"flow","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":694,"y":752,"wires":[["a2749959.e0c2a8"]]}]

Perfect, that works really well! After you posted that I thought another idea would be to take the output from the trigger node, feed it into a gate node, feed in the audio input to the gate node, and feed the output back in to the trigger node. Although I prefer the simplicity of your version.

1 Like

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