Beginner to scripts and templates needing advice
{% set SqueezePlayLists = { 'Dinner':'dplstaticpl_PGPBtJ1Dd6Co5RDdrt9%2F%2FJKp1d8',
'Karen':'dplstaticpl_xXMhdJQR%2FUp59ZgBx%2Bj4ypsz55k',
'Speaker-Test':'dplstaticpl_maRsj0ELIYXNTbXiYejkTvghpek',
'RockSteady':'dplccustom_rocksteady',
'Guitars':'dplccustom_guitars',
'long_songs':'dplccustom_long_songs',
'my_jazz':'dplccustom_my_jazz'} %}
{% set Item = SqueezePlayLists[ states('input_select.lmsplaylist_select') ] %}
{{ Item }}
The above works correctly when I test it in the Developer Tools Template editor
but when i insert it into a script as below no matter how I enter Item in the code it is passed across as Item rather than the value of Item
lms_dynamic_play:
alias: Lms Dynamic
mode: single
icon: mdi:music
sequence:
- service: squeezebox.call_method
{% set SqueezePlayLists = { 'Dinner':'dplstaticpl_PGPBtJ1Dd6Co5RDdrt9%2F%2FJKp1d8',
'Karen':'dplstaticpl_xXMhdJQR%2FUp59ZgBx%2Bj4ypsz55k',
'Speaker-Test':'dplstaticpl_maRsj0ELIYXNTbXiYejkTvghpek',
'RockSteady':'dplccustom_rocksteady',
'Guitars':'dplccustom_guitars',
'long_songs':'dplccustom_long_songs',
'my_jazz':'dplccustom_my_jazz'} %}
{% set Item = SqueezePlayLists[ states('input_select.lmsplaylist_select') ] %}
data:
command: dynamicplaylist
parameters:
- playlist
- play
- 'Item' # I've tried {{ Item }, "Item", "{{ Item }}" etc etc
target:
entity_id: media_player.{{ states('input_select.lms_instance') }}
If anybody could explain what I am doing wrong I’d be very grateful