Echo Devices (Alexa) as Media Player - Testers Needed

It’s kinda like an authentication key generated by Amazon and placed in your configuration directory and looks like alexa_media.your_email_address.pickle. Sometimes it gets stale and you need to refresh it by deleting it and letting Amazon build a new one by putting you thru the authentication with captcha routine again.

thank you very much Dixey!

is anyone else seeing repeating errors in their logs, as follows:

2019-08-24 23:19:44 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/alexa/state_report.py", line 45, in async_entity_state_listener
    hass, smart_home_config, alexa_changed_entity
  File "/usr/src/app/homeassistant/components/alexa/state_report.py", line 86, in async_send_changereport_message
    allow_redirects=True,
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 371, in _request
    url = URL(str_or_url)
  File "/usr/local/lib/python3.7/site-packages/yarl/__init__.py", line 151, in __new__
    raise TypeError("Constructor parameter should be str")
TypeError: Constructor parameter should be str

I opened issue 25257 to address this but have not heard too many complaints about this issue, which makes me wonder if there is something else going on. As stated in the issue tracker, I have updated HA and the Alexa component fresh and the errors persist. Anyone else see this? Anyone resolve it?

Please note the error you’re seeing is from the official component and not alexa_media. It’s not related to this thread. You can tell because it’s under the /components/alexa directory. We live in the custom_components/alexa_media directory.

To nitpit, it’s actually generated by alexa_media as we’re saving the login cookies from Amazon.

No, they’re switches associated with the media player. We didn’t have an option to disable them, but HA 0.98 may provide that functionality for us instead.

Thanks, I linked your page to one of the FAQs where people ask about the tts in the standard media player.

Same here!

2.0.1 is out.

We’ve bug fixed some of the reported issues and added some additional logging to try to track down the remaining issues. For those running into captcha issues, please enable logging and report them. Work around is to roll back to 1.4.1 and get your .pickle set up. Everyone should really just use HACS because rollbacks are easy there.

For those on hassio, you may have to restart 2-3 times before HA will load the dependencies.

Please note, we’ve swapped repositories to custom-components. This will probably be our permanent home as official HA policy says we can’t become a standard component. All links should redirect to the custom-components but watch out for bugs if you’re hitting the old site. Please reinstall from HACS so it tracks from the new repo.

Fix

  • check for valid response from get_bluetooth (b1422c4) (fixes #309)
  • remove await for async_schedule_update_ha_state (d801a59) (fixes #302)
  • set await for async source functions (26d3c17) (fixes #302)
  • update alexapy to 1.0.1 and add HA min version (2cdb259) (fixes #299, fixes #313)

Changes

  • style: update documentation for move to custom_components project (fixes #238)

Full changelog.

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

I apologies but I can`t find it anywhere. Would you know if it is possible to get text on Alexa show while sending TTS?

AFAIK not you have to use announce instead of tts. That works. The only difference is a short bing before talking something what I found comfortable. With tts it sometimes is a little bit scaring if alexa suddenly begin to talk :wink:

I have a bit of an interesting issue.
I have 2 2nd Generation Echo Dots and 1 3rd Generation Echo Dot.
The 2 2nd Generation dots perform as expected, but the 3rd Generation Dot reports Muted as True , Volume as 0 and I am unable to set the volume from the media player.
The Developer Tools - States shows it as such so it cannot be the Lovelace media player component giving the fault.
Any suggestions please?

The following works for me with 2 gen 2 dots and 1 gen 3 dot using most current alexa media player 2.0

action:
      - service: media_player.volume_set
        data:
            entity_id:
              - media_player.office_echo_dot
              - media_player.eco_dot_den
              - media_player.echo_dot_family_room
            volume_level: 0.5

You need to unmute the devices for volume changes to work. In the HA UI you hit the speaker icon or you can use the media_player.volume_mute service.

Hi all. Updated to 0.98.1 and HACS no longer recognizes the Alexa Media custom component that I installed from the community store. Any idea why that might be?

Alexa Media appears to still be installed and working. HACS just doesn’t see it or track it.

We changed project locations so you need to reinstall in HACS.

Thanks. When you say reinstall, do you mean delete Alexa Media within custom components, or leave as is and just click install via HACS?

Click install.

The Gen 2 Volume set works, but not the Gen 3.

The unmute and volume set has no effect on the gen 3 dot. All the other actions work, play radio, announce etc.
It is at volume 3 via a voice request (“Alexa, set volume 3”), and I can hear it playing. This does not reflect at all in the entity’s state.

Hi there, I’m getting problems with last version:
-HA 0.98.1 on Docker

  • Alexa Media Player 2.0.1

When I restart HA after upgrade custom_component it ask me about captcha. .Then I clic on confirm but I get this:

Error calling service configurator/configure . get

and no success addin media_players.

at log I get this

2019-09-01 10:26:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139947504184528] get
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/configurator/__init__.py", line 235, in async_handle_service_call
    await self.hass.async_add_job(callback, call.data.get(ATTR_FIELDS, {}))
  File "/config/custom_components/alexa_media/__init__.py", line 153, in configuration_callback
    login, callback_data)
  File "/config/custom_components/alexa_media/__init__.py", line 143, in setup_platform_callback
    await login.login(data=callback_data)
  File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 306, in login
    headers=self._headers)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 466, in _request
    ssl=ssl, proxy_headers=proxy_headers, traces=traces)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 286, in __init__
    self.update_host(url)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 340, in update_host
    raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: get


Notify is not working, I used this (earlier versions it works)

alexa_announce_example:
  alias: Alexa Announce
  sequence:
  - data:
      data:
        method: all
        type: announce
      message: Hello
      target: media_player.s_echo_dot
    service: notify.alexa_media

but where you place it on automations?