How can I check if the datetime of helper has passed?
Checking for time doesnt work, because it only checks time, not date.
And this also doenst work
condition: template
value_template: now() > input_datetime.nextclean
How can I check if the datetime of helper has passed?
Checking for time doesnt work, because it only checks time, not date.
And this also doenst work
condition: template
value_template: now() > input_datetime.nextclean
value_template: "{{ now() > states('input_datetime.nextclean')|as_datetime|as_local }}"
That’s not a template. It will need to be surrounded by quotes and then start and end with curly brackets. You should also get in the habit of trying out your templates in the template tool (developer tools > template ).
Once you get all the formatting worked out, the next thing to learn is that you need to use the states()
function to access the state of an entity. Then next is that all states are strings, so you will have to convert them when necessary.
Try this in the template tool:
{{ now() > states('input_datetime.nextclean') | as_datetime | as_local }}
Also for more on how to use templates: