Echo Devices (Alexa) as Media Player - Testers Needed

Cookies have expired. Delete the pickle file and relogin.

1 Like

Same problem here. You find a solution expect switching to .com?

Anybody having the problem with alexa having stopped to announce?

I’m using simply notify.alexa_media, that worked for several month. But now cannot get it working all of a sudden. Reinstall did not help. I also did not get any 2FA auth requests.

{
"message":"test message",
"data":{"type":"announce"},
"target":["media_player.my_echo_dot"]
}

Also no exceptions in the logs.

today i installed HA version 0.103.6 (thats the last version that supports python 3.6 i guess)
i did copy all files to the custom_components directory

i tried the yaml configuration but HA tells me the config is wrong.
when i try to configure through the frontend, i see the alexa media component, but when i click on it it dissapears directly.

what is the least version from HA that is needed?
and what version from alexa media would work with HA 103? because i tried older versions as well.

If I wanted to have HA send a reminder to all Echo devices currently registered in HA at 6:00PM how would I do that?

Note tried the below and logbook shows it triggered, no errors in the homeassistant.log file, but nothing came out of the Echo’s:

- alias: 'Barbara Med Announcement'
  initial_state: true
  trigger:
    platform: time
    at: '18:00:00'
  action:
    - service: notify.alexa_media
      data_template:
        target:
          - media_player.basement_alexa
          - media_player.family_room_alexa
          - media_player.ecobee
          - media_player.master_bedroom_alexa
          - media_player.spare_room_alexa
          - media_player.johns_room_alexa
        data:
          type: announce
        message: "Barbara, time to take your medication!!"

Is there anyway to launch a predefined playlist that already existed in “apple music” ? did you manage to launch your playlists ? i don’t want to recreate everything like in your example.

Have you checked whether you have Communications enabled for the devices in the Alexa app? That is required for the type: announce to work (as documented here).
Also, you won’t get sound if a device is in Do Not Disturb mode.
Using type: tts should work without Communications being enabled.

Hi everybody. I used the marvellous Alexa Media component smoothly for long time. Suddenly it got broken without any apparent reason and now isn’t working for 2 months. I have the integration configured in HACS, but entities are not available anymore.

I use HA without HASSIO on windows 7 through python 2.14 64bit

What I already tried:

  • I updated in these 2 months HA and component every time I saw an update but this not solved my issue. Currently I have v2.10.4 and HA 0.114.3
  • I canceled the “[email protected]” file without solving (in the past I solved one doing this). Now I’ve put it back the file in the HA root

Configuration.yaml

alexa_media:
  accounts:
    - email: [email protected]
      password: *********
      url: amazon.it

My log is the following

2020-08-26 18:04:33 ERROR (MainThread) [alexapy.helpers] alexalogin.login((<alexapy.alexalogin.AlexaLogin object at 0x136B3D10>,), {'cookies': {'session-token': 'PfFK5+YWzr/d3KJR6qM8jsjs2gUcix87ILFOgZg3jIs7l/rvhNya6hQt0aEfWNbbt6iQNV77x4ObCxb6S7ZtwTjS+I1oLOvCrQvvd6OaTVGXO/QzRWyKY76VyePZA2CKEGtZ0w5vB7vSe4psGoUjoEZcfySKbBl3qPO9MilFGOJzL9dUI0GaxsosGf+lvEla162QASYWvN4KSLF6ZVBjPvrO74A1bazUDb4xWvcy+kY=', 'ubid-acbit': '261-5428101-2796651', 'at-acbit': 'Atza|IwEBIO5PlDKrJt4E00ndVg1R6kHv_O2fu_gPV-0IX29Uenig5BxcgkMLI1ZwajbX7LzSh4VM5ZZlqzH676ZfsOQE9SErdpSRllCoGaLqFnGCDYdMn5S_bEPHMA_-1wRGS00AUyCC0gjABccbgoGBG4WXCAGYs5gdhvNV3H1ulB9dcBFumGmY_0AwyTU6peHNcGpt5Zo9FNgmfJkI8_NBXH0D_1VGcT7AHccVhp6pYeeU30W6NUCm7FtX8cEGqvApjvZCQ7kJOJtrirMggkCGtBIv0cM1qzuqzz2-esBWzeXRB6VVCbguRb_wFJesys9o5anrqoEcLp6lPVrnG8xw5Uij9cq7Oi5AduenPvIIWXNHf3BfzpE-qI36MUu51Oe7ITUQqTi0-KS9o8W5If7-WpwttRF1', 'x-acbit': 'Oe9SzDg8qsNkpjMJrWQdZ?JjFRMUnred', 'sess-at-acbit': 'faX433OcNI/l6XBCPEV1bM0xNkFP7fDhcZI6+OrHz4U=', 'sst-acbit': 'Sst1|PQHFnGGTghVJv-O_VCzHlivjC4t09SKT-vrw09cdR0Llal378Ww7aqbiVkbDOTCoaoQd1v-zbFnZnWxfAnFm4Wp_YENHImwGaPn5ojYNUalcVcQ8jE3nq4xe5OUfSsSdpkG0JFnz1XSXxILfnae-VvNoqoX8cQsLfPm6oumnroK6tbettM9WlAF6Eaou-UZAJjkJWfnJGzBJRDq1WN9tePLvVsbK_qaeXemj4vcp9pwBXp56jnIWYzXmYoWbfIlELyoKlrt_2dthN56vsGAxxiVtLx1Ku7P0REIQiybn0TV2MioJbGvhq6EHPbFxHx6Oaz5umxq1FmC3e1vLE8pooAhRXA', 'session-id': '260-3036014-3324422', 'session-id-time': '2218643718l', 'csrf': '-1462111452'}}): An error occured accessing AlexaAPI: An exception of type AttributeError occurred. Arguments:
("module 'aiofiles.os' has no attribute 'remove'",)
2020-08-26 18:04:33 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] - amazon.it for alexa_media
Traceback (most recent call last):
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\config_entries.py", line 223, in async_setup
    hass, self
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\custom_components\alexa_media\__init__.py", line 220, in async_setup_entry
    await login.login_with_cookie()
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\alexapy\alexalogin.py", line 214, in login_with_cookie
    await self.login(cookies=self._cookies)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\alexapy\helpers.py", line 111, in wrapper
    return await func(*args, **kwargs)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\alexapy\alexalogin.py", line 395, in login
    await self.reset()
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\alexapy\alexalogin.py", line 246, in reset
    await aioos.remove(cookiefile)
AttributeError: module 'aiofiles.os' has no attribute 'remove'

Going from this issue it is due to you having and older version of aiofiles (you need at least 0.5.0) and may be related to an older version of HACS which used aiofiles 0.4.0.

So try updating HACS to the latest version if you can

I have the same issues. Alexa Media Player broke, I deleted the HACS implementation of Alexa Media Player and reinstalled using v2.10.4. Now cannot get past the Amazon push text confirmation to approve access. On latest versions of HACS and HaOS/Home Assistant.

I also updated HACS to v1.5.2 but also this didn’t help in solving my issue. However I checked the version trying to update aiofiles “py -m pip install --upgrade aiofiles” and it tells me the requirements are already up to date with version 0.5.0.

I also tried to cancel and redownload integration but I had the same result unfortunately

Are you running Home Assistant Core in a Python virtual environment? If so, make sure that you activate the virtual environment before upgrading aiofiles as otherwise it would be checking the global packages instead.

I apologize in advance for my basic knowledge about this. I just installed python and installed HA using an online guide and using it through DOS commands. Maybe this is a virtual environment? Anyway I don’t have to activate anything, I just run “py -m homeassistant --open-ui” at start up in dos to launch HA

So today, for the first time, I successfully received a push notification on my phone when the CAPTCHA question was being required by Amazon. WON-DER-FUL! I had it restore in no time. Though I’d share my configuration:

automations.yaml - Capture the event and fire notification with link to dashboard

- id: alexa_media_authentication_required
  alias: Alexa Integration Authentication Required
  trigger:
    platform: event
    event_type: alexa_media_player_relogin_required
  condition: []
  action:
  - service: notify.mobile_app_pixel_2_xl
    data:
      title: Alexa Media Integration
      message: 🔑 Authentication Required
      data:
        actions:
        - action: URI
          title: Resolve now!
          uri: /lovelace/home

That is all. It worked and I’m grateful for that new event. Thanks @alandtse!

5 Likes

It isn’t stored in the /config/ directory. It’s stored in the /config/.storage directory. You can manually delete it. I can probably fix it so it properly handles this error but you will need to manually delete it.

Workaround is to enable 2FA or hopefully someone in this state will help me debug it since I can’t reproduce it.

Glad I finally got it to a state where it worked and it finally triggered for you. Do you mind posting your setup to the wiki? The forum post will get buried too quickly.

do you have an answer for my questions also @alandtse?

It isn’t stored in the /config/ directory. It’s stored in the /config/.storage directory. You can manually delete it. I can probably fix it so it properly handles this error but you will need to manually delete it.

Thank you! I was getting mad! deleting the correct one I solved my issue!

PS. for other users renaming the file for instance adding .old for some reasons didn’t work for me. Just delete it!

Gianluca_Chiodini
Delete What? I haven’t had the pickle file in a long time and Alexa worked until I update to 114.2. Now I updated to 114.3 I get the captcha box and then the two factor and then configurator box to config which said " Please hit confirm to begin login attempt", and it keeps on repeating configurator box config which said " Please hit confirm to begin login attempt"

I tried to restore before 114.2 to 114.1 and same results
What happen to Alexa?

Not at all. Please review my suggestion and feel free to improve it in order to match your documentation standards.

No. You’re welcome to read the code to figure out when HA dropped support for 3.6 and then extrapolate the date to the component, but I don’t support old versions so won’t be looking for you.

Looks good. Thank you. I don’t really do any testing so hopefully if someone finds an issue they can adjust the wiki.