Online radio stream not working

Hi,
I have this piece of code:

radio_music:
  alias: Play radio online
  sequence:
  - service: media_player.play_media
    data_template:
     entity_id: >
      {% if is_state("input_select.radio_source", "Francoforo") %} media_player.francoforo
      {% elif is_state("input_select.radio_source", "Teodolindo") %} media_player.teodolindo
      {% endif %}
     media_content_type: >
      {% if is_state("input_select.radio_playlist", "Jazz 24") %} audio/mp4
      {% elif is_state("input_select.radio_playlist", "Lifegate") %} playlist
      {% elif is_state("input_select.radio_playlist", "Natura") %} playlist
      {% elif is_state("input_select.radio_playlist", "Africa") %} playlist
      {% endif %}
     media_content_id: >
      {% if is_state("input_select.radio_playlist", "Jazz 24") %} https://live.wostreaming.net/direct/ppm-jazz24mp3-ibc1
      {% elif is_state("input_select.radio_playlist", "Lifegate") %} http://onair11.xdevel.com:8024
      {% elif is_state("input_select.radio_playlist", "Natura") %} http://192.240.102.198:14244/listen.pls?sid=1
      {% elif is_state("input_select.radio_playlist", "Africa") %} http://66.55.145.43:7051/

It does work just if “jazz 24” stream (on both google homes). All oher three cases my google homes don’t start playing but remain idle.
The streaming urls work, I have tried them with vlc on my PC

Any advice?
Thanks!

I’m not sure if you can play a livestream as a playlist.
Have you tried changing the playlist type to audio/mp4 ?

just tested,

nothing change :frowning_face:

I have a similar setup, but I don’t set media_content_type trough templating.
It’s always ‘audio/mp4’.
As you are comparing strings, keep in mind that it’s values are case sensitive.
I’ve had it in the past that a trailing space was giving me quite some headache.

Yeah, even without templating nothing change.
it works just ‘jazz 24’

I just tried with my setup, same issue.
My guess it’s related to the codec of the stream. Maybe google home can’t handle it.

I thinks it’s like you report.
Just tried to change radio url and they’re working.
If it’s a google home issue I think I can play my old radio stream through pi’s jack output… right?

The pi’s analogue output is crap, but other than that, you should be able to.