Youtube Music - Media Browser

I am able to play back from http://192.168.1.xxx:8123/local or any other external url.
But on the other hand i have the same issue when i try to TTS into this media_player, i get the same error as your integration.

I havent tryied the sonos/proxy mode, I will give it a got in 10 hours or so.

Thank you.

Iā€™m trying to implement a search option via Lovelace but having a bit of trouble. I created an input_text and then can successfully call the search service from the dev tool, but using that in Lovelace isnā€™t working.

input_text:
  ytube_music_player_search:
    name: YouTube Music Search
    icon: mdi:magnify

From dev tool, this works correctly:

service: ytube_music_player.search
data:
  entity_id: media_player.ytube_music_player
  query: "{{  states('input_text.ytube_music_player_search')  }}"

Lovelace:

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_text.ytube_music_player_search
    show_header_toggle: false
  - type: button
    tap_action:
      action: call-service
      service: ytube_music_player.search
      service_data:
        entity_id: media_player.ytube_music_player
        query: '{{  states(''input_text.ytube_music_player_search'')  }}'
      target: {}
    show_name: false
    show_icon: true
    icon: mdi:magnify
    icon_height: 50px

The lovelace search isnā€™t working properly and give me this in the Media Browser:
image

I also tried with just input_text.ytube_music_player_search for the query but that had the same result.

Any ideas how to fix this?

1 Like

Hi, firstly - great add-on!

I am using mini-media-player and have two questions reagarding to use Ytube Music in it:

  1. is there possibility to have currently chosen playlist name on the button? Something like:
shortcuts:
  buttons:
    - name: {{input_select.ytube_music_player_playlist}}
    - ...
  1. I can not find, is there possibility to use mini-media-player buttons to play playlist chosen via helper. If it is possilbe, how the code should looks like? (I found only examples without buttons or with buttons but with playlist harcoded). I use other buttons to start other radios.

hi QbaF, as per my understanding your number 1 question is really a question for mini-media-player but I had a similar question a while back that might solve your usecase: https://github.com/kalkih/mini-media-player/issues/471

regarding question 2: so you want to select a playlist in a drop down and then hit a ā€œplayā€ button on the mini-media-player to start playing the selected playlist, correct? isnā€™t that simply possible by hitting the ā€œpower onā€ button?

JKW

honestly ā€¦that should be possible but iā€™m not a script guy :smiley: ā€¦ did you figure it out?

I gave a try config-template-card. Unfortunately no success. It even did not want to save changes. Maybe something wrong with my code. Most probably because the type is used for mmp buttons;)

    - name: "${states['input_select.ytube_music_player_playlist'].state}"
      type: 'custom:config-template-card'

I asked this add-on forum/developer, maybe there will be some solution.

Regarding Q2: I meant I want to select the playlist in a drop down and then hit the mmp button (no play icon)
image

Ad. 1. - It is possible I made it works. You have to use it as:

type: custom:config-template-card

entities:    # to bo honest I am not sure why here have to be entities if the are below as well, but looks like it is syntax
  -
  -
  ...

card:
  type: entities
  entities:
    - entity: media_player.ytoube_music
      type: custom:mini-media-player
      ...
      shortcuts:
        buttons:
          - name: ${states['input_select.ytube_music_player_playlist'].state}
            ...
1 Like

I use nodered a lot. here to start my ytube in the morning but how do I select a specific playlist id? tried various option in the json section but get api errors.
It starts the music fine with it empty but only the default.

Got it sorted:

1 Like

Still looking for dynamic buttons - Is it possible to have in input_select.ytube_music_player_playlist attribute media_id in format that is needed for service media_player.play_media?

Hello,

In the google home app I can select the chromecasts I want playing, without stopping playback or disconnecting. Would this be impossible to integrate?

Hi, i guess I donā€™t really understand the question. What is your use case? What are you trying to due?
In general yes, you can use Chromecasts
Jkw

I think what you are referring to is dynamic speaker groupsā€¦? I was hoping to test that last week but didnā€™t have time. The docs have some info on it, but it isnā€™t related to this component, just media players in general.

Is anyone having issues since updating HA to the latest version last night?
Tons of errors. Iā€™m rolling back my test ha instance to see if it still works on that.

Yes, I submitted a new token as was accepted but nothing else works now.

Update: all fixed. tried a couple of different cookies and got it to work.
odd that it accepted the first one and did not work

i use this with my sonos speakers. Its takes a very long time to load the songs by the proxy. Does somebody have a solution? In the past it works perfectly!

Could you paste here the contents of the Data field with an explanation? Thanks!!

I tried both with what I think should be in that field as well as with nothing in that field.

WIth text I get an unspecified error, but with no text in that field I get an API errorā€¦ extra keys not allowedā€¦


Update: Iā€™m trying but I canā€™t get it to workā€¦ or at least I donā€™t know how to input the playlist into node redā€¦

Soā€¦ not sure if I am doing something wrong or if itā€™s just a limitation. Is there a way to get this to seamlessly work across platforms? So If I start listening from my phone or by just telling google to play something it does not show up in this plugin.

Hi, thats not possible.

This integration enables you to select music from ytubemusic, decode and forward the streaming URL to a generic speaker (chromecast is recommended)

ā€¦ this isnā€™t a official google part that will interact with e.g. your phone

1 Like

Yea figured thatā€™s the answerā€¦ Just do not really understand why. I mean the add-in makes it as if we were playing from the web. An when I physically play from the web I am able to interact with my google display and phone. Just seems oddā€¦

Thatā€™s because the device that initiates the stream is still always in control even though the data is going direct from Googles server to the playback device. Itā€™s no different to starting a stream from your PC (in a Chrome browser window) playing to a Google Home and then opening YouTube Music on your phone, the phone wonā€™t have the ability to seamlessly take over the control of that stream. Using the Google Home app you can skip tracks etc, but it isnā€™t quite the same as what you are asking for.

1 Like