graLf
(GraLf)
October 21, 2024, 8:03pm
21
now that I have the Code i need to insert It into a yaml Code card
I have tried something like this but got no results
{% set napa = (states('switch.ladron_pasillo_0_enchufe_1.last_changed') if is_state('switch.ladron_pasillo_0_enchufe_1', 'on' )) %}
{% if napa - now() <= 2 %}
{{ 'hello' }}
{% else %}
{{ 'bye' }}
{% endif %}
What card are you talking about?
As for standard cards - only a Markdown card supports jinja templates.
Besides, this template may cause errors if a variable is unknown.
graLf
(GraLf)
October 22, 2024, 7:29am
23
It is a custom button card. I just want to animate a shape via card_mod
More precisely I want to change animation rate, thats why i needed the time.