Echo Devices (Alexa) as Media Player - Testers Needed

Tags: #<Tag:0x00007f327b98b908>

Is there a way to use this to trigger automations in HA when an Alexa timer expires?

(I can see some possible approaches using the *_next_timer sensor, but that requires some ugly hackage to detect when it changes from anything except unavailable.)

Hi, anyone else has issue trying to play alexa’s sounds ?
Trying to play a simple sound using this example in the dev tools

entity_id: media_player.my_amazon_echo_id
media_content_type: sound
media_content_id: amzn_sfx_doorbell_chime_01

But i keep getting this error:
play_sound() got an unexpected keyword argument ‘extra’

everything else works perfect (spotify, tts, announce … )

Please confirm you’re using version 3.1.2 as this was a bug fixed last night. They added an additional parameter in HA 0.115.4.

1 Like

hello, I need help
Does anyone manage to get tts work to the mobile app?

Thank you! I was like WTF!?!?!

See if the following thread is helpful:

Is it possible to play Amazon Music Stations? Specifically, I am trying to play the recommended My Soundtrack station, but haven’t had any success

I have this bug with the latest update 3.20, and I don’t know where the error is.

2020-10-02 11:38:23 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up alexa_media platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 193, in async_setup_platform
await asyncio.shield(task)
File “/config/custom_components/alexa_media/sensor.py”, line 121, in async_setup_entry
return await async_setup_platform(
File “/config/custom_components/alexa_media/sensor.py”, line 80, in async_setup_platform
alexa_client = class
(
File “/config/custom_components/alexa_media/sensor.py”, line 457, in init
super().init(
File “/config/custom_components/alexa_media/sensor.py”, line 166, in init
self._process_raw_notifications()
File “/config/custom_components/alexa_media/sensor.py”, line 197, in _process_raw_notifications
self._tracker = async_track_point_in_utc_time(
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 891, in async_track_point_in_utc_time
cancel_callback = hass.loop.call_at
AttributeError: ‘NoneType’ object has no attribute ‘loop’

Anyone seeing their “next” sensors not updating after 3.2? My next_alarms are all “unavailable”. Will wait to open issue

Thanks. This should be resolved now.

Confirmed it now works after updating. Thanks!

I am getting stuck when authorizing the final step. I have Approved the Amazon text the first time I click submit. In HA the following never moves on.

Alexa Media Player - Action Required

[email protected] - alexa.amazon.com
Amazon will send a push notification per the below message. Please completely respond before continuing.

To continue, approve the notification sent to:
Mobile number - -**81

Enable 2FA. That login path you’re on is unsupported since I can’t replicate it. You’re welcome to figure out how to get past it and submit a PR and we may support it in the future.

Normally with stations I have been able to get them to work by just adding “Station” to the end, like “Station Name Station”. “My Soundtrack” seems trickier for some reason, but it works for me if I use “The My Soundtrack Station” (at lease in a Routine which should work the same way).

hi all
i want to send by notify the remaining minute from next timer
i understand that i need to create a template sensor - but everything i did get me nowhere
can any one help?

Thank you! Adding the station to the media_content_id seems to have worked

Used Authenticator app on phone and all is well!

Thanks!

I think it would be:

{{ (as_timestamp(states('sensor.echo_next_reminder'))-1*60) | timestamp_custom('%H:%M') }}

Had the notification that i need to enter my credentials.

Did that and said all ok. But Alexa TTS did not working. Looked at the log and had the following:-

Logger: custom_components.alexa_media
Source: helpers/entity.py:289
Integration: Alexa Media Player (documentation, issues)
First occurred: October 3, 2020, 9:48:02 PM (129 occurrences)
Last logged: 7:20:53 PM

Unexpected error fetching alexa_media data: Attribute hass is None for <Entity Brian's Echo Dot: standby>
Unexpected error fetching alexa_media data: Attribute hass is None for <Entity Lynne's Dot: standby>
Unexpected error fetching alexa_media data: Attribute hass is None for <Entity Brian's Fire: standby>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 143, in async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 131, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/alexa_media/__init__.py", line 425, in async_update_data
    await hass.data[DATA_ALEXAMEDIA]["accounts"][email]["entities"][
  File "/config/custom_components/alexa_media/helpers.py", line 159, in _catch_login_errors
    result = await func(*args, **kwargs)
  File "/config/custom_components/alexa_media/media_player.py", line 497, in refresh
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 289, in async_write_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity Brian's Echo Dot: standby>

Rebooted HA Alexa TTS now working but the logs shows the following entries:-

Logger: homeassistant.config_entries
Source: helpers/entity_component.py:155
First occurred: 7:26:55 PM (1 occurrences)
Last logged: 7:26:55 PM

Error setting up entry [email protected] - amazon.co.uk for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 334, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Logger: homeassistant.helpers.service
Source: helpers/service.py:427
First occurred: 7:28:31 PM (1 occurrences)
Last logged: 7:28:31 PM

Unable to find referenced entities media_player.brian_s_echo_dot

This is just for feedback, do I need to do anything? Why did I need to reboot?

Trying to set this up but I keep getting an error in the log. The devices load, and i can get tts and music control, but what I’m really trying to get is guard control working and the alarm control panel won’t load. I have 2fa on, and am in the U.S. with guard enabled on the mobile app, but keep getting these errors. Any ideas what I’m doing wrong?

Update - I’m thinking the error is related to reminders recurring weekly that now announce on all devices. This is a new feature that may not be supported and causing issues. Before deleting all these and trying again, any thoughts on if that could be the problem? Link about new reminder feature - https://www.cnet.com/how-to/alexa-just-got-smarter-reminders-on-your-amazon-echo-how-to-use-the-new-feature/



Logger: homeassistant.components.sensor
Source: custom_components/alexa_media/sensor.py:267
Integration: Sensor (documentation, issues)
First occurred: 10:33:12 AM (1 occurrences)
Last logged: 10:33:12 AM
Error while setting up alexa_media platform for sensor

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 201, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 310, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 481, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 521, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/alexa_media/sensor.py", line 304, in async_added_to_hass
    await self.async_update()
  File "/config/custom_components/alexa_media/sensor.py", line 399, in async_update
    self._process_raw_notifications()
  File "/config/custom_components/alexa_media/sensor.py", line 173, in _process_raw_notifications
    self._all = list(map(self._update_recurring_alarm, self._all))
  File "/config/custom_components/alexa_media/sensor.py", line 267, in _update_recurring_alarm
    and alarm.isoweekday not in RECURRING_PATTERN_ISO_SET[recurring_pattern]
AttributeError: 'float' object has no attribute 'isoweekday'