From 39e2a4ac8860a750ef87d6575a4a6a5b35c27f18 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 11 Oct 2021 19:27:10 +0200 Subject: [PATCH] Vacuum improvements clean only once a day disable alarm when vacuuming --- configuration/automations/vacuum.yaml | 32 ++++++++++++++++++++++++++- configuration/automations/work.yaml | 3 +-- scripts/10.modes.yaml | 4 +--- scripts/70.vacuum.yaml | 20 +++++++++++++++++ 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/configuration/automations/vacuum.yaml b/configuration/automations/vacuum.yaml index 571681d..ed9c739 100644 --- a/configuration/automations/vacuum.yaml +++ b/configuration/automations/vacuum.yaml @@ -23,4 +23,34 @@ seconds: 15 - service: vacuum.return_to_base entity_id: vacuum.robot_vacuum - mode: single \ No newline at end of file + mode: single + +- id: vacuum-finish + alias: '[Vacuum] After cleaning' + trigger: + - platform: state + entity_id: vacuum.robot_vacuum + from: 'Cleaning' + to: 'Returning to dock' + action: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.today_vacuumed + - choose: + - conditions: + - condition: state + entity_id: alarm_control_panel.ha_alarm + state: 'armed_night' + sequence: + - service: alarm_control_panel.alarm_arm_away + entity_id: alarm_control_panel.ha_alarm + +- id: vacuum-daily-reset + alias: '[Vacuum] Reset daily cleaning' + trigger: + - platform: time + at: '05:00:00' + action: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.today_vacuumed diff --git a/configuration/automations/work.yaml b/configuration/automations/work.yaml index 6abbab5..c3cd464 100644 --- a/configuration/automations/work.yaml +++ b/configuration/automations/work.yaml @@ -117,8 +117,7 @@ - thu - fri action: - - service: vacuum.start - entity_id: vacuum.robot_vacuum + - service: script.vacuum_daily - service: light.turn_on data: brightness_pct: 100 diff --git a/scripts/10.modes.yaml b/scripts/10.modes.yaml index 6d19ada..6bb36cc 100644 --- a/scripts/10.modes.yaml +++ b/scripts/10.modes.yaml @@ -122,9 +122,7 @@ leave_home: - service: climate.turn_off target: entity_id: climate.ac - - service: climate.turn_off - target: - entity_id: climate.ac + - service: script.vacuum_daily mode: single icon: mdi:home-export-outline diff --git a/scripts/70.vacuum.yaml b/scripts/70.vacuum.yaml index 798722f..51090f1 100644 --- a/scripts/70.vacuum.yaml +++ b/scripts/70.vacuum.yaml @@ -83,3 +83,23 @@ vacuum_clean_room: data: segments: 23 mode: single + +vacuum_today: + alias: Vacuum only once + sequence: + - choose: + - conditions: + - condition: state + entity_id: input_boolean.today_vacuumed + state: 'off' + sequence: + - choose: + - conditions: + - condition: state + entity_id: alarm_control_panel.ha_alarm + state: 'armed_away' + sequence: + - service: alarm_control_panel.alarm_arm_night + entity_id: alarm_control_panel.ha_alarm + - service: vacuum.start + entity_id: vacuum.robot_vacuum \ No newline at end of file