This is a blueprint that sends notifications to your phone with the option to snooze the reminder.
I have a Roborock S7 MaxV ultra and multiple floors that need cleaning. In short, one floor is cleaned automatically, but for the others I need to bring the robot to clean them, but I never really did it on a fixed schedule. I could just make a calendar, but I prefer to do it when I’m working from home and then preferably only if the last time was a certain amount of days ago.
This automation will keep track of the next day the cleaning has to take place, for this reason you need to create an input_datetime helper to store the date in. It will use the vacuum sensors to check if the cleaning was done and then automatically plan the next date. If noone is home, it will not send a reminder and just remind you the next time when it is possible.
blueprint:
name: Reminder to clean a floor with the vacuum
description: 'Sends a notification with a reminder to clean a certain floor, allowing for snoozing a day and if a binary sensor is on (for instance tracking if anyone is home)'
domain: automation
input:
clean_date:
name: Date sensor
description: "This entity will hold the date of the next planned clean. It needs to be an input_datetime helper entity set to 'Date'."
selector:
entity:
domain: input_datetime
map_sensor:
name: Map sensor
description: "sensor showing the current map being cleaned. Will be used to signal that a clean has started together with the robot sensor"
selector:
entity:
domain:
- sensor
- select
map_name:
name: Map name
description: Map name of the floor to be cleaned. Needs to match the value in the Map sensor.
selector:
text:
vacuum:
name: vacuum
description: "The vacuum entity, keeps track of the vacuum state"
selector:
entity:
domain: vacuum
home:
name: home
description: Binary sensor or person checking if the action can be completed i.e. that someone is at home
selector:
entity:
domain:
- person
- binary_sensor
reminder_time_start:
name: Reminder time start
description: "Earliest time when the reminder should be sent."
default: '10:00'
selector:
time:
reminder_time_end:
name: Reminder time end
description: "Latest time when the reminder should be sent, is used in conjunction with the available sensor, so will trigger if in this time window and coming home from instance"
default: '18:00'
selector:
time:
interval_days:
name: Interval in days
description: "The interval between the cleaning"
default: 7
selector:
number:
min: 0
max: 50
mode: slider
unit_of_measurement: days
notification_title:
name: Title of the notification
description: "Title of the notification that will be sent."
default: "Bedroom needs cleaning"
selector:
text:
notification_message:
name: Message of the notification
description: "Message of the notification that will be sent."
default: "The roborock needs to be brought to the bedroom, it has been 7 days already"
selector:
text:
notify_device:
name: Notify device
description: "The device where the notification should be sent to."
selector:
device:
trigger_variables:
clean_date: !input clean_date
interval_days: !input interval_days
map_name: !input map_name
action_name_snooze: >-
{{ "snooze_clean_" ~ map_name }}
trigger:
- platform: time
at: !input reminder_time_start
id: send_message
- platform: state
entity_id: !input home
to:
- "on"
- "home"
id: send_message
- platform: state
entity_id: !input vacuum
to: cleaning
id: cleaning
- platform: state
entity_id: !input map_sensor
to: !input map_name
id: cleaning
- platform: event
event_type: mobile_app_notification_action
id: snooze
event_data:
action: "{{ action_name_snooze }}"
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id: send_message
- condition: time
after: !input reminder_time_start
before: !input reminder_time_end
- condition: template
value_template: |
{{ now() >= states(clean_date) | as_datetime | as_local }}
- condition: and
conditions:
- condition: trigger
id:
- cleaning
- condition: state
entity_id: !input vacuum
state: cleaning
- condition: state
entity_id: !input map_sensor
state: !input map_name
- condition: trigger
id: snooze
action:
- choose:
- conditions:
- condition: trigger
id:
- cleaning
sequence:
- service: input_datetime.set_datetime
data:
date: |
{{ (now() + timedelta(days= interval_days )).date() }}
target:
entity_id: !input clean_date
- conditions:
- condition: trigger
id:
- snooze
sequence:
- service: input_datetime.set_datetime
data:
date: |
{{ (now() + timedelta(days= 1 )).date() }}
target:
entity_id: !input clean_date
- conditions:
- condition: trigger
id: send_message
sequence:
- domain: mobile_app
type: notify
device_id: !input notify_device
title: !input notification_title
message: !input notification_message
data:
actions:
- title: Snooze
action: "{{ action_name_snooze }}"