Skip to content
Alan Tse edited this page Apr 26, 2019 · 32 revisions

Welcome to the alexa media player wiki!

What This Is:

This topic and this post is a place I hope to use to collaborate with enthusiastic Home Assistant users that want to see this component become the best it possibly can be. What I hope for is that we can each test and debug features within our skill set to make sure that once submitted for code review to be integrated into an official home assistant component that it will be a seamless experience for all users that wish to enable it.

For anyone who wishes to install the custom component be aware that this component is absolutely still a work in progress and may have currently unforeseen issues. With that said

What It Does:

Allows for control of Amazon Echo products as home assistant media devices with the following features:

  • Play/Pause/Stop
  • Next/Previous (Track)
  • Volume
  • Retrieval for displaying in home assistant of:
    • Song Title
    • Artists Name
    • Album Name
    • Album Image

Notable Additional Features

Play Music

We can basically do anything a Alexa Routine can do. You'll have to discover specifics, but here are some examples (and please help add them below!). To play music using the media_player.play_media service, you have to define the media_content_type appropriately. Search the forum for other examples.

Spotify

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "Release Radar",
  "media_content_type": "SPOTIFY"
}

Amazon

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "cats the musical",
  "media_content_type": "AMAZON_MUSIC"
}

Playlist named "Duets"

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "My playlist Duets",
  "media_content_type": "AMAZON_MUSIC"
}

Apple Music

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "7 rings",
  "media_content_type": "APPLE_MUSIC"
}

Deezer

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "Falco",
  "media_content_type": "DEEZER"
}

Tunein

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "BBC one",
  "media_content_type": "TUNEIN"
}

Play in Alexa groups

It is currently not possible to play to an Alexa group using routines. However, there is currently a hack that may or may not work where you can play to an Alexa group using any Alexa entity on that account. For example, to play to the "everywhere group". NOTE: We are sending to media_player.guest_room instead of media_player.everywhere

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "boyz ii men in everywhere group",
  "media_content_type": "AMAZON_MUSIC"
}

Query errors

If you get errors, please check Alexa history to see if there's special parsing happening. There have been multiple reports of inconsistent behavior.

Acronym issues

ESPN

{
  "entity_id": "media_player.guest_room",
  "media_content_id": "e._s._p._n. radio",
  "media_content_type": "TUNEIN"
}

NPR

  1. “BBC one” This works.
  2. "NPR” This has always worked but no longer…Alexa says it “can not play by artist on Tune-in”
  3. "N P R” sorta works but picks the incorrect media channel.
  4. “n. p. r.” now works properly. I found out by verbally asking Alexa to play N P R and checking history.

Please also note that different services may parse text differently. Umlaut problems

Text-to-Speech

For version 1.2.0 and above, can be provided via the Notification Component using TTS or Announce.

Deprecation warning: The following will be deprecated in the future and is only here for historical reference.

For versions < 1.2.0. Can be invoked from the HA UI services menu. media_player.alexa_tts and requires a payload like this:

{"entity_id": "media_player.bedroom_echo_dot", "message": "Test message"}

The Media_Player UI will not work!

Known working languages for TTS:

Online status of devices

Additional attribute to tell you if the Alexa device is online (extremely useful if you want to send a TTS after one has come back online (such as one in a vehicle)

Last called device (versions >= 0.10.0)

Each device will report whether it is the last_called or not. This allows us to identify the device that was called according to the Alexa Activities API.

update_last_called service (versions >= 1.1.0)

You can now force a last_called update with the alexa_media.update_last_called service . This is intended to be used in scripts/automations to get the latest data. With no service data, it will refresh all accounts. If you want to selectively refresh an email account:

{
  "email" : ["email1", "email2"]
}

Sequence commands (versions >= 1.0.0)

Alexa accepts certain pre-defined sequences and this is what provides TTS and play_media. This is now exposed through the media_player.play_media service when the media_content_type is set to sequence

Example json:

{
  "entity_id": "media_player.alexa",
  "media_content_id": "Alexa.Joke.Play",
  "media_content_type": "sequence"
}

Supported sequences (may be region specific):

  • Alexa.Weather.Play
  • Alexa.Traffic.Play
  • Alexa.FlashBriefing.Play
  • Alexa.GoodMorning.Play
  • Alexa.GoodNight.Play
  • Alexa.SingASong.Play
  • Alexa.TellStory.Play
  • Alexa.FunFact.Play
  • Alexa.Joke.Play
  • Alexa.Music.PlaySearchPhrase
  • Alexa.Calendar.PlayTomorrow
  • Alexa.Calendar.PlayToday
  • Alexa.Calendar.PlayNext
  • Alexa.CleanUp.Play
  • Alexa.ImHome.Play

Follow these instructions to discover more sequences and please update this list!

Automation routines (versions >= 1.0.0)

Running Alexa automation routines is now supported. Routines are tasks you can trigger through the Alexa App. Please create them using the Alexa app and ensure they are enabled. This is now exposed through the media_player.play_media service when the media_content_type is set to routine Example json:

{
  "entity_id": "media_player.alexa",
  "media_content_id": "Goodnight",
  "media_content_type": "routine"
}

Custom_updater (versions >= 1.1.0)

We now support custom_updater.

Add this to your configuration:

custom_updater:
  component_urls:
    - https://raw.githubusercontent.com/keatontaylor/alexa_media_player/master/custom_components.json

Notification service (versions >= 1.2.0)

Please see Notification Component.

In development

PLEASE NOTE: These features are not in the main release and are for testing only. Check the dev branch if you want to try it. We may not be able to help you with configuration questions as we'll be focusing on getting it ready for release, but appreciate bug reports.

You can’t perform that action at this time.