Prevent spamming messages from motion sensor

#1

I have MQTT outside motion sensor that trigger speech to all Google Cast devices, this works great but I would like to limit the triggers or messages. It's enought to have a message once and if no motions are triggered for ex 5 minutes it should be ready to speak one more time. Now it's spamming the messaging. The motion sensor is sending out motion every time motion is detected. No nomotion info. How can I make a time window for this?

[{"id":"d7eeb951.2edec8","type":"mqtt in","z":"92b352fc.7379e","name":"Skybell","topic":"tasker/skybell/","qos":"1","broker":"c6786f97.11082","x":210,"y":400,"wires":[["a453e3c2.7802"]]},{"id":"a453e3c2.7802","type":"switch","z":"92b352fc.7379e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Motion has been detected.","vt":"str"},{"t":"cont","v":"You have a visitor at your door.","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":400,"wires":[["7367ca02.41eaf4"],[]]},{"id":"7367ca02.41eaf4","type":"function","z":"92b352fc.7379e","name":"Motion","func":"msg.payload =  {\n    data: {\n        message: \"Rörelse utanför ytterdörren\",\n    }\n}\nreturn msg;\n","outputs":1,"noerr":0,"x":570,"y":380,"wires":[["3739a9c0.e49d56"]]},{"id":"3739a9c0.e49d56","type":"api-call-service","z":"92b352fc.7379e","name":"Google Home Alarm Speaker Group","server":"8d4eab27.d56528","service_domain":"tts","service":"google_say","data":"{\"entity_id\":\"media_player.alarm\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":850,"y":380,"wires":[[]]},{"id":"c6786f97.11082","type":"mqtt-broker","z":"","name":"","broker":"192.168.2.10","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"8d4eab27.d56528","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open"}]
0 Likes

#2

look at the trigger node (set to extend if more inputs arrive)

0 Likes

#3

Thanks, solved it.

0 Likes