KoljaWindeler / ytube_music_player

YouTube music player for homeassistant
334 stars 53 forks source link

ytube_music_player detecting music via OK Google? #306

Closed maxpd1 closed 7 months ago

maxpd1 commented 7 months ago

Is your feature request related to a problem? Please describe. I want to achieve the following:

I mainly use iobroker as smart home system. Unfortunately if music is playing via chromecast devices and a notification is incoming, music will be stopped and doesn’t turn on again. There is no YouTube Music integration which has an OAuth to get a URL of played file.

Because of that I set up Home Assistant. with KoljaWindeler/ytube_music_player

But I seem to face some limitation:

Am I right, that if we start playing music initiated by voice (OK Google) ytube_music_player isn’t detecting this kind of music and stays turned off. So I can’t stop and turn on music again after a separate mp3 notification was spoken?

Describe the solution you'd like

If you turn on music via OK Google keyword it is detected by the chromecast device in HASS. This should be transfered to ytube_music which hast the OAuth connection and the mp3 URL to stop and continue the music even if another mp3 was played in the meantime

Describe alternatives you've considered

Or can I transfer these information from the HASS auto detected chromecast devices, which show the playing title and all the information?

KoljaWindeler commented 7 months ago

Hi I don't think that what try to do is possible.

when you start music via voice prompt to a Google home.device, it will start the built-in Ytube music app on that device. There is no way for Homeassistent or me to get the URL from that track.

The only way would be to get the exposed data like artist and title and search for that. After an interrupt you could run a script to search and play the first result. You can also seek to that position but all other information like the playlist etc are gone at that point.

So no real solution. I'll close this ticket as I don't see a way to implement this

bobzer commented 7 months ago

i guess this can help you : https://community.home-assistant.io/t/script-to-resume-google-cast-devices-after-they-have-been-interrupted-by-any-action/383896

maxpd1 commented 7 months ago

i guess this can help you : https://community.home-assistant.io/t/script-to-resume-google-cast-devices-after-they-have-been-interrupted-by-any-action/383896

nope:

YouTube and YouTube music will only resume the video/song which was playing at the time of the interruption, and only on players with a screen if not started using the ytube_music_player custom integration.

Resume can be performed in case the custom YouTube Music player integration is used to play the media. And only when YouTube music was started using that custom integration

Can't somebody contact YTM that they need an API? I used feedback option in app a dozen times to tell it to them.