Hello there!
I wrote a quite complex automation to run my robot vacuum and tested it by manually triggering the automation during development. The trigger is a really simple one but it won’t trigger at all.
So i I’ve got a few questions regarding the “triggering”:
- Does triggering an automation by hand skip the condition-checks?
- Does the “last triggered” value in the automations-overview show only “triggered” or “triggered and passed conditions”?
- Do you see any problems in my following automation causing it to not getting triggered?
alias: Auto-cleaning
description: >-
Clean room while nobody is home
trigger:
- platform: time_pattern
minutes: /16
condition:
- condition: time
after: '08:00:00'
before: '20:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: not
conditions:
- condition: state
entity_id: group.residents
state: home
- condition: template
value_template: >-
'{{ states('sensor.date') > states('input_datetime.livingroom_cleaned')
}}'
- condition: template
value_template: '{{ not is_state(''vacuum.borris'', ''cleaning'') }}'
action:
- service: xiaomi_miio.vacuum_clean_segment
data:
segments:
- 16
entity_id: vacuum.borris
- wait_template: '{{ is_state(''vacuum.borris'', ''cleaning'') }}'
timeout: '00:00:10'
continue_on_timeout: true
- repeat:
while:
- condition: template
value_template: '{{ is_state(''vacuum.borris'', ''cleaning'') }}'
sequence:
- service: >-
{% if is_state('group.residents' , 'home') %} script.dockVacuum {%
else %} script.waitOne {% endif %}
- condition: not
conditions:
- condition: state
entity_id: group.residents
state: home
- service: input_datetime.set_datetime
data_template:
date: '{{ states(''sensor.date'') }}'
entity_id: input_datetime.livingroom_cleaned
mode: single
Additionally I tried some things in the development-tools to verify my conditions:
{{ states('input_datetime.livingroom_cleaned') }}
2020-12-20
{{ states('sensor.date') }}
2020-12-22
{{ states('sensor.date') > states('input_datetime.livingroom_cleaned') }}
True
{{ states('group.residents') }}
not_home
I hope this is not too complicated or worse - too easy.
All suggestions and improvements are welcome.
Thanks in advance!