Echo Devices (Alexa) as Media Player - Testers Needed

Perfect, just what I was looking for.

I’ve been trawling the docs and forum for something like this, but honestly can’t remember to have seen it before now. Thanks!

Could you please post your automation? I’m having an issue getting the silence to play. My Echo’s just tell me that TTS is only supported via the media_player.alexa_tts service.

Thanks!

Having a weekend holiday, so I can’t get to my config now. But you’re probably using the wrong service to get the silence. This message plays when you try to use the Google TTS.
Probably worth to mention that this only works with Amazon music or another service that has a ‘silence track’ available. Using TTS will not bring the “paused” state back, I guess.
For Amazon music it should be something like:

  - service: media_player.play_media
    data_template:
      entity_id: media_player.downstairs
      media_content_id: 5 second silence
      media_content_type: AMAZON_MUSIC

Thanks for that! I really appreciate it. I also noticed that that the Echo’s also have an Idle state (I think it’s the same as paused) in which you can’t change the volume as well. Instead of creating an automation to wake them up from standby

I just added the service to the beginning of my TTS scripts because I ran into an issue where if two went into standby at the same time one would tell me that streaming was happening on another device and it wouldn’t come out of standby. Since none of my TTS generally goes off at the same time this method seems to work better for my case.

b3 please paste your automation code here. I tried what Remco was suggesting but it was not working for me , only one alexa worked.

I have simple water leak sensor and would like to enable “Warning” msg when triggered on all 5 of my alexas around the house. And the warning should be at volume 1.0

Perhaps multiple alexas are not supported.

It would be great if somebody drop working examples into WIKI.

I had to put this in front of all my TTS scripts.

- service: media_player.play_media
      data:
        entity_id: media_player.living_room_echo
        media_content_id: Silence 5 Seconds
        media_content_type: AMAZON_MUSIC
    - delay: '00:00:03'
    - service: media_player.volume_set
      data:
        entity_id: media_player.living_room_echo
        volume_level: 0.5

Like first Service on every single automation alias or somewhere in config.yaml?

Here running HA V.082.0 in Docker running on Ubuntu 18.10 64 bit.

It has been doing well.

Tried another Alexa TTS script called ha-alexa-tts

Works fine except it is a bit of a PITA to copy cookies.

Initially installed via the initial instructions at first post.

I would see the authentication prompt but it never worked.

Today installed options.json

{
  "username": "[email protected]",
  "password": "mysupersecretamazonpassword",
  "url": "https://alexa.amazon.com"
}

Docker install

and adjusted configuration.yaml

downloaded and installed most current alexa.py

restarted HA and see this in the logs

2018-12-15 01:07:16 WARNING (MainThread) [homeassistant.loader] You are using a custom component for media_player.alexa which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-12-15 01:07:16 ERROR (MainThread) [homeassistant.config] Invalid config for [media_player.alexa]: required key not provided @ data['email']. Got None
required key not provided @ data['password']. Got None
required key not provided @ data['url']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/media_player.alexa/

using /opt/alexa-api/data/options.json

points to me fat fingering the installation.

Please help.

All my tts is done in scripts. My automation calls a particular script when triggered. I had to add that to the beginning of all my TTS scripts.

In the DrZzs youtube channel there was questions about what types of services calls are implemented for this Alexa component. I wanted to outline them here for documentation:

MEDIA CONTROL SERVICES

Available services: volume_set , media_play , media_pause , media_next_track, alexa_tts, media_previous_track

Service data attribute Optional Description
entity_id yes Target a specific media player.

Service media_player.volume_set

Service data attribute Optional Description
entity_id yes Target a specific media player.
volume_level no Float for volume level. Range 0…1

Service media_player.play_media

Service data attribute Optional Description
entity_id yes Target a specific media player.
media_content_id no The song title, artist, playlist, or other text that you would speak to Alexa after specifying the content provider. Example: “Discover Weekly”
media_content_type no A content provider from the following list: AMAZON_MUSIC, SPOTIFY, PANDORA, TUNEIN, I_HEART_RADIO

Service media_player.select_source

Service data attribute Optional Description
entity_id yes Target a specific media player.
source no Name of the source to switch to. Bluetooth speaker name.

Service media_player.alexa_tts

Service data attribute Optional Description
entity_id yes Target a specific media player. Supports home assistant groups.
message no The message you wish the Alexa to speak.
2 Likes

Wow!!! 1436 post…can this be condensed, to hard to review all this

extreme condensed version:
read post 1 and post 1436

somewhat condensed version:
read every 10th post

very condensed version:
read every 100th post

:stuck_out_tongue:
in general:

  • read post 1
  • try it out
  • if you got problems or dont understand something read from post 2 untill you find the solution that suites you.

:wink:

2 Likes
is there anyway to create a music directory locally to recall sounds to be played as media over amazon echo. i have attached my yaml automation that i've been trying but not sure were im going wrong/ if its even possible.

- alias: 'Test notify'
hide_entity: true
trigger:
- platform: state
  entity_id: binary_sensor.bathroom_door 
  to: 'on'
action:
- service: media_player.volume
  data:
    entity_id: media_player.echo
    volume: 1.5
- service: media_player.media_play
  data:
    entity_id: media_player.echo
    media_content_id: http://192.168.1.92:8123/Local/Sounds/Door.mp3
    media_content_type: 'audio'

no, local media isnt possible. only through other skills like plex or something like that.

Thank you i will need to do some research into plex then as wont notification sounds :slight_smile:

Speaking of Plex, when playing music through the Plex skill the Alexa card says “Standby” and none of the controls work

Other than that great component :slight_smile:

thanks for this… I got it working easily by using single quotes in the config.

How do I get it to list favourite radio stations etc, so they appear in a drop down? or isn’t that possible?

Cheers
Mark

Now the Apple Music is live, is it possible to add that?

HI, I cannot install addon.
This is error message:
** ERROR (SyncWorker_10) [hassio.docker.interface] Can’t install keatontaylor/aarch64-addon-alexa-api:0.5 -> 404 Client Error: Not Found (“pull access denied for keatontaylor/aarch64-addon-alexa-api, repository does not exist or may require ‘docker login’”).**

My configuration is Hassio.io 0.84.2 on Raspberry Pi

THANK YOU I was driving myself crazy trying to figure out why I coudn’t get radio stations to work…

“N P R” not “NPR”

1 Like