Hi,
I want to have different brightness on my lamp depending on time.
My code:
I get this error code:
I can´t see why it´s not working.
Thanks
Hi,
I want to have different brightness on my lamp depending on time.
My code:
I get this error code:
I can´t see why it´s not working.
Thanks
Delimit the template with double-quotes.
data_template:
brightness: "{% if now().hour < 22 %} 255 {% else %} 56 {% endif %}"
or do this:
data_template:
brightness: >
{% if now().hour < 22 %} 255 {% else %} 56 {% endif %}
NOTE: If you wish, you can make the template more compact by using the inline version of an if-else statement.
data_template:
brightness: "{{ 255 if now().hour < 22 else 56 }}"
Thanks. I will test whis tomorrow .