Hi,
I created an automation for my roomba. It sends a notification with notify if the dust bin is not cleared until one day prior to the scheduled cleaning day defined in the roomba app.
For example, if cleaning days are set to Monday and Friday, the automation should check the dustbin status on Sunday and Thursday.
Even though, the stop conditions are defined, it spams notifications and ignored stop conditions. I could not figure out where it is wrong.
According to code, it should not send any notification if the time is past 02:00 AM on those days.
Another problem that I am not sure is the trigger. Until I restarted Home Assistant, this automation did not trigger at all.
alias: Roomba Reminder
description: ''
trigger:
- platform: template
value_template: >-
{{ is_state('binary_sensor.roomba_binfull', 'on') and (
((as_timestamp(now()) -
as_timestamp(states.binary_sensor.roomba_binfull.last_changed))/60) | int
> 1) }}
condition:
- condition: time
after: '20:00:00'
before: '23:59:59'
weekday:
- thu
- sun
action:
- service: notify.notify
data:
message: Clean the dust bin.
title: Robot Roomba Status
- repeat:
until:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.roomba_binfull
state: 'off'
for: '00:01:00'
- condition: time
weekday:
- thu
- sun
after: '20:00:00'
before: '01:00:00'
sequence:
- delay:
hours: 1
minutes: 0
seconds: 0
milliseconds: 0
- service: notify.notify
data:
message: Still not clean.
title: Robot Roomba Status
mode: single