I have an automation to attempt to start vacuuming every 15 min on tue, thu, sat and sun provided neither my wife nor I are home and provided vacuuming did not start in the last 10 hours (so basically today) and that the house is in normal mode (as opposed to holidays for instance)
Vacuuming starts on sat and sun, but does not on tue nor thu.
Here is the code. Any idea why it would not run on tue nor thu?
- alias: Start Vacuuming
trigger:
- platform: time
minutes: '/15'
seconds: 0
condition:
- condition: time
after: '09:00'
before: '15:00'
weekday:
- tue
- thu
- sat
- sun
- condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.start_vacuuming.attributes.last_triggered) | int > 36000)}}'
- condition: state
entity_id: 'input_boolean.normal'
state: "on"
- condition: state
entity_id: device_tracker.zevsmpjl_div_iphone
state: not_home
- condition: state
entity_id: device_tracker.zevsmpjl_lolo_iphone
state: not_home
action:
- service: vacuum.turn_on
data:
entity_id: vacuum.mi_robot_vacuum
- service: notify.gmaillolo
data_template:
message: 'Mi Robot Started Vacuuming...'
Thanks @Partybug for looking into it. Unfortunately it doesn’t help. Like I said the automation works well on Sat and Sun so it would mean the other conditions and the trigger are fine. I just can’t understand why it doesn’t get triggered on Tuesday or Thursday
I actually found out today why it didn’t work. On Tues and Thurs I’m at work, and I’ve set up a zone for this.
I’ve not set up a zone for Sat and Sun.
So on Sat and Sun the condition state: not_home was true, but not on tues/thurs.
I’ve changed the condition into