Radio Browser - how to use?

Thanks Terry, this was the information which made the “documentation” make sense.

I am tempted to submit a more detailed instruction … but expect it to get rejected for not fitting HA’s policy that “documentation” be hints for developers (and not intended for users).

My next step is to set up some radio stations as favourites to avoid having to scroll through huge lists.

Hi Elektrinis, (also dutch)
Have you got get to work?
How?
can you share the code?

He shared the code.

Yes! Use it with a little edit of the radio stations.

But didn’t get the answer or solution for:

Problem: it does not show if and what is playing now.’

Ok, when you have a station playing, what are all the attributes of the media_player entity you are paying through. You can see these in the states page of developer tools.

1 Like

I cast my radio-browser stations to an Onkyo receiver and I recently just started playing with templates, so I am no expert, but this is a solution I am using at the moment with Mushroom Template cards for station buttons (it shows IDLE, BUFFERING, and PLAYING). There is some redundancy and buttons in the cast devices that only apply to my DNLA server because I am still working on it while I find time, but I hope this can help others figure things out, because just getting started had me stumped, but slowly I am getting it to what I want, and it works for me… for now.

title: RADIO
path: radio
cards: []
type: sections
badges:
  - entity: media_player.yo
  - entity: media_player.onkyo_tx_nr696
sections:
  - type: grid
    cards:
      - type: custom:mushroom-template-card
        primary: Air1
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: >-
          https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Air1_logo_2019.svg/440px-Air1_logo_2019.svg.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/36ae4390-a4c1-4572-be11-72fe618fc0a5
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        fill_container: false
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'https://maestro.emfcdn.com/stream_for/air1/airable/aac' -%}
            {{ states('media_player.onkyo_tx_nr696_2').upper() }}
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: GTY.org
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: https://www.gty.org/assets/_gty/img/favicon.ico.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/d912d634-979c-4b1a-b9e6-4528144491f1
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'https://stream.radio.co/s94ab743da/listen' -%}
           {{ states('media_player.onkyo_tx_nr696_2').upper() }} 
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: KWAVE
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: >-
          https://kwave.com/wp-content/uploads/2023/02/cropped-kwve-favicon-white-lrg-180x180.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/0ba012dc-2528-448c-8528-e1971e0a7bc7
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        fill_container: false
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          ==
          'https://playerservices.streamtheworld.com/api/livestream-redirect/KWAVEFMAAC.aac'
          -%}
            {{ states('media_player.onkyo_tx_nr696_2').upper() }}
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: KLOVE
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: >-
          https://cdn-profiles.tunein.com/s22561/images/bannerx.jpg?t=637102372250000000
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/2090bf18-ee98-46c9-a795-917aa8eececf
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        fill_container: false
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'http://maestro.emfcdn.com/stream_for/k-love/web/aac' -%}
            {{ states('media_player.onkyo_tx_nr696_2').upper() }}
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: CR Net
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: https://www.christianrock.net/apple-touch-icon.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/960cfee5-0601-11e8-ae97-52543be04c81
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        fill_container: false
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'http://listen.christianrock.net/stream/1/' -%}
            {{ states('media_player.onkyo_tx_nr696_2').upper() }}
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: PP Net
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: http://www.christianpowerpraise.net/apple-touch-icon.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/96147f07-0601-11e8-ae97-52543be04c81
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'http://listen.christianpowerpraise.net/stream/7/' -%}
           {{ states('media_player.onkyo_tx_nr696_2').upper() }} 
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: The Blast
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: >-
          https://www.theblast.fm/home/wp-content/uploads/2021/05/blast_logo_full.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/f8748bef-347d-48a0-a728-fdac35a8cc8b
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        fill_container: false
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          == 'https://theblast-stream.theblast.fm/128?hash=1691169947864.mp3'
          -%}
            {{ states('media_player.onkyo_tx_nr696_2').upper() }}
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-template-card
        primary: 88.1 KJazz
        icon: mdi:radio
        entity: media_player.onkyo_tx_nr696_2
        picture: https://upload.wikimedia.org/wikipedia/en/0/06/KJAZZ_New_Logo.png
        multiline_secondary: true
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/9d21a291-df15-46eb-9760-2bf6614d3be7
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        secondary: >-
          {% if state_attr('media_player.onkyo_tx_nr696_2', 'media_content_id')
          ==
          'http://playerservices.streamtheworld.com/api/livestream-redirect/KKJZFMAAC.aac'
          -%}
           {{ states('media_player.onkyo_tx_nr696_2').upper() }} 
          {%- else -%}
            IDLE
          {%- endif %}
        hold_action:
          action: more-info
      - type: custom:mushroom-media-player-card
        entity: media_player.yo
        icon: mdi:audio-video
        use_media_info: true
        show_volume_level: true
        volume_controls:
          - volume_set
          - volume_buttons
          - volume_mute
        media_controls:
          - on_off
          - shuffle
          - previous
          - play_pause_stop
          - next
          - repeat
        name: Yo M
        double_tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: media-source://radio_browser/d912d634-979c-4b1a-b9e6-4528144491f1
            media_content_type: audio/mpeg
          target:
            entity_id: media_player.onkyo_tx_nr696_2
        icon_type: icon
        fill_container: false
      - type: custom:mushroom-media-player-card
        entity: media_player.onkyo_tx_nr696
        use_media_info: true
        media_controls:
          - on_off
          - shuffle
          - previous
          - play_pause_stop
          - next
          - repeat
        volume_controls:
          - volume_buttons
          - volume_set
          - volume_mute
        show_volume_level: true
        name: DNLA M
        primary_info: state
    title: Onkyo
max_columns: 4

Hi, this is the state of the google hub:

device_class: speaker
friendly_name: Keuken speaker
supported_features: 152463
volume_level: 0.23854698240756989
is_volume_muted: false
media_content_type: music
app_id: 705D30C6
app_name: Default Media Receiver
media_position_updated_at: 2024-06-01T05:57:45.499854+00:00
media_content_id: http://icecast.omroep.nl/radio2-bb-mp3
media_position: 1.168416

I see on the hub and in HA "Default Media Receiver.

This my code i use:

entities:
  - entity: media_player.beneden
    icon: mdi:sofa
    min_volume: 5
    name: beneden audio
    type: custom:mini-media-player
    info: scroll
    source: full
    hide:
      volume: false
      source: false
      power_state: false
      name: false
      icon: false
      info: false
    shortcuts:
      columns: 4
      buttons:
        - name: Radio 2
          image: >-
            https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/NPO_Radio_2_logo.svg/640px-NPO_Radio_2_logo.svg.png
          type: radio
          id: http://icecast.omroep.nl/radio2-bb-mp3
        - name: Radio 10
          image: >-
            https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScXQ3C4MdB2iKNRXVmQSy-fl3MBqAi-SX2JU3p-ZeLSiLCVbDw&s
          type: playlist
          id: >-
            http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO10.mp3
        - name: Qmusic
          image: https://qmusic.nl/favicon.ico
          type: playlist
          id: https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_live_96.mp3
        - name: Nonstop grootnieuws
          image: >-
            https://new-api.grootnieuwsradio.nl/cache/i/0/images/3.w80.r1-1.5749681.q90.webp
          type: playlist
          id: https://27863.live.streamtheworld.com/GNRNONSTOP.mp3
        - name: Groot nieuws
          image: https://www.grootnieuwsradio.nl/favicons/favicon-1-180x180.png
          type: playlist
          id: >-
            https://playerservices.streamtheworld.com/api/livestream-redirect/GNR.mp3
        - name: Radio 5
          image: https://www.nporadio5.nl/apple-touch-icon.png
          type: radio
          id: https://icecast.omroep.nl/radio5-bb-mp3
        - name: Blijde klanken
          image: >-
            https://new-api.grootnieuwsradio.nl/cache/i/0/images/5.w80.r1-1.0db0463.q90.webp
          type: radio
          id: >-
            https://playerservices.streamtheworld.com/api/livestream-redirect/GNRBK.mp3
show_header_toggle: false
type: entities
state_color: true

Ok so 4 weeks later, I don’t recall what you were actually wanting.

Yes I understand, didnt get notification at my mail and was a bit bussy with another things:-)

The issue (not really a issue) when now play everything is working but dont see whats playing, I see “default Media receiver” when use buttons.
Would like to see:
Screenshot 2024-06-02 11.14.09

But when I use the buttons I will get:
Screenshot 2024-06-02 11.16.17

any idea how to get to see whats playing

No, sorry.

1 Like

I had the same issue with a different setup. See part of my config below. What fixed the issue you described was the last part in my code below, starting with “extra”. Replace the values for “title” and “url” to your radio stations equivalent. Hopefully it will work in your setup as well or perhaps someone more proficient in programming might be able to get an idea how to fix it?

          - type: vertical-stack
            cards:
              - show_name: true
                show_icon: true
                size: 62%
                type: custom:button-card
                show_entity_picture: true
                entity_picture: /local/radio/PirateRock.png
                tap_action:
                  action: call-service
                  service: media_player.play_media
                  service_data:
                    media_content_id: >-
                      media-source://radio_browser/f4fcca1a-ba7e-11e9-acb2-52543be04c81
                    media_content_type: audio/mpeg
                    entity_id: |
                      [[[
                        var player = states["input_select.radio"].state;
                        if ([player] == 'Bibliotek') return 'media_player.wiim_pro_9486';
                        if ([player] == 'Glasveranda') return 'media_player.wiim_pro_958a_2';
                        if ([player] == 'Tvättstuga') return 'media_player.wiim_pro_96e2';
                        if ([player] == 'Kök') return 'media_player.wiim_pro_3b8e';
                        if ([player] == 'Master Badrum') return 'media_player.wiim_pro_2b42';
                        if ([player] == 'Master Sovrum') return 'media_player.wiim_pro_9dba';
                      ]]]
                    extra:
                      metadata:
                        metadataType: 3
                        title: Pirate Rock Radio
                        images:
                          - url: >-
                              https://piraterock.se/wp-content/uploads/2018/05/PR-Logo.png

I’m not sure if this question has been answered.

I would like to select a radio station but want the output to stream out of HA server itself.
So use the HA app on my Iphone and select a radio station. The audio output of the server that runs HA is connected to the amplifier.

Is this possible and if so how? I could not find a setting in HA for the Radio browser.

So you want ha to download the stream and then restream it?

Not sure what you mean with this.
HA is running in Docker on a Mac mini.
What I would like is that I can use my iPhone and use the HA app to select a radio station but then stream it from the Mac mini not from the iPhone.
I hope this does make sense.

You’ll need to set up a media player on the mini that will show up in HA, like an mpd container.

Thanks.

Let’s say I will use VLC as media player in the mini.
Do I need to add the VLC add-on in HA or is that not required, will HA see the VLC player in the network?

Probably better to install the squeezelite addon.

I have been trying to add this station and nothing I do works. Can someone help me or add it for me? Thanks

103.9 dayton’s new country

If it isn’t already in radio browser you’ll have to add it here. radio-browser.info

Not a home assistant issue.

I tried adding it but it wouldnt work.