Echo Devices (Alexa) as Media Player - Testers Needed

I feel as though the documentation needs to be updated on this so that we can stop some of the repetitive comments. 90% of the questions asked on here have been answered numerous times throughout the thread. Which I completely understand is a pain to find something in a thread that has 1000+ comments. If you need help updating the docs I would be more than happy to assist!

1 Like

@keatontaylor Why don’t we enable the wiki on github and have people fill out a FAQ. While I can create the wiki page, you’ll have to change the flag to allow non-contributors to make changes.

Update: Made an initial wiki page. Keaton will need to enable non-contributors but afterward, have at it on the documentation.

1 Like

Hi , thank you for tge wiki it will be helpful. Would you be so kind and add also few examples for automation. I cant figure out how to post payload to multiple alexas. Tried creating speaker group in Alexa app but it did not work.

you cant send TTS to a multimedia group in alexa.
you need to send it to all devices seperate

Finally works in Spanish from Mexico this morning ! . But it´s speaking very quickly . How can I use a kind of silence or time between sentences. I am trying with dot. but not work very well

Is there a parameter for volume?

Rene what is the syntax for multiple in automation script?

you cant change the speed, and you cant make a pause.

@Vendo_Novak the volume is set with the volume service.
to send a text as TTS to multiple devices you use a same way as you would to turn_on multiple lights at the same time.

Can somebody please drop here an automation example code showing how to increase Volume when announcing to multiple alexas?

Please

it will be something like:

  action:
    - service: media_player.volume
       entity_id: media_player.your_echo
      data:
        volume: 0.6
    - service: media_player.alexa_tts
       entity_id: media_player.your_echo
      data:
        message: "your_text"
    - service: media_player.volume
       entity_id: media_player.other_echo
      data:
        volume: 0.6
    - service: media_player.alexa_tts
       entity_id: media_player.other_echo
      data:
        message: "your_text"

Milion times thank you Rene

please check in development tools, services if i got the right services.
i cant check that because i dont have a mediaplayer.

For me, a comma or period works. However if it doesn’t work for you, you could always send each sentence separately and put a one second delay between them. Or if you split them, a delay may not even be necessary.

- delay: '00:00:01'

I don’t think that will work.

You need to actually be playing something to change the volume.

Here is a cheesy, silly automation I used to test the volume change:

- alias: Announcement Volume Set Test
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: input_boolean.bool_15
      to: 'on'
  action:
    - service: media_player.play_media
      data:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        media_content_id: "Silence - 30 seconds"
        media_content_type: "AMAZON_MUSIC"
    - delay: '00:00:20'
    - service: media_player.volume_set
      data:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        volume_level: 1.0
    - delay: '00:00:05'
    - service: media_player.alexa_tts
      data_template:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        message: "Attention!. . . Attention!. . . This is a fairly long message to sample the volume that I'm saying things at."
    - service: media_player.play_media
      data:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        media_content_id: "Silence - 30 seconds"
        media_content_type: "AMAZON_MUSIC"
    - delay: '00:00:20'
    - service: media_player.volume_set
      data:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        volume_level: 0.5
    - service: media_player.alexa_tts
      data_template:
        entity_id: 
          - media_player.computer_room_dot
          - media_player. livingroom_dot
        message: "Attention!. . . Attention!. . . This is a fairly long message to sample the volume that I'm saying things at."

Great work, thanks a lot!

I wasn’t able to get it working with the Docker container version, but did manage to get the ‘regular’ version working, and so far very reliable :+1:t3:

yeah i did read that setting volume without content running wasnt working.
i forgot about that.
i think thats a problem from the mediaplayer, because alexa can do it and so can the script.

i hope for you guys that @keatontaylor will take a look at why it isnt possible with the mediaplayer.

1 Like

The setting volume during standby doesn’t work. But it’s easy to keep the media player from going to standby.

If you look at the logbook, you can see the echo/media player has 3 states: playing, paused and standby.
The ‘paused’ state is always active for exactly 2 hours after the ‘playing’ state. Then it turns to standby.

I have an automation that plays a 5 second silence every time the state changes from paused to standby. Bringing the state directly back to paused for 2 hours. Volume set always works because state never goes to ‘standby’.

Hope this helps someone.

4 Likes

What do you mean?

You weren’t able to get the component working with the docker version of home assistant?

I use docker for home assistant and mine works fine.

I mean I wasn’t able to get the docker version of this custom component (alexa-api) running with Home Assistant.

Looking at the logs for alexa-api in Portainer it looks like that is working fine

nightmare electron child process exited with code 0: success!


Internal endpoint:

curl -X POST -d "tts=Ask Alexa team for a proper TTS API" -d "deviceSerialNumber=deviceSerialNumber" http://localhost:8091/alexa-tts

But whatever I've tried adding to configuration.yaml in Home Assistant I couldn't get them to talk to each other :neutral_face:

Anyway, just using the ‘regular’ version (not the Docker container) of this works fine for me with Home Assistant.

I didn’t even know that a docker version of this component existed. How did I miss that? :thinking:

Where can I find info on it?