Launch media browser dialog

Does anyone know if it’s possible to launch the HA media browser dialog via a custom button?

When I have the media control card linked to the Spotify entity it shows a media browser button - I’d like to get that button without all the player related controls.
I’ve been searching for days but not having any luck finding a solution.

@swifty Just navigate to the media browser tab:

type: button
icon: mdi:play-box-multiple-outline
tap_action:
  action: navigate
  navigation_path: HA-ADDRESS:8123/media-browser

Thanks, it may be the solution I have to use in the end, but I was hoping to replicate the popup dialog rather than navigate away from my dashboard entirely.

Is there any way to get a popup dialog to show the navigation results instead of the main browser window?

Sure, you can do that. Here I used a custom button card:


type: custom:button-card
show_name: false
icon: mdi:play-box-multiple-outline
tap_action:
  haptic: heavy
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Media Browser
    hide_header: false
    large: false
    card:
      type: iframe
      url: /media-browser
      aspect_ratio: 200%

3 Likes

Amazing, thanks so much - looks almost perfect for what I wanted :smiley:
The only thing is the HA sidebar is visible in the popup and card mod doesn’t seem to be able to style it to turn it off (or I’m not doing it right :stuck_out_tongue: )

I guess it’s because the media browser page isn’t strictly lovelace, as the kiosk-mode plugin doesn’t seem to affect it either.

Edit - Just found the option in profile settings to ‘always hide sidebar’ that will do the trick :smiley:

Exactly.
And you can also make the popup full screen if you want:

large: true
1 Like

@suxlala great thanks for the solution. It works fine for me, except for the companion ios app. I created this topic for this problem:

maybe you can help.

Hi @Yves_IF unfortunately, I experience the same issue and couldn’t find a solution yet.

When I add a “Manual card” (or Button) and replace the YAML code to custom:button-card it says:

Custom element doesn’t exist: button-card.

It must be something simple, but how to do it properly? thx.

@jnathalia
You have to install the custom button card addon first, from here or from the HACS.