Echo Devices (Alexa) as Media Player - Testers Needed

Fixed 0.88. Thanks! Don’t forget to change custom_components/media_player/alexa.py to custom_components/alexa/media_player.py. 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 media_player.py 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.py ../alexa/media_player.py

Restarted HA and all works fine.

Hi

I’m on 0.87.1 and just updated this component to 0.10.2 and moved to
<HA Config>/custom_components/alexa/media_player.py (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/loader.py", line 117, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.6/importlib/__init__.py", 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/media_player.py", 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?

Thanks

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=http://10.168.40.1:8123/api/tts_proxy/a897e047dcfbcf96602b1802caaf4e7128bfa7c3_en_-_google.mp3, 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/service.py", line 291, in _handle_service_platform_call
    await func(entity, data)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/alexa/media_player.py", line 621, in play_media
    self.alexa_api.send_tts("Sorry, text to speech can only be called "
  File "/config/custom_components/alexa/media_player.py", 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/media_player.py 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/entity_platform.py”, line 124, in _async_setup_platform
task = async_create_setup_task()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, 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\media_player.py)
Did you delete the old media_player/alexa.py file?

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

setup_platform() should be at #139.

Appeared to be a corrupt file. I deleted the media_player.py 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

same, same problem …

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

1 Like

that sorted it @Prathik_Gopal …. saved me a lot of grief, thank you

Wow. Great job with this. Thanks!

great work thankyou for the speedy update

getting an error An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments: ('Expecting value: line 1 column 1 (char 0)',) any ideas?

The component isn’t logged in anymore. Restart HA. You may have to delete the alexa_media.pickle file or Amazon may be requesting a password change.