WTH is there no search option in the radio browser?

I love the radio browser that has been added not that long ago. It is however terrible to find a radio station. A simple search bar for search all/search per category would drastically make the use experience more “streamlined”.

YES! This would be great! So many great stations in the list. Would also like to mark “Favorites”.

7 Likes

May I add some clarification about the scope of this request?

This does not need to be a music library or iTunes. The Radio Browser is an extensive (HUGE) library of radio stations. It’s really quite impressive. To use these stations does require a little bit of research, listening, and deciding which stations to use/listen to. I scroll these long long lists of stations and find a cool eclectic station then I have to navigate away from it then find it again to integrate it into any automation etc. Being able to flag (Favorite) them allows users to actually use this tool more because of the ease of use. I know I would use this tool all the time if I could flag my favorites and view them.

1 Like

I absolutely agree with the favorite part. That would already bring so much more accessibility since it would bring the manual searching back to just once.

1 Like

Ah yes, searching would make it a lot easier to find a radio station of which you know (part of) the name, but not sure in which category/folder/country it is.

1 Like

Even if you know in which category/folder/country it is. scrolling through those lists for “Radio Roma”, which is obviously (to me) in Italy takes way longer than it should.

Its absolutely awesome that we have so many radiostations at our fingertips… but it comes with a cost.

3 Likes

Agree, it becomes useless, right now im looking for pulsradio 2000, i know its there, but i`m unable to find it…

1 Like

You can make buttons for your favorite Radio channels.

1 Like

The Radio browser is still more than garbage,
There is no way for me to find “Radio Veronica”
Thats the only one I use and it’s just not there

It took me way to long to find but it is there between radio vastelaovend and radio wereldwind. Without a logo.

But yeah the point is that searching is more difficult than needed.

Happened to me too, do you have any idea. Right now my HA is stopping randomly I don’t know why?

Why is it that some radios are present on the RadioBrowser website but not available in its HA integration? :thinking:

Examples:
La Patate Douce
https://www.radio-browser.info/search?page=1&order=clickcount&reverse=true&hidebroken=true&name=patate

France Info
https://www.radio-browser.info/search?page=1&order=clickcount&reverse=true&hidebroken=true&name=france%20info

We could try to use the API, which can be also used by assist: http://all.api.radio-browser.info

I’ll try some queries and post my experience :upside_down_face:

check this out… the code fetches the station with the best quality and plays it on your media_player…

configuration.yaml:

rest_command:
  api_search:
    url: "{{ url }}"
    method: GET
    content_type:  'application/json; charset=utf-8'

automation:

alias: radio-browser
description: ""
trigger:
  - platform: conversation
    command:
      - play radio {name}
condition: []
action:
  - service: rest_command.api_search
    data:
      url: >-
        https://de1.api.radio-browser.info/json/stations/byname/{{
        trigger.slots.name.replace(' ', '_') 
        }}?order=bitrate&limit=1&reverse=true
    response_variable: api_search_summary
    enabled: true
  - alias: Parse data
    variables:
      api_extract_name: "{{ api_search_summary['content'][0]['name'] }}"
      api_extract_url: "{{ api_search_summary['content'][0]['url'] }}"
    enabled: true
  - set_conversation_response: playing {{ api_extract_name }}
  - service: media_player.play_media
    target:
      entity_id: media_player.<YOUR PLAYER ID>
    data:
      media_content_id: "{{ api_extract_url }}"
      media_content_type: audio/mpeg
mode: single

Truly great idea, @undone8106 !

I tried to expand on it to be able to search by station name or a genre name (bytagexact seems to provide most valid results, but it’s hit-and-miss) and make ChatGPT be able to use it through Assist (voice). I’m quite happy with the results!

Trying to give back to the community, here is my script yaml, translated back to English, I hope I didn’t miss any German :slight_smile:

Let me know if I messed something up during translating …

sequence:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ name != null }}"
            alias: name is set
        sequence:
          - service: logbook.log
            metadata: {}
            data:
              name: Radio Browser station lookup //
              message: Looking for name <{{ name }}> in Radio Browser ...
            enabled: true
          - service: rest_command.get_json
            data:
              url: >-
                https://de1.api.radio-browser.info/json/stations/byname/{{
                name.replace(' ', '_')
                }}?order=clickcount&reverse=true&hidebroken=true&limit=1
            response_variable: api_search_summary
            enabled: true
        alias: Find by name
      - conditions:
          - alias: genre is set
            condition: template
            value_template: "{{ genre != null }}"
        sequence:
          - service: logbook.log
            metadata: {}
            data:
              name: Radio Browser station lookup //
              message: Looking for genre <{{ genre }}> in Radio Browser ...
            enabled: true
          - service: rest_command.get_json
            data:
              url: >-
                https://de1.api.radio-browser.info/json/stations/bytagexact/{{
                genre.replace(' ', '_').replace('-', '_') | lower
                }}?order=clickcount&reverse=true&hidebroken=true&limit=1
            response_variable: api_search_summary
            enabled: true
        alias: Find by genre
      - conditions:
          - alias: name and genre unset
            condition: template
            value_template: "{{ genre == null and name == null}}"
        sequence:
          - service: logbook.log
            metadata: {}
            data:
              name: Radio Browser station lookup //
              message: name and genre not set - unable to search ...
            enabled: true
          - stop: name and genre missing! Unable to search!
        alias: name and genre not set
  - alias: Parse data
    variables:
      api_extract_name: "{{ api_search_summary['content'][0]['name'] }}"
      api_extract_url: "{{ api_search_summary['content'][0]['url'] }}"
    enabled: true
  - set_conversation_response: Playing station {{ api_extract_name }} on {{ player }}
    enabled: true
  - service: logbook.log
    metadata: {}
    data:
      name: Radio Browser station lookup //
      message: >-
        Playing station {{ api_extract_name }} on {{ player }}
        ({{api_extract_url }})
    enabled: true
  - service: media_player.play_media
    target:
      entity_id: "{{ player }}"
    data:
      media_content_id: "{{ api_extract_url }}"
      media_content_type: audio/mpeg
    enabled: true
description: >-
  Tool to play a radio station on a media_player by its name or by a genre.
  Enter the media_player entity into the field "player", further enter the name of
  the station into the field" name" or enter the genre into the field "genre".
icon: mdi:radio
fields:
  name:
    selector:
      text: null
    name: Name
    description: Name of the desired radio station
    required: false
    default: Radio Bob
  player:
    selector:
      entity:
        domain: media_player
    name: player
    description: media_player entity to play the station on
    required: true
    default: media_player.multiroom
  genre:
    selector:
      text: null
    name: genre
    description: Desired genre
    default: Metal