Template with shell_command

I want to create a webradio playing om my chromecast.
The links to the stations i want to play doesn’t end with .mp3
If i understand tis right i can’t send that kind of links from Home Assistant to chromecast.
The webradio is an input_select and i want to execute shell_command
I use pychromecast and pyhon-files to start my webradiostations.

input_select:
  webradio:
    name: Webradio
    options:
     - Inget spelas
     - Bandit Rock
     - Rockklassiker
    initial: Inget spelas

The shell command.

shell_command:
 python: python "{{cmd}}"

This is a woking automation.

automation:
 - alias: test webradio
   trigger:
     platform: state
     entity_id: input_select.webradio
     to: "Rockklassiker"

   action:
     service: shell_command.python
     data:
       cmd: '/home/hass/.homeassistant/radio/rock_klass.py'

I can’t get this working. Can i use shell command like this?

 - alias: test2 webradio
   trigger:
     platform: state
     entity_id: input_select.webradio

   action:
     service: shell_command.python
     data_template:
       cmd: >
         {% if is_state("input_select.webradio", "Bandit Rock") %}
           '/home/hass/.homeassistant/radio/bandit.py'
         {% elif is_state("input_select.webradio", "Rockklassiker") %}
           '/home/hass/.homeassistant/radio/rock_klass.py'
         {% else %}
           none
         {% endif %}

Hi, did you ever get this working?
I have a similar issue.

I want to run a different shell script based on an input select.

First I thought that I could use a variable:
> weatherloop:

        alias: "Loop Weather Cube"
        sequence:
          - alias: send.weatherloop
            service: "shell_command.{{states.input_select.weather.state}}"
            data:
              entity_id: 
          - delay:
              seconds: 31
          - alias: "weatherloop"
            service: script.turn_on
            data:
              entity_id: script.weatherloop

But HA doesn’t like that very much. Then I found your post, wondering if that is the right direction?

For context, this sends a command to a 4X4X4 LED cube I have, so it shows the weather. Sending manual commands works well, now to get it to read the weather from HA!

Nope. Didn’t get this to work.
I created one automation for each state.
Maybe this is something to wish for in the feature request section.
Cube to show weather sounds cool.
I googled this but didn’t find any images of cubes showing symbols.

Thanks.

This is the cube I used. https://www.freetronics.com.au/products/cube4-4x4x4-rgb-led-cube

Try w/o qoutes:

shell_command:
  python: python {{cmd}}