From f59daeee1cf24d6b7f32d5c9c0b5bce1547dc7e3 Mon Sep 17 00:00:00 2001 From: "J.P. Krauss" Date: Tue, 17 Oct 2023 09:47:35 -0700 Subject: [PATCH] Add Vacuum Package --- packages/vacuum/README.md | 7 +++++ packages/vacuum/vacuum.yaml | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 packages/vacuum/README.md create mode 100644 packages/vacuum/vacuum.yaml diff --git a/packages/vacuum/README.md b/packages/vacuum/README.md new file mode 100644 index 0000000..91b4594 --- /dev/null +++ b/packages/vacuum/README.md @@ -0,0 +1,7 @@ +# Vacuum Package + +This package contains scripts and automations for running robot vacuums. Assumes the following entities are set up and configured with MQTT: + +| Vacuum | Model | Entity | +|---|---|---| +| Furbot | Dreame D10s Plus | `vacuum.valetudo_furbot` | diff --git a/packages/vacuum/vacuum.yaml b/packages/vacuum/vacuum.yaml new file mode 100644 index 0000000..4d680d3 --- /dev/null +++ b/packages/vacuum/vacuum.yaml @@ -0,0 +1,55 @@ +# Vacuum Package + +# ----------------------------------------------------------------------------- +# Vacuum Helpers +input_text: + furbot_last_fan_speed: + name: Furbot Last Fan Speed + initial: "" + +# ----------------------------------------------------------------------------- +# Vacuum Scripts +script: + + # Vacuum the bedroom (room ) only with high suction and two passes + furbot_deep_clean_bedroom: + alias: "Furbot: Deep Clean Bedroom" + sequence: + # Cache the fan setting and reset it when cleaning finishes + - service: input_text.set_value + target: + entity_id: input_text.furbot_last_fan_speed + data: + value: "{{ states('select.valetudo_furbot_fan') }}" + + # Start Cleaning + - service: mqtt.publish + data: + topic: valetudo/furbot/FanSpeedControlCapability/preset/set + payload: max + + - service: mqtt.publish + data: + topic: valetudo/furbot/MapSegmentationCapability/clean/set + payload: '{"segment_ids": ["2"], "iterations": 2}' + +# ----------------------------------------------------------------------------- +# Vacuum Automations +automation: + + # Reset the Fan Speed when cleaning is complete (if cached) + - alias: "Furbot: Reset Fan Speed" + trigger: + - platform: entity + entity_id: vacuum.valetudo_furbot + to: docked + condition: "{{ states('input_text.furbot_last_fan_speed') != '' }}" + action: + - service: mqtt.publish + data: + topic: valetudo/furbot/FanSpeedControlCapability/preset/set + payload: "{{ states('input_text.furbot_last_fan_speed') }}" + + - service: input_text.reload + target: + entity_id: input_text.furbot_last_fan_speed