Youtube Music - Media Browser

Works without problems. Thank you!!

1 Like

Working again here with the HOTFIX, thanks!

1 Like

Top job working great

Hi, I just discovered the service ‘ytube_music_player.start_radio’. When I start the radio, the current track stops and the new playlist starts. So far so good.

Problem, or question, is: Is it possible to let the current track finish playing and then start with the new playlist? I often listen to the Supermix or Discovery Mix and use this feature when I like a track or style. But then it is annoying when the track suddenly stops.

Afternoon,

I set up my YT music player some time ago, I am now confused, for instance, it always reverts to some old non-existent/Duplicate speaker as a default, how do I set a default speaker? Secondly I have an automation that invokes a script

- alias: MorningSongs
  trigger:
    platform: sun
    event: sunrise
    offset: +00:01:00
  condition:
    - condition: time
    
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
  action:
  - service: script.yt_player_start
   
    data:
      speakers: media_player.googlehome6966
      source: playlist
      name: Good Morning Coronas 

the challenge is that I cant find the scropt called yt_player_start under the scripts.yaml file, so I am wondering how this seems to work apart from starting it on some old non-existent media player.

Please assist, for default speaker, and where to get the script??

Regards
Khazi

For the default speaker, go into the integration and click configure again. That is on the first page.
I can’t help with the script.

1 Like

I use this automation to play a specific playlist on a specific Google Home device (in my case, a group of Minis and Chromecasts). You just need to customize the trigger, the playlist ID and the entity of the Google Home according to your setup.

alias: play musik
trigger:
  # your trigger
action:
  # set target
  - service: media_player.select_source
    data:
      source: ... # google home entity id
    target:
      entity_id: media_player.ytube_music_player
  # set mode to shuffle
  - service: media_player.shuffle_set
    data:
      shuffle: true
      entity_id: media_player.ytube_music_player 
  # set playlist and start play
  - service: media_player.play_media
    data:
      media_content_id: ... # playlist id here
      media_content_type: playlist
    target:
      entity_id: media_player.ytube_music_player

I can’t tell you where your script is located. But actually this is not necessary.

1 Like


Man … I would have killed to get something like that when I was 6 :smiley:

3 Likes

Reading the release notes of yesterday make me wonder if Sonos is now capable of playing YouTube streams … did anyone test that already?

I will try it now!
Update: when i use your component i still get the same error.
Now i will try it with the service option.
second update:
still the same error:

Kan service media_player.play_media niet aanroepen Error calling SonosMediaPlayerEntity.play_media on media_player.zolder: UPnP Error 714 received: Illegal MIME-Type from IPADRES

hmm too bad … if you want to play around: you can change this line https://github.com/KoljaWindeler/ytube_music_player/blob/418b3bcdca1434f03e8ea789ddbbb7f35d5ee569/custom_components/ytube_music_player/media_player.py#L1299 to something like “mp3” and see if that helps …

apart from that: I like the option to have an iframe with pre_choosen browser section

i have tried but nothing helps. It still gaves the “UPnP Error 714 received: Illegal MIME-Type from” error. For Sonos there is at the moment no other option then select in the sonos app a youtube album/playlist as favorite and then play them by the sonos integration.

@JKW I would like to ask here again if this is possible.

I am asking if there is a way to use the ytube_music_player.search service inside a lovelace card and, if yes, how…

How to have this?

Hey all

I’m new to Home Assistant and this custom component, so forgive me if my question/request is obvious or already exists.

I have the component set up and working and I can browse music and play it to my tv/google home(s). I did, however, notice when pulling up a playlist, the tracks are in alphabetical order instead of the order defined on YouTube music. Is there a setting I need to adjust somewhere, or a way in general, to have the tracks in the “correct” order?

I think I figured it out actually.

Configuration > Devices & Services > Integrations > yTubeMusic > Configure > check ‘Show advance configuration’ > Submit > uncheck ‘turn on shuffle at startup’ and uncheck ‘Sort results in the media browser’

After doing this, playlists seem to be loading in the “correct” order.

3 Likes

I am getting this when i open the dropdown with the playlists:

Is there any way to fix this?

Not really … homeassistant is showing the list … I’d suggest to use the media browser
JKW

Why it happens only with youtube music player?