What you are trying to do is not possible. You cannot have jinja span multiple items in a list. Jinja will only return 1 string. It will not return complex objects (like a list of strings, which you are trying to do).
You’ll have to come up with another method to handle this. Possibly scripts with each hardcoded parameter section.
What you have could possibly work with some modifications. However, if that is just a simple example and you want to do something more complex, then
- alias: Play Radio
trigger:
platform: state
entity_id: input_select.radio_station
condition:
condition: template
value_template: >
{{ trigger.to_state.state in ('Jewish Music Stream',
'Jewish Hits') }}
action:
service: media_player.squeezebox_call_method
data_template:
entity_id: media_player.picoreplayer
command: playlist
parameters:
- play
- "{{ {'Jewish Music Stream': 'https://stream.jewishmusicstream.com:8000',
'Jewish Hits': 'http://s3.voscast.com:7246'}
[trigger.to_state.state] }}"
If you do actually need to send “none” for the value of parameters when the input_select is not one of the two, then you could do that in a second automation (with appropriate condition.)