Anouncement to google speakers, the cabinet door open

Hi, I am trying to create an automation that will announce on google speakers (count of 4 and created a group with all) that a cabinet door is left open but cant see how to make the announcement to the speakers, can only see the homeassistant voice (only 1)
Then another message that repeats if left open every 20 minutes
I am stuck on 2 items
1 how to announce on the speakers
2 how to get the second announcement repeat if still open
Tried a couple of the blueprints on-line but they are either too complicated of don’t have google speakers access

OK I got the google speakers working but still don’t know how to repeat the second message that the cabinet is still open

Glad you got the speakers working!

I’d say a toggle helper to get the repeat. Toggle it on when the cabinet is open, and leave it until the cabinet is closed again. For your announcement you can have it run until the door is closed, or just set it for X minutes to check if the toggle is still on (door is open) and announce again.

Hi OvalZyre
{just set it for X minutes to check if the toggle is still on (door is open) and announce again.}
Yes this is what I want to do however I am stuck on how to do it, sounds simple but still,
I weant to know how to make the automation repeat if still open.
If I know how to make it go back to repeat I can set it to check if the door still open, if not open then it will stop executing

Thanks.

you can use a repeat to achieve that:

repeat:
  while:
    - condition: state
      entity_id: binary_sensor.cabinet_door
      state: "on"
  sequence:
    - action: your tts_action
    - delay:
        minutes: 5

The above repeat sequence will repeat your TTS action every 5 minutes until the cabinet door is closed

I’ve written this, it might do what you are looking for or maybe take control and copy some of the code.

TheFes
Thanks.
This is just what I wanted.
Keeps it simple.

Sir_Goodenough
Thanks for the suggestion, however I will use the suggestion from TheFes

Hi TheFes
I am having problem integrating the yaml with my sequence showing error message
malformed extra keys not allowed @ data [‘repeat’]
here is my automation yaml

alias: cabinet door opened
description: ""
triggers:
  - type: opened
    device_id: 618705d0dd4279d61302723dfd1a9e72
    entity_id: b1968e20e5f5fefefa30b27fee2465f4
    domain: binary_sensor
    trigger: device
    for:
      seconds: 2
conditions: []
actions:
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.living_room_speaker
      message: cabinet door is open
      language: en-uk
    target:
      entity_id: tts.google_translate_en_com
  - delay:
      minutes: 5
repeat:
  while:
    - condition: state
      device_id: 618705d0dd4279d61302723dfd1a9e72
      entity_id: b1968e20e5f5fefefa30b27fee2465f4
      state: "on"
  sequence:
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.living_room_speaker
      message: cabinet door is still open
      language: en-uk
    target:
      entity_id: tts.google_translate_en_com
  - delay:
    Minutes: 5

The repeat building block should be in your actions sequence.
Also your delay is not working like this, Minutes should be lowercase and indented with 2 spaces.
And your condition for the while is wrong, you can’t use device_id there.

alias: cabinet door opened
description: ""
triggers:
  - type: opened
    device_id: 618705d0dd4279d61302723dfd1a9e72
    entity_id: b1968e20e5f5fefefa30b27fee2465f4
    domain: binary_sensor
    trigger: device
    for:
      seconds: 2
conditions: []
actions:
  - repeat:
      while:
        - condition: state
          entity_id: b1968e20e5f5fefefa30b27fee2465f4
          state: "on"
      sequence:
        - action: tts.speak
          data:
            cache: true
            media_player_entity_id: media_player.living_room_speaker
            message: cabinet door is still open
            language: en-uk
          target:
            entity_id: tts.google_translate_en_com
        - delay:
            minutes: 5

OK Thanks
I was not sure about the location of the repeat, and the device ID
The minutes was a typo as I was using wordperfect to create the yaml
Normally works ok with spelling and such
Edited my yaml and now works good
Again Thanks for the assistance

Still learning here…

Note that with the automation above, you will get announcements 2 seconds after the cabinet door is open. It might be good to add a delay as first action, before the repeat block. That will delay the first announcement, and will give you time to take something out of the cabinet and close it again before announcements are sent.

The 2 second delay is intentional for testing
If the door open just to check it only takes a second or 2 but i wil, increase tho time to 5 seconds