Smart home solver template_conditions

Home   »   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 %}
# Smart Shades template condition
# Template condition which only passes if the automation has been triggerd last more than 12 hours ago (43200 seconds). 
  - condition: template
    value_template: >
      {% if state_attr('automation.office_shades_up', 'last_triggered') %}
        {{ as_timestamp(now()) | int - 
        as_timestamp(state_attr('automation.office_shades_up', 'last_triggered')) | int > 43200 }} 
      {% else %}
        false
      {% endif %}
              

Leave a Reply

Your email address will not be published. Required fields are marked *