PSA: Alexa Media Player v4.13.3 breaks all versions of Home Assistant

If I have to replace all of my Echo devices, I won’t be able to afford socks.

2 Likes

I can confirm that 4.13.4. fixed the issue.
Before 4.13.4. I had “Out of memory: Killed Process” bootloops within minutes, which is not the case any more, since I updated to 4.13.4.

Further more it is explicitly mentioned in their release notes:
“* Fix infinite loop and memory exhaustion”

@petro This is awesome but isn’t it risky to integrate it into core when the API being used is “unofficial and may change at any time”? Also, it appears that AMP often breaks - I assume - due to changes made by Amazon. If that is the case, wouldn’t making it part of core just slow down the devs’ ability to fix the issues?

I have over a dozen Echos around the house and use them exclusively for TTS vocal alerts, and HA control. I therefore use AMP just to play the alerts. I wonder whether a “light / lite” version that only does TTS would help mitigate the burden on Amazon servers to avoid another Chamberlain style debacle. Maybe, at this point, one could integrate the lite version in core and keep the full featured version in HACS (still assuming the latter would break more often and/or cause more issues, such as traffic, to Amazon servers).

PS: Actually I am not even sure I use AMP at all given I do everything in Node Red and have an Alexa integration within NR node-red-contrib-alexa-remote2-applestrudel… I’ll disable AMP and see if my alerts keep working.

1 Like

That’s a risk, just like many other integrations built in core. From what I can tell, the auth process is really the only thing in danger of changing frequently and it’s because we have to parse html pages in order to perform the login.

If you’re talking about the changes in the past year, that assumption is false. Alexa Media Player has been broken largely because it abuses the Home Assistant API in a volitile way. Recently, Home Assistant has been putting in safety checks to stop miss use of the API and it has been been causing Alexa Media Player to break.

This is all I use AMP for as well. Same for the other people who are working on the new integration. That’s largy why our focus is TTS first, media playing and other features second.

5 Likes

I’ve noticed all the updates forcing improvements such as the removal of blocking code, etc. Very happy to see it happen, and to hear that the AMP integration issues were mostly caused by its misuse of the HA API as that can be corrected / controlled more easily than what Amazon decides to do on its end. Maybe, once we reach 100 million users and above… :wink:

I would agree with this assessment. Making an integration to serve TTS will satisfy a HUGE majority of the users who use AMP. If it provides TTS and basic media control I’d switch to it.

But I also intend to throw Alexa out in lieu of my own voice assistant within 8 mo. I have no intention to pay for advanced ai driven Alexa and expect the non AI user experience to deteriorate quickly after they switch. So she’s already on borrowed time as far as aim concerned…

4 Likes

I’m reverting to 4.13.2 as that is the one version that was working prior to the 4.13.3 debacle.

When you say ‘lock’ it on your system, do you mean that you will ignore requests to update, or can you disable notification for updates ? If so, can you advice how this is done. Thxs

Just click the ignore button when the update appears.

2 Likes

I am in the same boat as you. Alexa is just a transport mechanism for verbal engagement with HA. If you could, let me know how you made out with this.

4.13.4 seems to be fine.

AMP is critical for me. I send HA commands (or questions) via AMP and HA may send me a response/ result via AMP. Without this integration a significant part of my HA implementation would stop functioning.

I do use it for notifications as well - but the most vital part of the ability to send HA commands via Alexa (AMP). (You can run HA scripts via Alexa voice commands)

I think a large number of users make use of this feature. Last year Amazon made a change that made it very hard the identify which Alexa recieved the command - so HA didn’t know which echo to use to send a response to. The response within the community was significant (which is why I think this feature is heavily used) Some clever HA community members figured out a way to circumvent Amazon’s changes and still retrieve this information though and kept the integration going. (thanks!!)

I’d definitely volunteer to help maintain this, but the technical skills likely exceed my abilities. Maybe when I get a test environment running I’ll volunteer to test.

1 Like

Isn’t this part of the base integration? I just expose my scripts. no AMP necessary.

Can the base integration identify which echo device that the command came from so that ha can respond to the appropriate device? For example, if I say to Alexa - what’s the weather in the back yard? That invokes an ha script and ha responds to the same device (I have 35 echo devices) with the amount of rain in the last hour, my hot tub temperature, and yard temperature.

If this can be done, how does it identify the originating echo device?

I’d be very pleased if this could be done through the base functionality as I feel at risk relying so much on AMP.

If you expose temp and humidity sensors from HA to Alexa and you group them in backyard in Alexa, then all she does is query the sensors from the device you talked to.

It doesn’t need to identify anything because you’re only dealing with Alexa at that point.

Ok, I used an overly simplistic example above to illustrate the point of having Alexa call HA scripts and then respond to the calling device.

I call HA scripts for things Alexa cannot easily do - such as more sophisticated logic (alexa has no inherent if-then-else capability). My temperature call for example lists certain pre-defined sensor values, and then also gives some that are outside of defined limits (limits that change depending upon where I physically am - eg limits that are different if I’m out of the country vs in the city or at home), it then looks to see if we have a foster dog at home and if either of our 2 gates are open and gives a warning on which gate is open (and for how long) and to be careful if we are letting the dog out.

Alexa is fine for simple things, it is the richness of HA that gives rise to having Alexa hand over tasks to HA to handle. Under HA I can readily enhance the logic of my scripts to handle more complex requirements. Editing lengthy routines in Alexa is painfully slow and cumbersome.

You can still run scripts by linking them to input booleans and using them as signals. There’s a number of ways to do what you want without alexa media player.

The only advantages alexa media player has at this moment is TTS, media_playing, and using alexa-only devices in HA (which can be worked around).

You can even build custom utterances with alexa smart home skill to fire things based on custom phrases.

Can you please describe a few of these ways of using Alexa to do this without AMP? I’d like to start looking at these in case AMP goes away.

Expose an input_boolean as a boolean sensor from the alexa configuration page on alexa cloud. It will allow you to action off of it “opening” or “closing”. So you’d just make a custom phrase that turns on or off that boolean, which runs the routine. And then you just need an automation that flicks the boolean back off in HA.

Using Alexa Smart Home Skill to create utterances is harder, however it gives you way more control. And you need to create an AWS developer account. There’s a guide on the Alexa Smart Home Skill integration page.

The trade off here is that you never have to manage or deal with the responding alexa but it’s harder to set up initially.

Let’s try and use this with regards to my example. Alexa has responded to my query about the predefined sensors and is now answering the ones that need to be evaluated based upon logic parameters within HA. Where does the input boolean come into play?

If an Alexa routine turns the boolean on or off, how does that help me? I’m missing something here. I gather shreds turned it on of I ask about the weather, but then what does HA do with it?

Right now HA is evaluating a number of conditions and creating a message accordingly, (when prompted by Alexa) which it then passes to Alexa. I’m not understanding the role of that input boolean in this use case?

I’m assuming I’m thinking of this wrong to make it work without AMP. Could you provide a bit more direction please?

Thx

You have 2 routines in alexa. One that is invoked with a custom phrase, in your example, you’d “query about the predefined sesnors”. This will simply turn the input boolean on.

Your automation then turns the input boolean off.

You have a second routine that runs when the input boolean is turned off in alexa, and you have it report everything you want it to report through alexa.

Your automation in HA will run the calculations to update sensors that alexa sees. So alexa will just announce the values of the sensors in the second routine.

So a sensor would contain the text of the message?

Eg - “I see you have a foster dog in the house, so note that the east gate is open. Also, we received 5mm of rain in the last hour, the wind speed is gusting to 20kph so it will be muddy and miserable outside”

Then I have Alexa give the state of that sensor?