I am trying to play a movie on plex that works like this:
entity_id: media_player.plex_player
media_content_type: movie
media_content_id: '{ "library_name": "Adult Movies", "title": "die hard", year=1995 }'
# Would find the sequel, "Die Hard: With a Vengeance"
and in the Developer tools Templeate
i have
{"library_name": "Movies", "title": "{{state_attr('sensor.plex_recently_added','data')[1]['title']}}", "year": "{{state_attr('sensor.plex_recently_added','data')[1]['aired'].split("-")[0]}}"}"
that gives me
{“library_name”: “Movies”, “title”: “Date With an Angel”, “year”: “1987”}"
that is exactly what i need to send in the media_content_id:
but i get an error all the time:
can not read a block mapping entry; a multiline key may not be an implicit key at line 12, column 8: style: ^
here is my config
type: 'custom:config-template-card'
entities:
- sensor.plex_recently_movies_poster_1
card:
type: 'custom:hui-picture-card'
tiltle: Movie 1
image: '${states[''sensor.plex_recently_movies_poster_1''].state }'
tap_action:
entity_id: media_player.plex_for_samsung_tv_livingroom
media_content_type: movie
media_content_id: '{"library_name": "Movies", "title": "{{state_attr('sensor.plex_recently_added','data')[1]['title']}}", "year": "{{state_attr('sensor.plex_recently_added','data')[1]['aired'].split("-")[0]}}"}"'
style:
top: 44%
left: 12%
width: 13%
border: 2px solid gold
i also have a sensor e same value if it helps:
- platform: template
sensors:
plex_recently_movies_play_movie_1:
friendly_name: "Movie 1 play button"
icon_template: mdi:movie-roll
value_template: >-
"library_name": "Movies", "title": "{{states('sensor.plex_recently_movies_name_1')}}", "year": "{{states('sensor.plex_recently_movies_year_1') }}"
Can some one help me point to my error in this, it would be alot of help, thanks!!