Closed broyuken closed 1 year ago
Here homeassistant.update_entity
is working sometimes. I seems that it is only working some minutes after starting a timer and some minutes or hours.
Ok, obviously the timers are not supported in the interface by amazon any more. So I deactivated all entities and took them out of the views. As I had no further automation on these entities, it is ok for me. It was sometimes nice to see, that a timer is active but so what... The issue with the media players is more relevant but works for my with my workaround see 14 posts above. In addition to that I relaod alexa once a night. That clears the entities from old states which are no longer correct.
If everything stayed like this..I can live with it. I hope that amazon will not reduce further functions because reminders and alarms have a relevance for me.
Same issue here. Restarting the service once a day (it is part of a morning routine I run atomically) helped for some time, but now also this is not anymore the case :(
Ok, obviously the timers are not supported in the interface by amazon any more. So I deactivated all entities and took them out of the views. As I had no further automation on these entities, it is ok for me. It was sometimes nice to see, that a timer is active but so what... The issue with the media players is more relevant but works for my with my workaround see 14 posts above. In addition to that I relaod alexa once a night. That clears the entities from old states which are no longer correct.
If everything stayed like this..I can live with it. I hope that amazon will not reduce further functions because reminders and alarms have a relevance for me.
I solved my personal issue of alarms with restarting the instance periodically. Therefore removing the entitys would be not the best solution for some of us.
I understood amazon skipped the event based functionality of reporting entity values. But by restarting the integration it is still possible to read the current alarm values. => why not implementing a poll function which peroidically requests the values. Or make a service availabe for the useres to force updating the values manually?
Today I noticed that I am having the same issue where the media player (Alexa) status isn't updating for any of its attributes unless the entity is reloaded manually. Ive created an automation to overcome this by making the trigger for any status change in the media player to reload the "Home Assistant Core Integration: Update entity". This works but isn't really a solution.
=> why not implementing a poll function which peroidically requests the values. Or make a service availabe for the useres to force updating the values manually?
https://github.com/custom-components/alexa_media_player/issues/1953#issuecomment-1652111938
I wish there was a way to sticky a post.
Just to add a bit of context:
My HA setup shows the same issue, so I implemented a periodical update_entity–thanks for the idea!
Looking at the logs, it would appear that media_position is updated every 20 seconds or so as long as a track is playing, but when the track ends and a new one starts, the updating stops. (I was thinking of creating an automation that would trigger update_entity when media_duration equals media_position, but alas no such luck.)
I guess you could somehow calculate the right moment to trigger an update by comparing media_duration, media_position and media_position_updated_at?
I already tried to use update_entity EG after starting a timer or after the timer is finished. But without success. The update_entity ist not reliable and not pulling the right state most of the time. Even without error it is only delivering the right state sometimes. In the example e.g. only random 5-15 minutes after starting or ending a timer. Why ever.
I already tried to use update_entity EG after starting a timer or after the timer is finished. But without success. The update_entity ist not reliable and not pulling the right state most of the time. Even without error it is only delivering the right state sometimes. In the example e.g. only random 5-15 minutes after starting or ending a timer. Why ever.
Did you use > homeassistant.reload_config_entry
same problem. the solution to reload the integration is not reliable because after several reloads the integration becomes unavailable. and I need the exact information instantly like before for automations.
Same for me. I cannot say when exactly it started, but not that long ago, couple of days I think. All Alexa devices (Echo Dots and Fire TV Cube) do not anymore show that/what is currently being played. With manually reloading the integration or e.g. pressing a switch of the device in HA I sometimes then get the current information being displayed, but practically it does not work anymore (after using it for a long time without any issues). In HA everything looks normal and I can't recall to have changed something that could be the root cause of this.
Same here. Will wait for updates. If any help is needed, please reach out.
Same problem. Will be possible to solve it somehow?
Seems that this integration is going to be abandoned very soon, when such fundamental issues are not fixed anymore. I really loved it.
Seems that this integration is going to be abandoned very soon, when such fundamental issues are not fixed anymore. I really loved it.
I agree, I’m hoping that nabu casa comes out with some hardware at the end of the year of the voice to compete with Alexa, then we can let this integration die
I agree, I’m hoping that nabu casa comes out with some hardware at the end of the year of the voice to compete with Alexa, then we can let this integration die
You seem to have misunderstood something here.
This custom component is not used to transmit voice commands to Home Assistant. This custom component is used to control Amazon Alexa and Amazon Echo devices.
Voice commands are transmitted to Home Assistant via the Nabu Casa Skill and the Nabu Casa Cloud.
I don’t misunderstand anything. This is the year of the voice, and my hope is that they come up with hardware that communicates directly with THEIR assist assistant so I can get rid of my Alexa devices and their reliance on Amazon and their cloud services to work.
This is the year of the voice, and my hope is that they come up with hardware that communicates directly
I dont think thats going to happen anytime soon :(
This is the year of the voice, and my hope is that they come up with hardware that communicates directly
I dont think thats going to happen anytime soon :(
Why not? They already have voice integrated with a number of other devices. All they need to implement is a wake word and we’re in business. The Muse LUXE speaker already exists, running esphome firmware. I think it’s very reasonable to expect something like this.
Eventually yes. But the wake word is the super hard part apparently
but for now, still having problems with Alexa Media Player and entities that are not updating... What a shame to no longer see the music, alarms and other things!
This might help someone that uses Spotify and Node Red I used the swtich node to get the source
This might help someone that uses Spotify and Node Red I used the swtich node to get the source
Either you're bot/troll, or you got mistaken with the issue.
LOL ok... or it depends on how you're using the states. I use it for follow me music. I'm saying, that if you're using it to get the media state on a specific Spotify device. You can use a switch node to pass that info along.
Its not for every use case, I said that :)
And why would you go to the trouble of creating a template sensor for something as simple as passing a state attribute ;)
LOL ok... or it depends on how you're using the states. I use it for follow me music. I'm saying, that if you're using it to get the media state on a specific Spotify device. You can use a switch node to pass that info along.
Its not for every use case, I said that :)
And why would you go to the trouble of creating a template sensor for something as simple as passing a state attribute ;)
Still don't need NodeRED for it. I'm saying because I used to use RED extensively in the past.
For our problem: state doesn't have an update AT ALL, so no changes to attributes as well...
But you can still use Node-RED here as a (temporary) workaround to get the events.
This is done with the node-red-contrib-alexa-remote2-applestrudel node, which gets its functionality from the alexa-remote2 lib.
And this alexa-remote2 lib is mostly updated in time by its developer when changes from Amazon cause problems. Like the ones from the last few weeks. You only have to activate the events in the settings of the node, because this is deactivated by default.
As a bridge between Node-RED and Home Assistant you can use MQTT or the node-red-contrib-home-assistant-websocket node.
Got you. So NodeRED lib works at least.
Not that I want to do it, as it will require to re-do everything related to Alexa.. but I see your point!
What I'm saying is its clear this integration is dead. The dev does not want to fix it, so we all need to figure out other ways to make get the state values we need.
I know its a hassle, I've brought this guy a "coffee" before. But that's just the way it goes. I got a couple of great years out of it, so it was worth it. Now we have to figure out something else. If I was a dev, believe me I would have been fixing this already LOL.
Let's ask @alandtse if this is something that's on roadmap. Last release was 3 days ago - so maybe it's not lost yet.
Given the trends, I'm expecting for Amazon to shut down the ecosystem soon. So not in my roadmap but I will take PRs of people figure it out without just spiking the polling. That's why it's tagged as help wanted.
@alandtse thanks for quick reply. I understand, that Amazon can shut that door once and forever (given it's still open, of course)... It's been a while since I was tinkering with Python, but I'll try to dig it a bit, if you put my face in most low-level API file, please. :)
Can I just ask as well, when you say ecosystem. Are you talking about the media player portion of that? So Alexa will stop allowing people to play music. Or the whole thing?
This integration is using unofficial API. It's nothing to do with Alexa functionality - it's about third-party access to Alexa functions. And it's not guaranteed to work in any way.
Ahh ok got ya. thanks :)
Openhab has also currently issues with their integration (Last Voice command no longer reported), and one of the maintainers said its due to Amazon is no longer reporting last voice command state changes via websocket. Instead Amazon is now reporting via HTTP/2 stream. Could it be that this linked, and the same is true for the media player states?
Seems you are right, in fact the "alexa-remote" project (javascript based api) switched to HTTP2 streams a few weeks ago https://github.com/Apollon77/alexa-remote/releases/tag/v6.0.0
an interesting fact is that this project "alexa media player" is using the python package "alexapy" (https://gitlab.com/keatontaylor/alexapy) which is based on the "alexa-remote" mentioned above
there are some python projects implementing https2 streams, e.g. https://github.com/python-hyper/h2 however
however seems a complex change
Hopefully someone smarter than I can put in a PR to bring back this functionality. This sounds likely that this is the cause of the issues we're all experiencing. If there's anything I can do to assist I will gladly, but python is a little outside of my ability.
I tried proposed NodeRED alternative - and it's actually lightning-fast in TTS announcements, skills like Actionable Notifications etc. No subscriptions though, as far as I understand. So returning to status-quo would be preferable - and then I can slowly move some functionality, not related to media player itself, to NodeRED. :)
Ive never not used Node Red, got into it early on and never looked back lol.
I dont think I gave enough info on how Im using it.
This is one example. So now that Alexa devices no longer reliably report current state as checks, I'm now using Spotify entity and then the switch node to filter for Alexa devices.
But the TTS is also great, I use it to let me know when prints are finished, % of prints, that particular windows need to be closed before turning on the aircon, washing machines finished, I could go on lol
What do you mean by subscriptions?
I mean push state updates. Exactly what we've lost here :)
https://github.com/Apollon77/alexa-remote/compare/v5.10.3...v6.0.0 shows the changes to enable http2 pushes. Unfortunately, alexapy is built on aiohttp, which does not support http2.
Httpx does support http2. However, swapping from aiohttp to httpx is a large undertaking. Perhaps it can be done by just replacing the websocket with httpx. If someone submits a PR to gitlab to address this, ping me here. I don't check gitlab anymore.
I tried proposed NodeRED alternative - and it's actually lightning-fast in TTS announcements, skills like Actionable Notifications etc. No subscriptions though, as far as I understand. So returning to status-quo would be preferable - and then I can slowly move some functionality, not related to media player itself, to NodeRED. :)
Does Node Red show last_called and timers?
I tried proposed NodeRED alternative - and it's actually lightning-fast in TTS announcements, skills like Actionable Notifications etc. No subscriptions though, as far as I understand. So returning to status-quo would be preferable - and then I can slowly move some functionality, not related to media player itself, to NodeRED. :)
Does Node Red show last_called and timers?
Last called can be retrieved by getting Activities and picking the latest one. It does even tell what was the request.
Timers/alarms are returned with Notifications for device.
You can play with it yourself, it's easy.
I tried proposed NodeRED alternative - and it's actually lightning-fast in TTS announcements, skills like Actionable Notifications etc. No subscriptions though, as far as I understand. So returning to status-quo would be preferable - and then I can slowly move some functionality, not related to media player itself, to NodeRED. :)
Does Node Red show last_called and timers?
Last called can be retrieved by getting Activities and picking the latest one. It does even tell what was the request.
Timers/alarms are returned with Notifications for device.
You can play with it yourself, it's easy.
Any YouTube/other guides you recommend? I’ve never played around with node red before
I tried proposed NodeRED alternative - and it's actually lightning-fast in TTS announcements, skills like Actionable Notifications etc. No subscriptions though, as far as I understand. So returning to status-quo would be preferable - and then I can slowly move some functionality, not related to media player itself, to NodeRED. :)
Does Node Red show last_called and timers?
Last called can be retrieved by getting Activities and picking the latest one. It does even tell what was the request.
Timers/alarms are returned with Notifications for device.
You can play with it yourself, it's easy.
Any YouTube/other guides you recommend? I’ve never played around with node red before
Here you go, one of my favourite YouTubers: https://youtu.be/hBEb_FCLRU8?si=7YoE6HbN9ExgtijF
This fixes this problem for me. It reloads all my Alexas every 30 seconds. Replace my alexa entities with your own and you are good to go.
alias: Home | Reload all Alexas description: "" trigger: - platform: time_pattern hours: "*" minutes: "*" seconds: /30 condition: [] action: - service: homeassistant.reload_config_entry data: {} target: entity_id: - media_player.lounge - media_player.echo_isabella - media_player.echo_dot_bathroom - media_player.echo_dot_bedroom - media_player.echo_show - media_player.echo_living_room mode: single
Great it works for you. However, it's partial, and really bug-prone solution. Also, you don't need to put all entities there - they all are under one config entry, so putting one media player I'd would be enough to reload all of them.
P.S. also, while it's reloading, devices are unavailable - and some automations, that use these devices, can be broken. I'm assuming you're not using Alexa for important TTS notifications.
@formatBCE New to Node Red here, installed and configured based on your video recommendation (thanks!). Is there a way to set up a trigger for an Alexa timer being set? I looked at the device trigger node, but it doesn't seem to be what I need.
@formatBCE New to Node Red here, installed and configured based on your video recommendation (thanks!). Is there a way to set up a trigger for an Alexa timer being set? I looked at the device trigger node, but it doesn't seem to be what I need.
That's what issue currently is about. You see, there's two types of dealing with information updates: pushing and polling. Pushing is great, and allows information to update as it goes (like, timer was set -> you received push trigger on it). But it requires Alexa to have a mechanism for subscription to that updates. That's what has changed lately - and that's why this integration doesn't work. In case of NodeRED and Alexa integration - I don't see any signs of push subscription possibility. So you'd have to use polling.
Polling is easier to do, but it has huge disadvantages:
Long story short: you can poll. No push. I won't recommend that. :)
@formatBCE Ah, thanks. I was hoping NodeRED would let me get around the issue, but not in my case. Bummer.
I wish it was easier to set up an environment to write addons for HA, then I might be able to look into the aiohttp to httpx conversion and help out with the plugin. I'm primarily a web developer and I'm used to working with C#, PHP, and JavaScript, but I have a tiny bit of Python experience. I keep thinking of helping out, but the barrier to entry seems pretty high.
@Kethlak well, you don't need to write add-on in this case - it's just custom integration, so basically you can test it by changing the code directly inside of custom_components folder in Home Assistant. :)
The hardest part, I guess, is tinkering with your own Amazon account...
IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.
Describe the bug
Media Player entities go stale after a few hours. If I start playing media either with my voice, or by having a routine triggered my HA media player entities don't know about it and just says standby. Or if media has been playing for a while and I stop it, the media player entity will still show it playing. Reloading the integration with kick things and get them showing the correct status again for a little while To Reproduce
Expected behavior
Media player should show current status of media player entities Screenshots
System details
const.py
or HA startup): 4.6.4pip show alexapy
or HA startup): 1.26.8Logs Please provide logs. These debug logs begin at 9:08 when I run my "soundmachineon" routine which plays white noise on amazon music and didn't update the status until 9:09 when I reloaded alexa media player. Ignore the BROKEN_TUYA lines, they were filling up my logs so I did a find/replace to get rid of them.
alexa_logs.txt