Skip to content

Instantly share code, notes, and snippets.

@JannickBlmndl
JannickBlmndl / piece_2_of_automations.yaml
Last active May 3, 2021 23:49
Smart home solver template_conditions
# Front doorbell motion template condition
# Template condition which only passes if it has been more than 1 minute (60 seconds) that the automation.front_doorbell_motion ran.
- condition: template
value_template: >
{% if state_attr('automation.front_doorbell_motion', 'last_triggered') %}
{{ as_timestamp(now()) | int -
as_timestamp(state_attr('automation.front_doorbell_motion', 'last_triggered')) | int > 60 }}
{% else %}
false
{% endif %}