I would like some help how to cast a URL to my google mini

Hi,
I am in the process to shift all my node-red automatons to the inbuilt automatons.
Any help how I can cast a url (eg http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p) to my google mini? (this works fine with node-red, I just need to code to do it in automatons.

tia!

catt (cast all the things)

1 Like

This worked for me using that URL:

- service: media_player.play_media
  data:
    entity_id: media_player.kitchen_home
    media_content_id: http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
    media_content_type: audio/mpeg
1 Like

do you have an example pls?

Hi Steve,

I tried the below:

  action:
  - service: media_player.turn_on
      entity_id: media_player.openplanspeaker
  - service: media_player.play_media
    data:
      entity_id: media_player.openplanspeaker
      media_content_id: http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
      media_content_type: audio/mpeg

but nothing is happening.
Also note the following:

1 Like

‘unavailable’ usually means that it can’t be contacted by HA. Also, you don’t have to call turn_on first, play_media will do that for you.

i think I had the Mini powered off #facepalm

do you know how I can setup the volume and to switch it off after 5mins? Maybe I can do it in one automation? (maybe this is a trivial question, if you help it would be appreciated, not much time to search right now :frowning:

automation:
  - alias: volume_up_for_5_minutes
    trigger:
      - ????
    action:
      - service: media_player.set_volume
        data:
          entity_id: media_player.openplanspeaker
          volume_level: [YOUR_DESIRED_VOLUME_LEVEL]
      - delay: '00:05:00'
      - service: media_player.turn_off
        data:
          entity_id: media_player.openplanspeaker
1 Like

thanks much appreciated.
the volume should be a value between 0 and 100?

Actually, between 0 and 1, representing a percent.

1 Like

Hi, someone can help me to use this? I dont know where to paste this code.
I just would like to listen a cast URL in my google mini.