Echo Devices (Alexa) as Media Player - Testers Needed

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'

Have 2FA enabled and was able to reauth without issue (received the "need to reauthorize notification in HA) but it seems I am doing this now roughly once a week…

Is everyone else reauthorizing with this frequency and is this the new normal?

No, it’s not related to the feature as reminders in this state still provide information in the proper format. There is a bug in that the component associates the reminder with the Amazon application that set it, but it doesn’t cause the error you saw. Without logging of the value that directly caused it, then I have no idea what is going on in your system.

Any idea why I have the same email address twice? Both have the same number of device/entities:
image

Just delete the extra and make sure you only configure it one place (configuration.yaml/integrations).

Thanks for the clarification. I got my guard control panel working and all devices setup, and it turns out it was not related to the error I posted above. My wife and I have separate but linked Amazon accounts and I was using mine at first, but had to use her login since hers was the “primary” account. It seems on the mobile app it doesn’t matter which linked account is used in the Alexa app, but logging in to alexa.amazon.com showed completely different information on smart devices and skills for her account vs mine.

All is working now, but I still get this error related to alarms on an almost daily basis. I know its somehow related to a recurring reminder, and when it happens it causes the “next reminder” entity for that device to go offline for a period of time. I have like 20 recurring reminders so there might just be too many for the code to handle. I’ll continue to troubleshoot, but its not really impacting operation at this point, and everything else is working well.

Update- issue with reminders and the log error appears to be from proxy server config problems with Nginx, and nothing to do with the media player integration or my reminders. Once I fixed the proxy settings I haven’t seen the error again.

I get this ERROR message avery 2.5 minutes:

2020-10-09 21:55:58 ERROR (MainThread) [custom_components.alexa_media] Unexpected error fetching alexa_media data: Attribute hass is None for <Entity Paul’s Fire Tablet: standby>

Paul’s Fire Tablet is not present in the Entities Registry. It is a Kindle Fire tablet on the same Local network as my HA instance. Please advise

Try 3.2.2.

I keep getting this screen, and I am not sure what to do.
image

Hard refresh your browser cache.

How to use an Alexa routine inside an automation?

I tried without success this:

    - service: media_player.play_media
      data:
        entity_id: media_player.echo_plus
        media_content_type: routine
        media_content_id: "smart bulb off"

What is wrong?

I’m having this same issue. I’ve turned on 2FA, but I’m getting the same message. How can I restart the authentication process?

edit: To answer my own question. I removed the integration, removed the folder in custom_components, then did a reinstall in HACS. Everything is working again.

Question: did that reset entity ids and all that? I’m having this super annoying issue, where there is a second instance of the integration and trying to “Reconfigure” absolutely positively will not take my password, TFA and captcha information. There is zero doubt on my part all the info is correct on entry

I’m ok with delete and reinstall if all my hard work with automations will remain intact

Yes, it did not effect any of my automations.

1 Like

I am trying to send a voice command directly to Alexa

I have a skill that controls something that is not compatible with HA.

The Skill can only be activated with voice commands, none of it features can be set in a routine.

can I just send a command to Alexa “Alexa perform action X” without assigning it to media_content_type as if i was speaking to her normally?