Refine vacuum automation logic in README and vacuum.yaml. Updated phase change conditions to ensure the vacuum is not actively cleaning before advancing phases. Improved clarity in comments regarding task completion and queue management.

master
Carlo Costanzo 10 hours ago
parent b0514476c6
commit 7ab6f875f5

@ -67,7 +67,7 @@ Live collection of plug-and-play Home Assistant packages. Each YAML file in this
### Dreame vacuum automations ### Dreame vacuum automations
- Logic lives in [vacuum.yaml](vacuum.yaml): continuous four-phase loop (sweep main, sweep baths, mop main, mop baths) driven by `input_select.l10s_vacuum_phase` and `input_text.l10s_vacuum_room_queue`, with per-room notifications and automatic reseeding between phases. - Logic lives in [vacuum.yaml](vacuum.yaml): continuous four-phase loop (sweep main, sweep baths, mop main, mop baths) driven by `input_select.l10s_vacuum_phase` and `input_text.l10s_vacuum_room_queue`, with per-room notifications and automatic reseeding between phases.
- Uses the Dreame HACS integration with segment IDs to enforce bathrooms last in each sweep/mop pass, dock on arrival, and auto-run if idle for 3+ days. - Uses the Dreame HACS integration with segment IDs to enforce bathrooms last in each sweep/mop pass, dock on arrival, and auto-run if idle for 3+ days.
- Room queue advances on a 2-minute dwell in `sensor.l10s_vacuum_current_room` (queue = remaining rooms); phase changes happen when an empty queue is reseeded after a completed task. - Room queue advances on a 2-minute dwell in `sensor.l10s_vacuum_current_room` (queue = remaining rooms); phase changes happen when an empty queue is reseeded and the vacuum is not actively cleaning.
- One-off room cleaning for Alexa uses `input_boolean.l10s_vacuum_clean_*` (example: "Kitchen Clean") and runs a segment job without touching or checking the phased queue. - One-off room cleaning for Alexa uses `input_boolean.l10s_vacuum_clean_*` (example: "Kitchen Clean") and runs a segment job without touching or checking the phased queue.
- Formal Dining (room 17/dock) is excluded from phased queues; clean it via the one-off toggle. - Formal Dining (room 17/dock) is excluded from phased queues; clean it via the one-off toggle.
![Dreame Automations](../www/custom_ui/floorplan/images/branding/Dreame%20Automations.png) ![Dreame Automations](../www/custom_ui/floorplan/images/branding/Dreame%20Automations.png)

@ -10,7 +10,7 @@
# Notes: # Notes:
# - `sensor.l10s_vacuum_current_room` can change during transit; require a dwell (`for:`) before dequeuing. # - `sensor.l10s_vacuum_current_room` can change during transit; require a dwell (`for:`) before dequeuing.
# - Treat 2+ minutes in a room as "being cleaned" and dequeue immediately (queue = remaining rooms). # - Treat 2+ minutes in a room as "being cleaned" and dequeue immediately (queue = remaining rooms).
# - Phase changes happen when the queue is reseeded after task completion (queue is the source of truth). # - Phase changes happen when the queue is reseeded after the queue hits zero and the vacuum is not actively cleaning (queue is the source of truth).
# - Avoid reissuing `dreame_vacuum.vacuum_clean_segment` while already cleaning; only send a new segment job when starting/resuming or switching phases. # - Avoid reissuing `dreame_vacuum.vacuum_clean_segment` while already cleaning; only send a new segment job when starting/resuming or switching phases.
# - Jinja2 loop scoping: use a `namespace` when building lists (otherwise the queue can appear empty and get cleared). # - Jinja2 loop scoping: use a `namespace` when building lists (otherwise the queue can appear empty and get cleared).
# - Docked + task complete only logs queue state; no auto-clearing. # - Docked + task complete only logs queue state; no auto-clearing.
@ -125,10 +125,10 @@ script:
next_phase: "{{ phase_order[phase_index + 1] if has_next_phase else '' }}" next_phase: "{{ phase_order[phase_index + 1] if has_next_phase else '' }}"
queue_raw: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | string | replace(' ', '') }}" queue_raw: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | string | replace(' ', '') }}"
queue_ints: "{{ queue_raw | regex_findall('[0-9]+') | map('int') | select('gt', 0) | list }}" queue_ints: "{{ queue_raw | regex_findall('[0-9]+') | map('int') | select('gt', 0) | list }}"
task_status: "{{ states('sensor.l10s_vacuum_task_status') | default('', true) | string | lower }}" vac_state: "{{ states('vacuum.l10s_vacuum') | default('', true) | string | lower }}"
task_completed: "{{ task_status == 'completed' }}" vac_is_cleaning: "{{ vac_state == 'cleaning' }}"
phase_ready: "{{ is_state('input_boolean.l10s_vacuum_phase_ready', 'on') }}" phase_ready: "{{ is_state('input_boolean.l10s_vacuum_phase_ready', 'on') }}"
advance_phase: "{{ queue_ints | length == 0 and task_completed and phase_ready }}" advance_phase: "{{ queue_ints | length == 0 and phase_ready and not vac_is_cleaning }}"
reset_cycle: "{{ advance_phase and not has_next_phase }}" reset_cycle: "{{ advance_phase and not has_next_phase }}"
phase_for_seed: "{{ next_phase if advance_phase and has_next_phase else phase }}" phase_for_seed: "{{ next_phase if advance_phase and has_next_phase else phase }}"
cleaning_mode: "{{ 'sweeping_and_mopping' if 'mop_' in phase_for_seed else 'sweeping' }}" cleaning_mode: "{{ 'sweeping_and_mopping' if 'mop_' in phase_for_seed else 'sweeping' }}"

Loading…
Cancel
Save

Powered by TurnKey Linux.