How to repeat a TTS message over Google Home until turned oof

The alert seems like a good way to do this, but it requires a notify component. I don’t think TTS is a notify component, or am I wrong?

The input_boolean may work, but I feel like it might tax the system. I want this message to repeat every two seconds. If I’m understanding this correctly, I would make an automation that triggers every two seconds and if the condition is met that the input_boolean is on it fires the TTS, correct? If that’s the case, won’t it tax my system and fill my logs to have an automation trigger checked every two seconds?

yes, it might. I thought were talking about a TTS every minute or so, but this sounds more like a sound you want played repeatedly back to back

Every two seconds is very frequent. Will you be able to say the message in two seconds?

Yeah, it would take about 2 seconds to say it. I basically want it to go “FRONT DOOR IS OPEN” - 2 second delay - “FRONT DOOR IS OPEN” - 2 second delay - “FRONT DOOR IS OPEN”… repeat.

Wow… That would piss my wife off to no end and she would kill me. I understand the importance of urgency, but that might be a little overboard. LOL

It wont do it whenever the door is open, it only runs when the alarm triggers. It supplements the siren to tell me where the potential intruder broke in at. It wont do any good to have it tell me every 30 seconds. It’s info I would need to know immediately if there was an intruder in my house. It could also help scare off an intruder if they know that I know where they are.

easier with node red

I haven’t used node red, but that seems like it wouldn’t work for my application. It looks like the loop would stop once the door is closed. If someone broke in then closed the door the TTS would stop.

can you share as json? thanks

[{“id”:“ab327849.b4f5d8”,“type”:“server-state-changed”,“z”:“c631c70f.d4b328”,“name”:“Back Door Open”,“server”:“94ba947a.815568”,“entityidfilter”:“binary_sensor.back_door”,“entityidfiltertype”:“substring”,“haltifstate”:“off”,“outputinitially”:false,“x”:100,“y”:560,“wires”:[[“f5f272b.8637f9”]]},{“id”:“b8bb5e95.5c0b9”,“type”:“api-current-state”,“z”:“c631c70f.d4b328”,“name”:“Still Open”,“server”:“94ba947a.815568”,“halt_if”:“off”,“override_topic”:false,“override_payload”:false,“override_data”:false,“entity_id”:“binary_sensor.back_door”,“x”:540,“y”:560,“wires”:[[“6ab5b059.bbd59”,“2acafbaf.f12574”,“8140c08.2bd804”,“878b71c2.f16a9”,“b37eb51f.c7f728”]]},{“id”:“f5f272b.8637f9”,“type”:“stoptimer”,“z”:“c631c70f.d4b328”,“duration”:“1”,“units”:“Minute”,“payloadtype”:“str”,“payloadval”:“off”,“name”:"",“x”:320,“y”:560,“wires”:[[“b8bb5e95.5c0b9”],[]]},{“id”:“6ab5b059.bbd59”,“type”:“api-call-service”,“z”:“c631c70f.d4b328”,“name”:“echo_show”,“server”:“94ba947a.815568”,“service_domain”:“media_player”,“service”:“alexa_tts”,“data”:"{ “entity_id”: “media_player.echo_show”, “message”: “Can someone please close the back door?” }",“mergecontext”:"",“x”:850,“y”:540,“wires”:[[]]},{“id”:“8140c08.2bd804”,“type”:“api-call-service”,“z”:“c631c70f.d4b328”,“name”:“echo_son”,“server”:“94ba947a.815568”,“service_domain”:“media_player”,“service”:“alexa_tts”,“data”:"{ “entity_id”: “media_player.echo_son”, “message”: “Can someone please close the back door?” }",“mergecontext”:"",“x”:840,“y”:600,“wires”:[[]]},{“id”:“878b71c2.f16a9”,“type”:“api-call-service”,“z”:“c631c70f.d4b328”,“name”:“echo_dad”,“server”:“94ba947a.815568”,“service_domain”:“media_player”,“service”:“alexa_tts”,“data”:"{ “entity_id”: “media_player.echo_dad”, “message”: “Can someone please close the back door?” }",“mergecontext”:"",“x”:840,“y”:660,“wires”:[[]]},{“id”:“2acafbaf.f12574”,“type”:“delay”,“z”:“c631c70f.d4b328”,“name”:"",“pauseType”:“delay”,“timeout”:“15”,“timeoutUnits”:“seconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“x”:540,“y”:660,“wires”:[[“b8bb5e95.5c0b9”]]},{“id”:“1e7f55f7.69496a”,“type”:“api-call-service”,“z”:“c631c70f.d4b328”,“name”:“Send to Android”,“server”:“94ba947a.815568”,“service_domain”:“notify”,“service”:“android”,“data”:"{ “message”: “Basement window is still open after 5 minutes” }",“mergecontext”:"",“x”:860,“y”:480,“wires”:[[]]},{“id”:“b37eb51f.c7f728”,“type”:“delay”,“z”:“c631c70f.d4b328”,“name”:"",“pauseType”:“delay”,“timeout”:“5”,“timeoutUnits”:“minutes”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“x”:540,“y”:480,“wires”:[[“b8bb5e95.5c0b9”,“1e7f55f7.69496a”]]},{“id”:“94ba947a.815568”,“type”:“server”,“z”:"",“name”:“Home Assistant”,“legacy”:false,“hassio”:true,“rejectUnauthorizedCerts”:true}]

I stop it when the door is closed but you can change to keep it talking or sending text to your phone by remove “off” at Halt If.

image

8am-5pm when you’re at work, 5pm-8am when you’re at home which you don’t want to get annoy by it.

The loop timer will trigger when it is true and keep loops until it max out, even though the door is closed.
Loop%20time

thank you soo much.

Thanks, cyberumb15! Sounds like a good excuse to learn node red. I’d like to stop the loop when the alarm is disarmed. Is there a way to do that? It would definitely annoy the wife if we disarmed the alarm but the loop kept going for 100 loops.

You can create another input_boolean on/off, place it after the looptimer, the input_boolean will be set it on whenever the door is open, you can turn it off whenever you want to stop it looping.

There are a lot smart people know more scripts and command to combine with this node-red to make better and shorter than mine, please don’t hesitate to chime in

I tried playing with Node Red but got overwhelmed, but I did find a way to do this. I created a 2 second timer, used that as an automation trigger that sends the TTS message, then I restart the timer after the message plays. I plan to add a condition to this that the alarm has to be in “triggered” state for it to run. I haven’t tested this yet, but my assumption is that disarming the alarm will stop the cycle because the condition wouldn’t be met. Now, I just need to add an automation with an action that triggers this repeating automation only if a door is open when the alarm is armed.

Automation:

- id: '1543371050424'
  alias: TTS Repeat - Front Door Open
  trigger:
  - event_data:
      entity_id: timer.repeattimer
    event_type: timer.finished
    platform: event
  condition: []
  action:
  - alias: ''
    data:
      entity_id: script.1543202013064
    service: script.turn_on
  - data:
      entity_id: timer.repeattimer
    service: timer.start

Script:

'1543202013064':
  alias: TTS for Front Door Open
  sequence:
  - data:
      message: Front Door Has Been Opened
    service: notify.walltablet
  - data:
      message: Front Door Has Been Opened
    entity_id: media_player.all_speakers
    service: tts.google_say

Hi, sorry for necroposting but I’m trying to import this flow and there are some error. Do you mind to share it again?

Peronally, I try to avoid NodeRed as much as possible—it’s another component that could introduce errors (though it can be helpful).

I’d suggest using an alert. Since many of us don’t seem to know how to make a TTS notifier (we don’t have built-ins), I did a little write-up yesterday:

So now you have a TTS notify, using an alert seems very easy, because you can adjust repetitions, and cancel it. :slight_smile: Good luck!

Then again, the smallest repetition would be a minute, so it might not help if you really want 2 seconds … :wink:

[{"id":"ef8fd144.9e0f5","type":"server-state-changed","z":"900c9e0a.5241d","name":"Back Door","server":"80018a0a.5e7a38","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.door_back","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":160,"y":1840,"wires":[["162ccfbf.af9c3","5e9e75bc.fd502c"]],"icon":"node-red/light.png"},{"id":"6e8e07db.d6eff","type":"api-call-service","z":"900c9e0a.5241d","name":"Android","server":"80018a0a.5e7a38","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_note_10","entityId":"","data":"{\"message\":\"Back Door is Opened\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1140,"y":1820,"wires":[[]]},{"id":"162ccfbf.af9c3","type":"time-range-switch","z":"900c9e0a.5241d","name":"","lat":"42.24013","lon":"-71.01411","startTime":"08:00","endTime":"17:00","startOffset":0,"endOffset":0,"x":380,"y":1840,"wires":[["f35e4090.256f1"],[]]},{"id":"f35e4090.256f1","type":"api-current-state","z":"900c9e0a.5241d","name":"Back Door Open","server":"80018a0a.5e7a38","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.back_door","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":610,"y":1840,"wires":[["d34017ed.b5f608"]]},{"id":"d34017ed.b5f608","type":"looptimer","z":"900c9e0a.5241d","duration":"2","units":"Second","maxloops":"5","maxtimeout":"1","maxtimeoutunits":"Hour","name":"","x":880,"y":1840,"wires":[["6e8e07db.d6eff","de7eca6d.088ac"],[]]},{"id":"de7eca6d.088ac","type":"api-call-service","z":"900c9e0a.5241d","name":"Echo Show","server":"80018a0a.5e7a38","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_echo_show","entityId":"","data":"{\"message\":\"Back Door is Opened\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":1880,"wires":[[]]},{"id":"5e9e75bc.fd502c","type":"time-range-switch","z":"900c9e0a.5241d","name":"","lat":"42.24013","lon":"-71.01411","startTime":"17:00","endTime":"08:00","startOffset":0,"endOffset":0,"x":360,"y":2020,"wires":[["569472db.4fe1ac"],[]]},{"id":"569472db.4fe1ac","type":"stoptimer","z":"900c9e0a.5241d","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":600,"y":2020,"wires":[["cf47264c.786d5"],[]]},{"id":"120abbc5.8e171c","type":"delay","z":"900c9e0a.5241d","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":1940,"wires":[["cf47264c.786d5","dbd50073.454da"]]},{"id":"cf47264c.786d5","type":"api-current-state","z":"900c9e0a.5241d","name":"Back Door Still Open","server":"80018a0a.5e7a38","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.back_door","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":840,"y":2020,"wires":[["120abbc5.8e171c","e4c00a9e.9ed2a8","575741dd.70195"]]},{"id":"e4c00a9e.9ed2a8","type":"delay","z":"900c9e0a.5241d","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":2080,"wires":[["cf47264c.786d5"]]},{"id":"dbd50073.454da","type":"api-call-service","z":"900c9e0a.5241d","name":"Android","server":"80018a0a.5e7a38","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_note_10","entityId":"","data":"{\"message\":\"Back Door is still Opened after 5 minutes\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":1940,"wires":[[]]},{"id":"575741dd.70195","type":"api-call-service","z":"900c9e0a.5241d","name":"Echo Show","server":"80018a0a.5e7a38","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_echo_show","entityId":"","data":"{\"message\":\"Back Door is still Opened after 5 minutes\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":2020,"wires":[[]]},{"id":"80018a0a.5e7a38","type":"server","z":"","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
1 Like

Thank you very much! :slight_smile: