Echo Devices (Alexa) as Media Player - Testers Needed

service: media_player.alexa_tts
service data: {“message”:“alarm armed”,“entityID”:“media_player.barry_s_echo_dot”}

still get a failed but now I don’t see an error in the log

although I did see this error:

Updating alexa media_player took longer than the scheduled update interval 0:00:10
11:09 PM helpers/entity_platform.py (WARNING)

sorry it should be entity_id (i did read back in this topic to find the answer. allthough it is very long it is always helpfull to read :wink: )

thanks so much! working now!

1 Like
message: "Good morning. The current time is {{states('sensor.time')}}. You should probably get up soon"

I’m trying to get this to read out some sensor data, but Alexa is just reading the literal line without inserting the time. The context is in the action: section of an automation (an alarm, of course)

you need to use data_template (if i remember correct, if thats not the correct term read a bit back for the correct term) instead of data, when you call the service

1 Like

As @ReneTode says, you need to use a data_template. Examples on the wiki.

1 Like

That did it! Thank you.

That fixed it for me! Thanks.

Works perfectly for me on my second try installing it :slight_smile:
Would it be possible to make it play a specific song via an automation? and if no - how can this be accomplished with as little effort as possible?

thanks!

What music service do you have currently on your Echo devices? Spotify? Amazon Music?

Here is an example of a script to play a specific song. You can have an automation run the script.

Thanks for your reply, exactly what i was looking for!

I quickly found that it was a little more complicated then inticipated.
Im running spotify so i assume ill just replace ”amazon music” with ”spotify” and also populate the code with my echo name - but where exactly to i place this to run it properly?

Thanks

It works for me, and I don’t have Amazon Music Unlimited. Just make sure you’re logged in to Amazon Music in the Alexa app.
The only problem is, if I do this on one echo, and want to do it on another one right after, it doesn’t work. Amazon Music thinks I’m playing on more than one device, and it gives me a long alexa message.

I’m sure you already know this but, I did get apple music to work!

alexa_play:
  alias: Song
  sequence:
    - service: media_player.play_media
      data:
        entity_id: media_player.livingroom
        media_content_id : "7 rings"
        media_content_type: "APPLE_MUSIC"

Any ideas on this one?

2019-01-22 14:03:53 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform alexa
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/media_player/alexa.py”, line 146, in setup_platform
config.get(CONF_DEBUG))
File “/config/custom_components/media_player/alexa.py”, line 639, in init
self.login_with_cookie()
File “/config/custom_components/media_player/alexa.py”, line 662, in login_with_cookie
self.login(cookies=cookies)
File “/config/custom_components/media_player/alexa.py”, line 797, in login
self._data = self.get_inputs(soup)
File “/config/custom_components/media_player/alexa.py”, line 675, in get_inputs
for field in form.find_all(‘input’):
AttributeError: ‘NoneType’ object has no attribute ‘find_all’

That error happens if the page Amazon is giving you is not giving any login fields for us to pass login/password data. This can happen if Amazon wants you to reset your password. We’ve heard reports of this but haven’t seen the page yet to try to handle it gracefully in the component. We can debug this with the advanced debugging options which will show you the HTML pages the component sees when trying to log in. If you’re able to generate the pages and want to help debugging, separately DM me the scrubbed html pages plus logs.

Dear VladTepz,
I cannot pass the capcha challenge. It shows 2-3 capcha, then verification method (I input my email address here) then comes the Begin.
I could not pass the Begin even I pressed Confirm button tens times. Tried your suggestions also no help
Thank you

It is the 2-step verification procedure on Amazon.
Delete it and the capcha will work.

Dear IK0ADR,
I tried your suggestion but still failed.
Thanks for your help
Minh Chau

If it’s asking you to identify the 2FA, you need to input “sms” or “email” as Amazon is asking which method and HA doesn’t allow us to create an option or dropdown field to request data. Do not input your actual email address as that is not an option we parse.

Dear alandtse,
Thank you.
Actually, I tried to input “email” for several time but nothing happen so I tried inputing actual email instead.
I will try again.