I stream radio on a Next hub via a custom link.
I have a script that extracts content artist / title / thumb from the radio’s website.
I know how to set the Title and Thumb when calling the media_player.play_media
, but even if I use a template, the content on the Next Hub is static.
Is there a way to update the Title and Thumb without having to call media_player.play_media again (and thus breaking /restarting the sream)?
I currently set the title and Thumb to the radio station but would prefer info about the actual track being streamed
For reference:
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio_speakers", "Master Bedroom Nest Hub") %} media_player.master_bedroom_nest_hub
{% elif is_state("input_select.chromecast_radio_speakers", "Conservatory") %} media_player.conservatory
{% elif is_state("input_select.chromecast_radio_speakers", "Kitchen") %} media_player.kitchen
{% elif is_state("input_select.chromecast_radio_speakers", "Living Room") %} media_player.living_room
{% elif is_state("input_select.chromecast_radio_speakers", "Office Nest Hub") %} media_player.office_nest_hub
{% elif is_state("input_select.chromecast_radio_speakers", "House") %} media_player.house
{% endif %}
media_content_id: >
{% if is_state("input_select.chromecast_radio_station", "RTL2") %} http://icecast.rtl2.fr/rtl2-1-44-128
{% elif is_state("input_select.chromecast_radio_station", "Absolute Radio") %} https://stream-ar.planetradio.co.uk/absoluteradiohigh.aac?direct=true&carrier=unknown&aw_0_1st.bauer_loggedin=false&aw_0_1st.bauer_preroll=1&aw_0_1st.bauer_carrier=unknown&aw_0_req.gdpr=true&aw_0_1st.playerid=BMUK_GoogleHome
{% elif is_state("input_select.chromecast_radio_station", "Absolute Radio Classic Rock") %} https://stream-ar.planetradio.co.uk/absoluteclassicrockhigh.aac?direct=true&carrier=unknown&aw_0_1st.bauer_loggedin=false&aw_0_1st.bauer_preroll=1&aw_0_1st.bauer_carrier=unknown&aw_0_req.gdpr=true&aw_0_1st.playerid=BMUK_GoogleHome
{% elif is_state("input_select.chromecast_radio_station", "Hit West") %} http://broadcast.infomaniak.ch/hitwest-high.mp3
{% elif is_state("input_select.chromecast_radio_station", "HA Podcast") %} {{states("sensor.ha_podcast")}}
{% elif is_state("input_select.chromecast_radio_station", "IoT Podcast") %} {{states("sensor.internet_of_things_podcast")}}
{% elif is_state("input_select.chromecast_radio_station", "Chill") %} http://media-the.musicradio.com/ChillMP3
{% elif is_state("input_select.chromecast_radio_station", "Radio Fiji Two") %} http://peridot.streamguys.com:7150/RFTwo?play
{% elif is_state("input_select.chromecast_radio_station", "Scala") %} https://stream-mz.planetradio.co.uk/scalahigh.aac?direct=true&carrier=unknown&aw_0_1st.bauer_loggedin=false&aw_0_1st.bauer_preroll=1&aw_0_1st.bauer_carrier=unknown&aw_0_req.gdpr=true&aw_0_1st.playerid=BMUK_GoogleHome
{% elif is_state("input_select.chromecast_radio_station", "Navtarang") %} https://stream.fijivillage.com/navtarang
{% elif is_state("input_select.chromecast_radio_station", "Custom Station") %} {{states("input_text.custom_station")}}
{% endif %}
media_content_type: 'audio/mp4'
extra:
thumb: >
{% if is_state("input_select.chromecast_radio_station", "Hit West") %} https://upload.wikimedia.org/wikipedia/fr/b/bd/HitWestLogo.jpg
{% elif is_state("input_select.chromecast_radio_station", "RTL2") %} http://192.168.9.23:8123/local/RTL2_Logo.png
{% elif is_state("input_select.chromecast_radio_station", "Absolute Radio") %} https://en.wikipedia.org/wiki/Absolute_Radio#/media/File:AbsoluteLogo.svg
{% elif is_state("input_select.chromecast_radio_station", "Scala") %} https://media.bauerradio.com/image/upload/tracks/scalaDefaultTrackArt.png
{% elif is_state("input_select.chromecast_radio_station", "Absolute Radio Classic Rock") %} https://en.wikipedia.org/wiki/Absolute_Radio_Classic_Rock#/media/File:Absolute_Classic_Rock_Logo.png
{% elif is_state("input_select.chromecast_radio_station", "HA Podcast") %} https://secureimg.stitcher.com/feedimageswide/480x270_176113.jpg
{% elif is_state("input_select.chromecast_radio_station", "IoT Podcast") %} https://is1-ssl.mzstatic.com/image/thumb/Music62/v4/b3/d6/64/b3d664ab-0560-f24d-2379-d01142267f94/source/1200x630bb.jpg
{% elif is_state("input_select.chromecast_radio_station", "Chill") %} https://en.wikipedia.org/wiki/Smooth_Chill_(UK_radio_station)#/media/File:Chill_radio_logo.png
{% elif is_state("input_select.chromecast_radio_station", "Navtarang") %} https://static-media.streema.com/media/cache/61/a2/61a237fb6851e34614c55420b3e11a62.jpg
{% elif is_state("input_select.chromecast_radio_station", "Radio Fiji Two") %} http://player.streamguys.com/fbc/sgplayer/include/assets/img/RF2.png
{% elif is_state("input_select.chromecast_radio_station", "Custom Station") %} https://www.holyscripturesandisrael.com/images/radio/radio-icon.png
{% endif %}
title: '{{states("input_select.chromecast_radio_station")}}'