Closed WERUreo closed 2 years ago
You need to eiother wrap the template in quotes, like:
type: custom:card-templater
card:
type: picture
image_template: '{{ states.sensor.nasa_apod.state }}'
entities:
- sensor.nasa_apod
or use one of the YAML multi-line operators (aka "block scalar headers") like >-
like this:
type: custom:card-templater
card:
type: picture
image_template: >-
{{ states.sensor.nasa_apod.state }}
entities:
- sensor.nasa_apod
oh man, rookie mistake. thanks for the insight!
I made a RESTful sensor that gets the url for NASA's Astronomy Picture of the Day and was hoping to use a template to use that sensor's state as the
image
. I set up my card like this:After I save it and go back to edit the card, my template has been replaced with
'[object Object]': null
. I've tested the template and it returns the correct string.