HI all,
So i have a kodi recently added sensor that gives a lot of ingo in an attribute called " data: "
I just need the poster part of every movie it shows, and in the template testing from the developer tools i get to work and get the part i need:
Poster
{{ state_attr('sensor.kodi_recently_added_movies', 'data').split('{')[9].split('poster": "')[1].split('"},')[0]}}
Name
{{ state_attr('sensor.kodi_recently_added_movies', 'data').split('{')[9].split('"title": "')[1].split('",')[0]}}
Fanart
{{ state_attr('sensor.kodi_recently_added_movies', 'data').split('{')[9].split('poster": "')[1].split('"},')[0]}}
getting the results:
Name
Prancer: A Christmas Tale
but when I copy it over and create the sensor, I get an error:
##Movie 1
- platform: template
sensors:
kodi_recently_movies_1:
friendly_name: "Kodi Movie 1 Poster"
icon_template: mdi:movie-roll
value_template: ->
{{ state_attr('sensor.kodi_recently_added_movies', 'data').split('{')[9].split('poster": "')[1].split('"},')[0]}}
Error:
bad indentation of a mapping entry (721:98)
718 | β¦
719 | β¦
720 | β¦
721 | β¦ ).split(β{β)[9].split(βposter": "β)[1].split(β"},β)[0]}}
------------------------------------------^
722 | β¦
Dot get it why, could anyone explain it?
Thanks!