Wait or delay flow from running again before retriggering TTS

I have a motion sensor I’m looking to put in a mailbox to alert me when the mailbox is opened.

A have a simple flow that generally gets me what I’m looking for, however it would be nice if I could delay the TTS from being triggered again for lets say 5 minutes. I’m having trouble understanding how I can get this to work.

What I’m thinking is a true / false value if the value was triggered in the last 5 minutes than it sets it to true, and eventually resets setting the value to false. Help?

[{"id":"96d03ea5.7f21","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"aa18835e.516b2","type":"server-state-changed","z":"96d03ea5.7f21","name":"Motion ","server":"2e31528c.f3973e","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zooz_zse29_outdoor_motion_sensor_burglar_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":270,"y":280,"wires":[["acdc6720.7cacb8"]]},{"id":"acdc6720.7cacb8","type":"switch","z":"96d03ea5.7f21","name":"motion on/off?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"neq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":280,"wires":[["b9367579.4bb538"],[]]},{"id":"b9367579.4bb538","type":"api-call-service","z":"96d03ea5.7f21","name":"tts","server":"2e31528c.f3973e","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.office_speaker","data":"{\"message\":\"The mailbox has been opened\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":770,"y":220,"wires":[[]]},{"id":"2e31528c.f3973e","type":"server","z":"","name":"Home Assistant"}]

TRIGGER Node. This is a super useful node people need to discover in NodeRed. Basically fairly self explanatory but look up the Rob from The Hookup he’s got some vids that go over it. It does exactly what you are talking about.

Thanks for the tip. I ended up doing a little bit more searching and found the delay node.

In the delay node you can set an action called “rate limit”.

After selecting rate limit, I then set it to drop intermediate messages. This stopped it from telling me that it has been opened multiple times.

Here you can find a tts node with advanced features

  • caching notification audio message
  • restoring device inital volume after having played the notification
  • queueing notifications messages
  • important flag for notifications to be playing immediatly

https://flows.nodered.org/node/node-red-google-notify