Speak text from Google Home at the same time

I have setup this automation where when the heating starts it is spoken from google home.
The think is that I have 2 different heating zones and if they start simultaneously both automation are triggered but I hear just the first once since google home is busy.
Is there a way to make this to work? My idea is to delay the second automation for 5sec after the first automation was triggered or the other way round

- id: '1542598626834'
  alias: Speak Heating Downstairs Start
  trigger:
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - data:
      entity_id: media_player.google_home
      message: The heating downstairs has started running
    service: tts.google_translate_say
- id: '1542598612567'
  alias: Speak Heating Upstairs Start
  trigger:
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - data:
      entity_id: media_player.google_home
      message: The heating upstairs has started running
    service: tts.google_translate_say

Put a wait in,

    - wait_template: "{% if states(media_player.google_home) == 'off' or states(media_player.google_home) == 'idle' or states(media_player.google_home) == 'stopped' or states(media_player.google_home) == 'paused' %}true{% else %}false{% endif %}"
      timeout: 00:01:00
1 Like

@callifo
Can you please show me where I shall insert this?

Like this

- id: '1542598626834'
  alias: Speak Heating Downstairs Start
  trigger:
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - data:
      entity_id: media_player.google_home
      message: The heating downstairs has started running
    service: tts.google_translate_say
  - wait_template: "{% if states(media_player.google_home) == 'off' or sta
tes(media_player.google_home)\
      \ == 'idle' or states(media_player.google_home) == 'stopped' or stat
es(media_player.google_home)\
      \ == 'paused' %}\"\n  true\n{% else %}\n  false\n{% endif %}\""
    timeout: 00:0:10

You need to put it before the tts.google_translate_say.

That will pause sending the tts to the speaker until it is idle. The timeout value is how long to wait before continuing anyway. This can be set as long as you want it to queue. There is also an option for wait template to not continue after the timeout value expires.

Edit: Bare in mind that if you use the speaker for music or something, it will not interrupt and may result in your missing the announcement.

@callifo
Thanks my friend.

@callifo
I have tried the automation but it waits 10 seconds anyway even if google home is idle
Any thoughts?

When you look at the Google Homes state in Homeassistant when its idle what does the state say?

I have managed to do it this way.
The condition was always true no matter what


- id: '1563447968555'
  alias: Speak Heating Upstairs Start
  trigger:
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - timeout: 00:00:10
    wait_template: "{% if is_state('media_player.google_home', 'off') or\n
is_state('media_player.google_home',\
      \ 'idle') or\nis_state('media_player.google_home', 'stopped') or \ni
s_state('media_player.google_home',\
      \ 'paused') %}\n  true\n{% else %}\n  false\n{% endif %}"
  - data:
      entity_id: media_player.google_home
      message: The heating upstairs has started running
    service: tts.google_translate_say

Preformatted text

The winter is back and I have found out that this automation does not work.
What I have is this

- id: '1542598626834'
  alias: Speak Heating Downstairs Start
  trigger:
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.downstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - timeout: 00:00:10
    wait_template: "{% if is_state('media_player.google_home', 'off') or\nis_state('media_player.google_home',\
      \ 'idle') or\nis_state('media_player.google_home', 'stopped') or \nis_state('media_player.google_home',\
      \ 'paused') %}\n  true\n{% else %}\n  false\n{% endif %}"
  - data:
      entity_id: media_player.google_home
      message: The heating downstairs has started running
    service: tts.google_translate_say


- id: '1563447968555'
  alias: Speak Heating Upstairs Start
  trigger:
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Running)
  - entity_id: sensor.upstairs_state
    from: Standby
    platform: state
    to: Comfort(Warm Up)
  condition:
  - after: '8:30'
    condition: time
  action:
  - timeout: 00:00:10
    wait_template: "{% if is_state('media_player.google_home', 'off') or\nis_state('media_player.google_home',\
      \ 'idle') or\nis_state('media_player.google_home', 'stopped') or \nis_state('media_player.google_home',\
      \ 'paused') %}\n  true\n{% else %}\n  false\n{% endif %}"
  - data:
      entity_id: media_player.google_home
      message: The heating upstairs has started running
    service: tts.google_translate_say

What part isn’t working? Does the automation not trigger at all, or does it trigger but not do something?

I have managed to solve the issue.
The problem was that the automation was triggered at the exact same time resulting to hear just the first one. Adding once second delay solved the issue.