home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.09k stars 31.1k forks source link

HEOS integration clear playlist after using tts #43406

Closed paviro closed 9 months ago

paviro commented 4 years ago

The problem

When using text to speech with the HEOS integration the mp3 file will be added to the current playlist of the avr. When using tts the second time it will play the current file first and then the old one. This happens every time I use tts. So after using it for 10 times it always plays the current one and then all the previous files.

This can be solved by clearing the playlist with media_player.clear_playlist maybe this should be the default behaviour when using tts with this integration?

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

probot-home-assistant[bot] commented 4 years ago

heos documentation heos source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @andrewsayre, mind taking a look at this issue as its been labeled with an integration (heos) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

jbuggie commented 3 years ago

I'm having the same issue with just playing any mp3 via a url. It plays the media file in the link and all the previously one sent using the same media_player.play_media service. The device is HEOS 3 the first gen with latest Denon firmware

kernelpanic85 commented 3 years ago

Same issue here as well. I clear playlist manually to avoid this, but that has its own problems as I lose any spot where someone was listening to music in a playlist. Is there another solution to this without clearing the playlist? Some kind of single play that doesn't affect the current playlist?

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

yukeiw commented 3 years ago

I can confirm that this issue is not resolved.

Its still not clearing the playlist as suggested previously.

Looking forward to seeing the change. Been eagerly waiting!

Thanks for all the stuff you guys are doing.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kernelpanic85 commented 3 years ago

This is still an issue for me. I can clear playlist manually to get around it, but I would love to see a fix that changes the behavior so we don't have to clear playlist at all and a TTS notification is just inserted once into the current playlist to play.

mikalj2009 commented 2 years ago

Its an issue for me also. clearing the playlist is also sometimes buggy, making me not use TTS for notifications on the Heos system.

kernelpanic85 commented 2 years ago

Its an issue for me also. clearing the playlist is also sometimes buggy, making me not use TTS for notifications on the Heos system.

What's your alternate solution Mikal?

mikalj2009 commented 2 years ago

Its an issue for me also. clearing the playlist is also sometimes buggy, making me not use TTS for notifications on the Heos system.

What's your alternate solution Mikal?

None good, i use google home minis where available but feels redundant.

jpduhen commented 2 years ago

Same issue here, TTS all old messages are played again, makes this feature unusable, It would be great if someone could fix this issue, but understand this is one of many things on the "to to". Keep up the good work and thanks for all you guys already made possible!

kernelpanic85 commented 2 years ago

Guys, so I was poking around the code and the HEOS API and I think I have a solution, however I'm not a Python expert so not sure I can write it. Here is the pseudocode:

_play_url function gets called as usual in async_play_media call get_queue search response for any entries where "song" = "Url Stream" and store corresponding qid's call remove_fromqueue and pass qid's

I think this should essentially clear the playlist of only old Url Streams and not the entire playlist so you don't lose any music that was previously being played.

jpduhen commented 2 years ago

@kernelpanic85 hope someone with Python knowledge can help out, would be awesome!

quizzical86 commented 2 years ago

I still don't fully understand the issue. I face the same issues as the others have described above, but also for example:

1: The Heos speaker is playing a playlist from the Tidal music streaming service in shuffle mode. 2: I trigger a TTS to be played on the speaker. 3: After finishing the TTS message, the speaker plays a different song in the playlist.

Or this one:

1: I have a Tidal music playlist loaded, but then launch an internetradiostream. 2: I trigger a TTS to be played on the speaker. 3: After finishing the TTS message, the speaker starts playing songs from the Tidal playlist (rather than continuing the internetradiostream).

kernelpanic85 commented 2 years ago

Yes, agreed. There doesn't seem to be any resuming from mid-song after a TTS stream is played. From the HEOS app perspective, a TTS stream is added as another track in the current playlist so wherever you were mid-song is lost. Definitely another issue that hopefully can be fixed.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kernelpanic85 commented 2 years ago

This is still an issue along with #73620. Do we need a new maintainer of this integration? Doesn't seem like anything is getting picked up.

jpduhen commented 2 years ago

I would if I could, but alas I'm not a programmer. Seems to me the cache is not emptied, so each time you add a message TTS is going through all previous messages also. Making it useless

WebSpider commented 2 years ago

I'm faced with this issue as well, both with TTS and with any usage of mediaplayer.play_media with a URL as content id My kids at first thought it was funny the new doorbell would ring 2 times, and then 3 times and then 4 times over the speakers, but now that we're at 25, it isn't funny anymore ...

johannes-z commented 2 years ago

Same issue. The maintainer/ assigned person hasn't had any activities on GitHub since November 2021. This integration needs a new maintainer...

jim-rj commented 1 year ago

Noticed that clear playlist stopped working too on some HEOS speakers. So that workaround doesnt work anymore neither :)

Running 2022.12.06

jpduhen commented 1 year ago

If there's someone out there who has the skills and an itsybitsy time this Xmas to look into this, that woud be much appreciated! Best wishes for 2023!

WebSpider commented 1 year ago

I am new to home assistant integrations, but will have a quick peek into this over the holidays. No garuantees :)

jpduhen commented 1 year ago

NiceπŸ‘πŸ‘πŸ‘

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

WebSpider commented 1 year ago

Unfortunately, i recently had an injury, that has caused some delay. Thanks for the heads-up, stalebot :D

WebSpider commented 1 year ago

OK. So, I looked at this, and the currently used interface with HEOS does not provide a way to read the queue. I can only add stuff to the queue, and clear it.

Without knowing what's in the queue, it's going to be hard to restore the queue.

I'm going to see if the guys from pyheos are still alive.

kernelpanic85 commented 1 year ago

The HEOS API definitely has a get_queue function, so yeah maybe pyheos needs to look at this.

I'm also curious how other media players implement this. HA did add the media announce feature in 2022.6 which is documented here, I'm assuming other integrations are using it. Though, sadly it is just a flag that requires the media player to support it.

WebSpider commented 1 year ago

Yeah, it has been in the API for years, it's just not implemented by the pyheos guys.

There is one announcement implementation example that is actually useful for us: forked-daapd.

It basically has the features I was aiming at, and more (HEOS doesn't seem to support getting the exact media position, for instance)

jpduhen commented 1 year ago

Unfortunately, i recently had an injury, that has caused some delay. Thanks for the heads-up, stalebot :D

@WebSpider Everything OK now I hope?

quizzical86 commented 1 year ago

It basically has the features I was aiming at, and more (HEOS doesn't seem to support getting the exact media position, for instance)

Thanks for looking into the playlist issue @WebSpider and I hope your injury wasn't too bad!

I notice that the spotify Home Assistant integration (that controls my HEOS devices when I play spotify music) does show the exact media position and does support seeking in the track. So somehow spotify is able to communicate those things with HEOS.

WebSpider commented 1 year ago

@quizzical86 let's just say coding and sports don't mix :smile: broken shoulder.

I will look into how Spotify does that, and see if we can use it for our benefit. Thanks for the pointer!

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

WebSpider commented 1 year ago

/unstale

kernelpanic85 commented 1 year ago

Thanks @WebSpider. Have you had any luck looking into this?

jpduhen commented 1 year ago

Hope you're able to find a way to get this working, would be very nice πŸ‘

WebSpider commented 1 year ago

Thanks @WebSpider. Have you had any luck looking into this?

Yeah, but I think I'm trying to hard to make it perfect first time around. All the different sources and thinkable edge cases, etc I'll try your approach to filter out anything with a TTS URL in the queue in a few days.

JBenson74 commented 1 year ago

I'm just dipping my toes into TTS now that "year of the voice" is in full swing and have run into this limitation, too. I'm glad to see it's already being looked into.

mutasim commented 1 year ago

@WebSpider thanks for the taking a look at this - also looking forward to this.

avocadio commented 1 year ago

https://github.com/music-assistant/hass-music-assistant has a very good support (whilst still being beta) - you may get TTS working by interfacing with a script.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kernelpanic85 commented 1 year ago

Still here waiting and hoping this will get fixed!

quizzical86 commented 1 year ago

Same here ☺️

JBenson74 commented 1 year ago

ditto πŸ™‹πŸ»β€β™‚οΈ

On Fri, Oct 27, 2023 at 4:32β€―AM quizzical86 @.***> wrote:

Same here ☺️

β€” Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/43406#issuecomment-1781778650, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQSK3LNNNYZUSD4JIG2E3LYBK3DRAVCNFSM4T34OU62U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGE3TOOBWGUYA . You are receiving this because you commented.Message ID: @.***>

issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kernelpanic85 commented 10 months ago

This is still an issue and hoping someone will fix it!

jpduhen commented 10 months ago

Yes, I hope this will be resolved too!

MrHollowPS commented 9 months ago

It's been 3 years and still there is no fix? Come on man.

WebSpider commented 9 months ago

People have a life. And it's not always about home-assistant. I'm unsubscribing from this issue.