Hi all,
I would like to create an automation to run my robot vacuum if it did not run in the last 2 days
I’m new to yaml coding so it’s sometime a big learning curve
I’m getting an error when trying to save my code.
alias: 'Vacuum: Check if vacuum has run in the last 2 days'
description: ''
mode: single
trigger:
- platform: template
value_template: '{{ state_attr(''sensor.vacuum_last_clean_end'') | float == { (now() - as_datetime('1970-01-01 00:00:00-00:00')).days % 2 == 0 } }}
event: start
condition: []
action:
- service: script.1658143599996
data: {}
- service: script.vacuum_send_actionable_notification_to_run
data: {}
What I’m trying to do is compare the last vacumm date is equal to 48 hours to trigger an actionable notification to run the vacuum.
Thanks in advance