Echo Devices (Alexa) as Media Player - Testers Needed

Delete the alexa_media.pickle file from your config directory. Amazon may also be asking you to reset your password.

1 Like

i has already used echo dot as media player, it can tts, play spotify, but in log always occur “Update of media_player.leo_s_echo_dot is taking over 10 seconds”
are any solution to solve this issue?
thanks for reading

I had tried to delete the file alexa.cpython-36.pyc
Now, it’s working fine :crossed_fingers::crossed_fingers::crossed_fingers::crossed_fingers:

Version 1.0.0 when we release it. Until then, no.

This is broken in 88?

2019-02-20 13:13:14 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.media_player.alexa. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/opt/python-venvs/hass-prod/lib/python3.5/site-packages/homeassistant/", line 147, in _load_file
    module = importlib.import_module(path)
  File "/usr/lib/python3.5/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/opt/hass-prod-cfg/custom_components/media_player/", line 16, in <module>
    from homeassistant.components.media_player import (
ImportError: cannot import name 'MEDIA_TYPE_MUSIC'

Please update to v 0.10.2.


Fixed 0.88. Thanks! Don’t forget to change custom_components/media_player/ to custom_components/alexa/ Save yourself some trouble when the former is fully deprecated.

So do you need to change the name of the file in the custom_components then? And put the inside a dir named alexa?

Exactly. Not intuitive when you only have one .py but that’s the direction Dev has moved.

Created a pull request with the folder/file names changed.

1 Like

Can confirm 0.10.2 works fine in 0.88

as @aneisch said I also navigated to

<HA Config>/custom_components/media_player

and did this

mkdir ../alexa
mv ../alexa/

Restarted HA and all works fine.


I’m on 0.87.1 and just updated this component to 0.10.2 and moved to
<HA Config>/custom_components/alexa/ (I’ve done also a chmod +x) and now I can’t see anymore the media_player.alexa_tts in the services list.

I’ve already restarted Hassio.

I get this error

2019-02-21 11:49:11 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.alexa.media_player. Make sure all dependencies are installed Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/", line 117, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.6/importlib/", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed File "/config/custom_components/alexa/", line 17, in &lt;module&gt; from homeassistant.components.media_player.const import ( ModuleNotFoundError: No module named 'homeassistant.components.media_player.const' 2019-02-21 11:49:11 ERROR (MainThread) [homeassistant.loader] Unable to find platform alexa

What can I check?


PS: I solved upgrading to 0.88

Im on 0.88.0 and have the latest version of the Alexa media player and get the below error when trying to use the TTS. If I go to the link specified using a PC I am able to hear the message.

2019-02-21 11:29:34 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=play_media, service_data=media_content_id=, media_content_type=music, entity_id=['media_player.kitchen_echo_dot']>
2019-02-21 11:29:34 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/", line 291, in _handle_service_platform_call
    await func(entity, data)
  File "/usr/local/lib/python3.7/concurrent/futures/", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/alexa/", line 621, in play_media
    self.alexa_api.send_tts("Sorry, text to speech can only be called "
  File "/config/custom_components/alexa/", line 1054, in send_tts
    "\", \"textToSpeak\": \"" + message + "\"}}}",
AttributeError: 'AlexaAPI' object has no attribute '_device_owner_customer_id'

Had this working great on 0.87.1. I’m now on 0.88.0, updated this component to 0.10.2 and changed the file structure to custom_components/alexa/ and am getting this error:

Log Details (ERROR)
Thu Feb 21 2019 05:19:44 GMT-0600 (Central Standard Time)
Error while setting up platform alexa
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/”, line 124, in _async_setup_platform
task = async_create_setup_task()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/”, line 89, in async_create_setup_task
None, platform.setup_platform, hass, platform_config,
AttributeError: module ‘custom_components.alexa.media_player’ has no attribute ‘setup_platform’

I have restarted HA and the virtual machine it is running on.
I thought I might need to reenter the capcha but can’t see where to do that. I used to be able to do that from the States page.

What am I missing here?

Working fine for me. (custom_components\alexa\
Did you delete the old media_player/ file?

If so, check the file, it sounds like it could be corrupted.

setup_platform() should be at #139.

Appeared to be a corrupt file. I deleted the and added a new one and it is now working. Strange because I copied/pasted the raw file the same way both times. Thanks for the help.

Can i use this version with 0.87.1 ? Or i must upgrade to 0.88 to use this?

For me didn’t work.

After upgrading to 0.88 all is working with the new version.

Just upgraded to Hass.IO 0.88.0 and now Im getting an error when checking config saying

Platform not found: media_player.alexa

Was all working as expected on the previous build. Has anyone else seen this error and if so how did they fix it ?

thanks in advance for any help

1 Like

Please update

Also make changes below as suggested