Echos Stopped Reporting

As of last night, my echos stopped reporting to status and updates to HA. In the past, I could reload the integration, and it would begin working. It does not seem to be working this time. The echos will run a script, but none of the device’s entity data is being updated.

What does your log say?

2023-10-26 06:05:37.350 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**************l@g*******m: Refreshing

2023-10-26 06:05:37.351 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**************l@gm: Kaylie’s Room: Last_called check: self: f*********************f79 reported:

2023-10-26 06:05:37.515 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**************l@g*******m: Refreshing

2023-10-26 06:05:37.515 DEBUG (MainThread) [custom_components.alexa_media.media_player] j*********l@gm: Garage Echo: Last_called check: self: G4VV reported:

2023-10-26 06:05:37.708 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**************l@g*******m: Refreshing

2023-10-26 06:05:37.708 DEBUG (MainThread) [custom_components.alexa_media.media_player] j**************l@gm: Home Theater: Last_called check: self: f*********************cd4 reported:

2023-10-26 06:05:37.781 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: No first item, sequence was empty. when rendering ‘{{ states.media_player | selectattr(‘attributes.last_called’,‘eq’,true) | map(attribute=‘entity_id’) | first }}’

I started experiencing this problem on Oct 25th. Have you find a solution?
I manually call the service alexa_media.update_last_called but all my devices show ‘null’ on the last_called attribute.

image

The sensor last_alexa is returning the same error (no first item) and it’s because none of the devices have the attribute as ‘true’

Thanks.

No, and no one seems to have even the slightest idea of whats going on. I used it for a LOT of my automations.

This custom integration has always been based on an unofficial API and subject to the whims of Amazon… it’s literally the first thing said in the Read Me. As a custom integration, not maintained by the core Home Assistant dev team, the best place for questions and issues is the Alexa Media Player Github repository.

As has been covered on the Github Issue you are a part of, Amazon effectively turned off the API endpoint that the Alexa Media Player custom integration uses to get that information… this is not the first time they have made this kind of breaking change without warning (it’s not even the first time in the last six months).

There are people trying to find a fix, but there’s no guarantee that will be possible. Even if it is, it may break again or be so slow as to be practically useless for some of the things we have used the integration for in the past.

1 Like

Thanks for pointing out to me that its in the Read Me. I was not asking someone to fix it, just someone to say, “hey, it’s broke and it isn’t going to be fixed”, “we’re working on it”… something. But there was nothing but conjecture. Nor was I looking for someone to point out that I looked in more than one spot for the answer.

Passive aggressiveness was not quite what I was looking for, and not really called for. Thanks for your input.

1 Like

Try not to whinge…The github issue explains it clearly. Which is a week old.

Thanks @Didgeridrew for pointing out the github article.

Had to do a bit of searching to find this page.

For others:

I used it in a template sensor:

template:

  - sensor:
      - name: "last_alexa"
        state: >
          {{ states.media_player | selectattr('attributes.last_called', 'eq', True) | map(attribute='entity_id') | first }}
        availability: >
          {{ states.media_player | selectattr('attributes.last_called', 'eq', True) | first is defined }}

Hopefully be fixed in a bit :slight_smile:

A fix that is working for me was posted 3 hours ago on a fork of the alexa_media_player repo on GitHub. At the time of this post one has to manually replace the alexaapi.py file with a revised version. The function of the alexa_media.update_last_called and notify.alexa_media_last_called services is restored by this fix.

1 Like

Confirming that works Joe. Gotta love the OSC. Imagine that’ll be added to the next alexa int release.

For anyone that can’t wait for the release, this will get you back up and running:

connect to HA docker container with:
docker exec -it homeassistant /bin/bash

Go here and press the “Copy file contents” button
https://gitlab.com/Fredo70/alexapy/-/blob/dev/alexapy/alexaapi.py?ref_type=heads

Go back to docker container shell and run(where python3.11 is your python version):

 cd /usr/local/lib/python3.11/site-packages/alexapy
 cp alexaapi.py{,-bak}

vi alexaapi.py then clear file(:%d) and Insert(paste) clipboard contents and save, exit

Logout of HA container and restart HA container
docker restart homeassistant

working!

No warranties :tm:

Great use of your ‘word of the day’!

That sensor template is old and not part of the topic, but thanks for trolling.