Play one radio stream by pushing one button

I would like to play only a single radio stream to a media player with one single button.

I have tried many but everything is too extensive.
So no selectors but just one button that plays one stream one media player.
Who can help me on my way.

So please no links to all the difficult script i tried them all and they are too much.

I understand i have to give more input

The radios station for example is

the media player is

Hi Ernst,
without knowing which stream you would like to play on which device, it is difficult to give you hints.
For example, my SONOS behaves different to my ‘frontier silicon’-speakers.
Maybe you take the time to read this topic

I use this to play radio Wales on chromecast

alias: Play Radio Wales (HG)
description: ''
  - platform: state
    entity_id: input_boolean.radio_wales
    to: 'on'
condition: []
  - service: media_player.play_media
      entity_id: media_player.home_group
      media_content_id: >-
      media_content_type: audio/mp4
mode: single

With an input boolean triggering it.

1 Like

Nice i understand much but i’m such a beginner i don’t know how to go further whit the input boolean
I understand i have to trigger it there it stops for me.

Create toggle helper in configuration / automations and scenes / helpers and use that as the button and automation trigger.

1 Like

And it’s working Thanks .

You can also use this one. I have edited it on my own purposes with the radio stations and icons.

Playing webradio (and other audio) from Lovelace dashboard :: Sequr

Hi Besiktas.
I’ve been trying to build that radioplayer as well. I didn’t use the packages option. However, I have an issue with the scripts. I have no error message, but in the script.yaml file, this is all I see:

  alias: Media_URL
  sequence: []
  alias: Webradio
  sequence: []

Where is the script itself? As in:

      alias: Play media from URL
      mode: single
      icon: mdi:music-box-multiple-outline
        - service: media_player.media_stop
            entity_id: media_player.livingroom
        - service: media_player.volume_set
            entity_id: media_player.livingroom
            volume_level: 0.10
        - service: media_extractor.play_media
            media_content_type: MUSIC
            media_content_id: "{{ states('input_text.url') }}"
            entity_id: media_player.livingroom
      name: URL
      min: 10
      max: 255
      icon: mdi:web
      mode: text

I think thats because you didn’t use the option for the package one.
Because the whole thing is forwarding to that place and if you didn’t made your changes good to not use the ‘‘package option’’, then that will be your issue.

Just throws up an error saying “Message malformed: extra keys not allowed @ data[‘trigger’]”.

Of all the things I’ve set up in Home assistant this is easily the hardest, it is absolutely ridiculous how difficult it is to push a button and turn on the radio when it’s so simple to do so much more complicated things.

Unless you have entities named exactly like mine it is not going to work.

We will need to know your entity names and what your yaml is. You can’t just copy mine, it was just an example. Oh and it works every day here, except that URL is now long out of date.

Oh and its not at all difficult these days, just use radio browser, set an automation triggered by an input boolean, action play media, pick a player and then choose the media using radio browser.

1 Like

I appreciate the response, I did update the entity names though.

I think we must be on different versions of Home Assistant, there is no way to select the media like this, you have to manually enter the content ID and there is seemingly no way to find that ID from the Radio Browser.

This was the solution, downloading an add on.

An automation can pick a radio browser station easily. For action just call service, play media and pick the player then pick.the media using radio browser… No need for any content id.
Music assistant is also a good way of doing it.