I’m playing with the first time with templating. Here I read:
still_image_url (Required): The URL your camera serves the image on, eg. http://192.168.1.21:2112/. Can be a template.
But even following the link to the template docs page I don’t understand how use it.
Here my (wrong) code:
camera:
- platform: generic
still_image_url:
value_template: >
{% if states.sun.sun.state == "above_horizon" %}
"http://api.sat24.com/animated/ALPS/visual/1/Central%20European%20Standard%20Time/2380259'%20width=400%20height=291"
{% else %}
"http://api.sat24.com/animated/ALPS/infraPolair/1/Central%20European%20Standard%20Time/2380259'%20width=400%20height=291"
I get this error:
Failed config camera.generic: - Invalid config for [camera.generic]: template value should be a string for dictionary value @ data['still_image_url']. Got OrderedDict(...)
What’s my mistake here?