Selecting Multiple Media_player in automation

I’ve had a look round but cant find a way of getting TTS to talk to specific media players.

i have an automation that turns volume to 6, says we have post, waits and then turns the volume down, the below obviously doesn’t work with the 2 entities but is kind of what i want. if i do separate sections for each player there is a bit of delay when they start talking. also i have a Sony TV that is also classed as a media player so if i use the “All” flag the TV also try’s to play along!!

- id: '1574024040648'
  alias: New Post
  description: ''
  trigger:
  - above: '1'
    entity_id: sensor.post_box_y_coordinate
    for: 0:00:01
    platform: numeric_state
  condition: []
  action:
  - data_template:
      volume_level: '0.6'
      entity_id: media_player.conservatory_speaker
      entity_id: media_player.entryway_speaker
    service: media_player.volume_set
  - data:
      message: You Have New Post
     entity_id: media_player.conservatory_speaker
     entity_id: media_player.entryway_speaker
    service: tts.google_translate_say
  - delay: '[object Object]'
  - data_template:
      volume_level: '0.3'
     entity_id: media_player.conservatory_speaker
     entity_id: media_player.entryway_speaker
    service: media_player.volume_set
1 Like

I’m no expert at all, but what comes to mind first would be using groups. Can’t you setup these two entities in a group (“my_message_speakers”) and call this group with your automation?

i’ll have a look into that mate, don’t worry about the no expert at all I’ve been using it for about 4 days so everyone is an expert next to me!!!

To use multiple entities in an automation, list them like this:

entity_id:
- entity id 1
- entity id 2
...

Or like this:

entity_id: entity id 1, entity id 2, ...
4 Likes

perfect!!! that was so simple yet couldn’t find the answer anywhere!!!

See, that’s what I meant. :smiley: Good to know how it works! :slight_smile:

1 Like