I am trying to create a script that will tell Plex to play said movies to the plex player chosen in an input select. This is what I have but it gets errors in configuration. I am probably way off on what I need to do so any help is greatly appreciated. Here is my current test script:
play_backtothefuture:
alias: Back to the Future
sequence:
- service: media_player.play_media
data_template:
entity_id: >
{% if is state ("input_select.plex_player", "Shield LR") %}
media_player.shield_lr
{% if is state ("input_select.plex_player", "Ryder's Roku") %}
media_player.roku_3__1gn39u202172
{% else %}
{% endif %}
data:
media_content_type: VIDEO
media_content_id: "{ \"library_name\": \"Movies\", \"video_name\": \"Back to the Future\", \"shuffle\" : \"0\" }"
Thanks @Bit-River. Underscore got me. I also put if instead of elif on second condition. guess that means I need to take a break for a little bit. Removed space there as well just to be sure and it’s working.
It expects property name enclosed in double quotes. So how can I encapsulate those variables correctly? If I do “{{ library }” it just sees the whole thing as a string not a variable. Any ideas?