You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

721 lines
28 KiB

######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Dreame Vacuum Orchestration - Continuous phased sweep/mop with away/on-demand
# Related Issue: 1550, 1553
# Phases: sweep main, sweep baths, mop main, mop baths; notifications + idle auto-start
# -------------------------------------------------------------------
# Notes:
# - `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).
# - Phase changes happen when the queue is reseeded after task completion (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.
# - 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.
# - Mop phases use `sweeping_and_mopping` instead of mop-only.
# - One-off room clean booleans ignore the queue; they only run when the vacuum is docked/idle.
# - Formal Dining (room 17/dock) is excluded from phased queues; clean via one-off toggle.
# - Confirm Room Cleaned drops room 17 from the queue at cycle start so it never runs first.
# - Phase changes arm when the queue hits zero; reseed advances and clears the phase-ready flag.
######################################################################
## 1. Helpers
######################################################################
input_boolean:
l10s_vacuum_on_demand:
name: Dreame Clean (On-Demand)
icon: mdi:robot-vacuum
l10s_vacuum_phase_ready:
name: L10s Vacuum Phase Ready
icon: mdi:progress-check
l10s_vacuum_clean_kitchen:
name: Kitchen Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_dining_room:
name: Dining Room Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_living_room:
name: Living Room Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_master_bedroom:
name: Master Bedroom Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_foyer:
name: Foyer Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_stacey_office:
name: Stacey Office Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_formal_dining:
name: Formal Dining Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_hallway:
name: Hallway Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_justin_bedroom:
name: Justin Bedroom Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_paige_bedroom:
name: Paige Bedroom Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_master_bathroom:
name: Master Bathroom Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_office:
name: Office Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_pool_bath:
name: Pool Bath Clean
icon: mdi:robot-vacuum
l10s_vacuum_clean_kids_bathroom:
name: Kids Bathroom Clean
icon: mdi:robot-vacuum
input_select:
l10s_vacuum_phase:
name: L10s Vacuum Phase
options:
- sweep_main
- sweep_bath
- mop_main
- mop_bath
initial: sweep_main
icon: mdi:playlist-check
input_text:
l10s_vacuum_room_queue:
name: L10s Vacuum Room Queue
# Room order (id:name): 14 Kitchen, 12 Dining, 10 Living, 7 Master Bedroom, 15 Foyer, 9 Stacey Office,
# 13 Hallway, 8 Justin Bedroom, 6 Paige Bedroom, 4 Master Bathroom, 2 Office, 1 Pool Bath, 3 Kids Bathroom.
# Formal Dining (17) is one-off only (dock room).
icon: mdi:format-list-bulleted
max: 255
l10s_vacuum_room_catalog:
name: L10s Vacuum Room Catalog
initial: "17,6,7,8,9,10,12,13,14,15,2,4,1,3"
icon: mdi:map
max: 255
l10s_vacuum_rooms_cleaned_today:
name: L10s Vacuum Rooms Cleaned Today
icon: mdi:clipboard-check-outline
max: 255
## 2. Script: Start Next Room
######################################################################
script:
l10s_vacuum_start_next_room:
alias: 'Away Vacuum: Start Next Room'
mode: single
sequence:
- variables:
catalog_raw: "{{ states('input_text.l10s_vacuum_room_catalog') | default('', true) | string | replace(' ', '') }}"
catalog_ints: "{{ catalog_raw | regex_findall('[0-9]+') | map('int') | select('gt', 0) | list }}"
bath_ids: [1, 3, 4]
main_ids: "{{ catalog_ints | reject('in', bath_ids) | list }}"
phase_order: ['sweep_main', 'sweep_bath', 'mop_main', 'mop_bath']
phase_state: "{{ states('input_select.l10s_vacuum_phase') }}"
phase: "{{ phase_state if phase_state in phase_order else 'sweep_main' }}"
phase_index: "{{ phase_order.index(phase) if phase in phase_order else 0 }}"
has_next_phase: "{{ phase_index < (phase_order | length) - 1 }}"
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_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 }}"
task_completed: "{{ task_status == 'completed' }}"
phase_ready: "{{ is_state('input_boolean.l10s_vacuum_phase_ready', 'on') }}"
advance_phase: "{{ queue_ints | length == 0 and task_completed and phase_ready }}"
reset_cycle: "{{ advance_phase and not has_next_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' }}"
phase_segments: >
{% if phase_for_seed == 'sweep_main' %}
{{ main_ids }}
{% elif phase_for_seed == 'sweep_bath' %}
{{ bath_ids }}
{% elif phase_for_seed == 'mop_main' %}
{{ main_ids }}
{% else %}
{{ bath_ids }}
{% endif %}
segments_to_clean: "{{ queue_ints if queue_ints | length > 0 else phase_segments }}"
# 0. Advance phase when reseeding an empty queue
- choose:
- conditions:
- condition: template
value_template: "{{ advance_phase and has_next_phase }}"
sequence:
- service: input_select.select_option
target:
entity_id: input_select.l10s_vacuum_phase
data:
option: "{{ phase_for_seed }}"
- service: input_boolean.turn_off
target:
entity_id: input_boolean.l10s_vacuum_phase_ready
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Queue reseeded; advancing phase to {{ phase_for_seed }}."
- conditions:
- condition: template
value_template: "{{ reset_cycle }}"
sequence:
- service: input_select.select_option
target:
entity_id: input_select.l10s_vacuum_phase
data:
option: "sweep_main"
- service: input_boolean.turn_off
target:
entity_id: input_boolean.l10s_vacuum_phase_ready
- service: input_boolean.turn_off
target:
entity_id: input_boolean.l10s_vacuum_on_demand
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "All phases complete; resetting phase to sweep_main and disabling On-Demand."
- stop: "All phases complete."
default: []
# 1. Seed the queue if necessary
- choose:
- conditions:
- condition: template
value_template: "{{ queue_ints | length == 0 and phase_segments | length > 0 }}"
sequence:
- service: input_text.set_value
target:
entity_id: input_text.l10s_vacuum_room_queue
data:
value: "{{ phase_segments | join(',') }}"
default: []
# 2. Check if there is anything to clean and stop if not
- choose:
- conditions:
- condition: template
value_template: "{{ segments_to_clean | length == 0 }}"
sequence:
- stop: 'No rooms left to clean today.'
default: []
# 3. Start cleaning
- service: select.select_option
target:
entity_id: select.l10s_vacuum_cleaning_mode
data:
option: "{{ cleaning_mode }}"
- service: vacuum.set_fan_speed
target:
entity_id: vacuum.l10s_vacuum
data:
fan_speed: Standard
- service: dreame_vacuum.vacuum_clean_segment
target:
entity_id: vacuum.l10s_vacuum
data:
# Clean the non-bathrooms if any, otherwise clean the bathrooms
segments: "{{ segments_to_clean }}"
## 3. Automations
######################################################################
automation:
- alias: 'Vacuum: Reset Cleaned List at 5am'
id: 18f7b6d3-c02c-4ec1-88b3-0c3b8b4c6f7b
trigger:
- platform: time
at: '05:00:00'
action:
- service: input_text.set_value
target:
entity_id: input_text.l10s_vacuum_rooms_cleaned_today
data:
value: ""
- service: input_boolean.turn_off
target:
entity_id: input_boolean.l10s_vacuum_phase_ready
- alias: 'Vacuum: Auto-Start if Idle 4 Days'
id: c6b3f1e8-9a3f-4098-9b9e-1c7f2d6f1d11
trigger:
- platform: time
at: '17:00:00'
condition:
- condition: template
value_template: >
{% set last = state_attr('script.l10s_vacuum_start_next_room','last_triggered') %}
{{ last is none or (now() - last).days >= 4 }}
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.l10s_vacuum_on_demand
- alias: 'Vacuum: One-Off Room Clean (Alexa)'
id: 5e2fd2b1-3f45-4680-ae74-68bb116cf1e8
mode: queued
trigger:
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_kitchen
to: 'on'
id: kitchen
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_dining_room
to: 'on'
id: dining_room
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_living_room
to: 'on'
id: living_room
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_master_bedroom
to: 'on'
id: master_bedroom
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_foyer
to: 'on'
id: foyer
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_stacey_office
to: 'on'
id: stacey_office
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_formal_dining
to: 'on'
id: formal_dining
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_hallway
to: 'on'
id: hallway
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_justin_bedroom
to: 'on'
id: justin_bedroom
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_paige_bedroom
to: 'on'
id: paige_bedroom
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_master_bathroom
to: 'on'
id: master_bathroom
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_office
to: 'on'
id: office
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_pool_bath
to: 'on'
id: pool_bath
- platform: state
entity_id: input_boolean.l10s_vacuum_clean_kids_bathroom
to: 'on'
id: kids_bathroom
variables:
room_map:
kitchen: {segment: 14, name: Kitchen}
dining_room: {segment: 12, name: 'Dining Room'}
living_room: {segment: 10, name: 'Living Room'}
master_bedroom: {segment: 7, name: 'Master Bedroom'}
foyer: {segment: 15, name: Foyer}
stacey_office: {segment: 9, name: 'Stacey Office'}
formal_dining: {segment: 17, name: 'Formal Dining'}
hallway: {segment: 13, name: Hallway}
justin_bedroom: {segment: 8, name: 'Justin Bedroom'}
paige_bedroom: {segment: 6, name: 'Paige Bedroom'}
master_bathroom: {segment: 4, name: 'Master Bathroom'}
office: {segment: 2, name: Office}
pool_bath: {segment: 1, name: 'Pool Bath'}
kids_bathroom: {segment: 3, name: 'Kids Bathroom'}
room_key: "{{ trigger.id }}"
room_name: "{{ room_map[room_key].name }}"
segment_id: "{{ room_map[room_key].segment | int }}"
vac_state: "{{ states('vacuum.l10s_vacuum') }}"
on_demand: "{{ is_state('input_boolean.l10s_vacuum_on_demand', 'on') }}"
queue_raw: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | string | trim }}"
can_start: "{{ vac_state in ['docked', 'idle'] }}"
action:
- choose:
- conditions:
- condition: template
value_template: "{{ can_start }}"
sequence:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "One-off clean: {{ room_name }}."
- continue_on_error: true
service: select.select_option
target:
entity_id: select.l10s_vacuum_cleaning_mode
data:
option: sweeping
- continue_on_error: true
service: vacuum.set_fan_speed
target:
entity_id: vacuum.l10s_vacuum
data:
fan_speed: Standard
- continue_on_error: true
service: dreame_vacuum.vacuum_clean_segment
target:
entity_id: vacuum.l10s_vacuum
data:
segments: "{{ [segment_id] }}"
- delay: "00:00:02"
default:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "One-off clean blocked: {{ room_name }} (vac={{ vac_state }}, on_demand={{ on_demand }}, queue='{{ queue_raw }}')."
- service: input_boolean.turn_off
data:
entity_id: "{{ trigger.entity_id }}"
- alias: 'Away Vacuum: Start or Resume When we leave or On-Demand'
id: 7f7e0a3c-6452-4f6b-8464-c6c25770a148
trigger:
- platform: state
entity_id: group.family
to: 'not_home'
- platform: state
entity_id: input_boolean.l10s_vacuum_on_demand
to: 'on'
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: template
value_template: >
{{ is_state('input_boolean.l10s_vacuum_on_demand', 'on') or is_state('group.family', 'not_home') }}
- condition: template
value_template: >
true
- condition: template
value_template: "{{ not is_state('vacuum.l10s_vacuum', 'cleaning') }}"
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.l10s_vacuum_on_demand
- service: script.l10s_vacuum_start_next_room
- alias: 'Away Vacuum: Dock When Family Returns'
id: 1ef172f2-4b30-4e5b-953d-d4d1ca8701ad
trigger:
- platform: state
entity_id: group.family
to: 'home'
- platform: state
entity_id: input_boolean.l10s_vacuum_on_demand
to: 'off'
condition:
- condition: template
value_template: >
{{ is_state('vacuum.l10s_vacuum', 'cleaning') or is_state('vacuum.l10s_vacuum', 'returning') or is_state('vacuum.l10s_vacuum', 'paused') }}
action:
- service: vacuum.pause
target:
entity_id: vacuum.l10s_vacuum
- delay: 00:00:10
- service: vacuum.return_to_base
target:
entity_id: vacuum.l10s_vacuum
- service: input_boolean.turn_off
target:
entity_id: input_boolean.l10s_vacuum_on_demand
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Family home; docking vacuum and disabling On-Demand."
- alias: 'Away Vacuum: Confirm Room Cleaned'
id: c581c570-55b0-4acd-8b5d-53cfb486cc2a
mode: single
trigger:
- platform: state
entity_id: sensor.l10s_vacuum_current_room
for: '00:02:00'
variables:
room_map: {14: Kitchen, 12: 'Dining Room', 10: 'Living Room', 7: 'Master Bedroom', 15: Foyer, 9: 'Stacey Office', 17: 'Formal Dining', 13: Hallway, 8: 'Justin Bedroom', 6: 'Paige Bedroom', 4: 'Master Bathroom', 2: Office, 1: 'Pool Bath', 3: 'Kids Bathroom'}
queue_raw: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | string | replace(' ', '') }}"
queue_ints_raw: "{{ queue_raw | regex_findall('[0-9]+') | map('int') | select('gt', 0) | list | default([], true) }}"
queue_has_17: "{{ 17 in queue_ints_raw }}"
queue_ints: "{{ queue_ints_raw | reject('equalto', 17) | list }}"
queue_without_17: "{{ queue_ints | join(',') }}"
cleaned_room_state: "{{ trigger.to_state.state if trigger.to_state is not none else '' }}"
cleaned_room_id: "{{ (trigger.to_state.attributes.room_id if trigger.to_state is not none else 0) | int(0) }}"
matched_room_id: "{{ cleaned_room_id if cleaned_room_id > 0 and cleaned_room_id in (queue_ints | default([], true)) else 0 }}"
room_name: "{{ room_map.get(matched_room_id, cleaned_room_state) }}"
remaining_list: >
{% set ns = namespace(rem=[]) %}
{% set removed = namespace(done=false) %}
{% for r in queue_ints %}
{% if not removed.done and r == matched_room_id %}
{% set removed.done = true %}
{% else %}
{% set ns.rem = ns.rem + [r] %}
{% endif %}
{% endfor %}
{{ ns.rem }}
remaining_rooms: "{{ remaining_list | join(',') }}"
remaining_count: "{{ remaining_list | length }}"
phase_order: ['sweep_main', 'sweep_bath', 'mop_main', 'mop_bath']
phase_state: "{{ states('input_select.l10s_vacuum_phase') }}"
phase: "{{ phase_state if phase_state in phase_order else 'sweep_main' }}"
phase_index: "{{ phase_order.index(phase) if phase in phase_order else 0 }}"
has_next_phase: "{{ phase_index < (phase_order | length) - 1 }}"
next_phase: "{{ phase_order[phase_index + 1] if has_next_phase else '' }}"
condition:
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and trigger.from_state.state != trigger.to_state.state }}
- condition: template
value_template: "{{ queue_ints_raw | length > 0 }}"
- condition: template
value_template: "{{ matched_room_id != 0 or queue_has_17 }}"
- condition: state
entity_id: vacuum.l10s_vacuum
state: 'cleaning'
- condition: state
entity_id: input_boolean.l10s_vacuum_on_demand
state: 'on'
action:
- variables:
vac_status: "{{ state_attr('vacuum.l10s_vacuum', 'status') | default('', true) | string | lower }}"
vac_charging: "{{ state_attr('vacuum.l10s_vacuum', 'charging') | default(false, true) }}"
- condition: template
value_template: >
{% set is_formal_dining = matched_room_id == 17 %}
{{ not (is_formal_dining and (vac_charging or vac_status in ['charging', 'docked'])) }}
- choose:
- conditions:
- condition: template
value_template: "{{ queue_has_17 }}"
sequence:
- service: input_text.set_value
target:
entity_id: input_text.l10s_vacuum_room_queue
data:
value: "{{ queue_without_17 }}"
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Removing Formal Dining (17) from the queue at cycle start."
default: []
- choose:
- conditions:
- condition: template
value_template: "{{ matched_room_id != 0 }}"
sequence:
- service: input_text.set_value
target:
entity_id: input_text.l10s_vacuum_room_queue
data:
value: "{{ remaining_rooms }}"
- variables:
cleaned_raw: "{{ states('input_text.l10s_vacuum_rooms_cleaned_today') | default('', true) | string }}"
cleaned_parts: "{{ cleaned_raw | regex_findall('[^,]+') | map('trim') | reject('equalto','') | list }}"
updated_cleaned: >
{% set parts = cleaned_parts %}
{% if room_name not in parts %}
{{ (parts + [room_name]) | join(', ') }}
{% else %}
{{ parts | join(', ') }}
{% endif %}
- service: input_text.set_value
target:
entity_id: input_text.l10s_vacuum_rooms_cleaned_today
data:
value: "{{ updated_cleaned }}"
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "{{ room_name }} completed. Phase: {{ phase }}. Remaining: {{ remaining_count }}."
- choose:
- conditions:
- condition: template
value_template: "{{ remaining_count == 0 }}"
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.l10s_vacuum_phase_ready
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Queue empty for phase {{ phase }}; waiting for task completion to advance."
default: []
default: []
- alias: 'Away Vacuum: Clear Queue on Dock After Completion'
id: 6a2d6d8c-3c67-4e3f-9c97-0a2560890d60
mode: single
trigger:
- platform: state
entity_id: vacuum.l10s_vacuum
to: 'docked'
variables:
queue_raw: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | trim }}"
queue_empty: "{{ queue_raw == '' }}"
condition:
- condition: state
entity_id: sensor.l10s_vacuum_task_status
state: 'completed'
action:
- choose:
- conditions:
- condition: template
value_template: "{{ queue_empty }}"
sequence:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Docked after completion; queue already empty."
- conditions:
- condition: template
value_template: "{{ not queue_empty }}"
sequence:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Docked after completion; queue still has rooms: {{ queue_raw }}."
default: []
- alias: 'Away Vacuum: Resume From Dock When Queue Exists'
id: d70ad5a2-6047-4af4-8b4a-6e3b78c19774
mode: single
trigger:
- platform: state
entity_id: vacuum.l10s_vacuum
to: 'docked'
- platform: state
entity_id: input_text.l10s_vacuum_room_queue
for: '00:00:10'
condition:
- condition: state
entity_id: input_boolean.l10s_vacuum_on_demand
state: 'on'
- condition: state
entity_id: vacuum.l10s_vacuum
state: 'docked'
- condition: template
value_template: "{{ states('input_text.l10s_vacuum_room_queue') | default('', true) | trim != '' }}"
action:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Docked with queue set; resuming next room without waiting for departure."
- service: script.l10s_vacuum_start_next_room
- alias: 'Vacuum Sensor Cleaning Silencer'
id: 6548de52-a4a4-4df2-9d66-9c2c15577a7f
trigger:
- platform: numeric_state
entity_id: sensor.l10s_vacuum_sensor_dirty_left
below: 10
condition:
- condition: state
entity_id: sensor.l10s_vacuum_task_status
state: 'completed'
action:
- service: button.press
target:
entity_id: button.l10s_vacuum_reset_sensor
- alias: 'Help Vacuum'
id: 6548de52-a4a4-4df2-9d66-9c2c15577a7e
trigger:
- platform: state
entity_id: sensor.l10s_vacuum_error
- platform: event
event_type: event_did_someone_help_vacuum_loop
condition:
- condition: template
value_template: "{{ states('sensor.l10s_vacuum_error') not in ['no_error', 'unavailable'] }}"
action:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "{{ states('sensor.l10s_vacuum_error') }} - {{ states('sensor.l10s_vacuum_current_room') }} (phase: {{ states('input_select.l10s_vacuum_phase') }})"
- service: repairs.create
data:
issue_id: "vacuum_error"
title: "Vacuum needs help"
severity: "warning"
persistent: true
description: >-
Vacuum reported an error and needs intervention.
Error: {{ states('sensor.l10s_vacuum_error') }}
Room: {{ states('sensor.l10s_vacuum_current_room') }}
- service: script.notify_engine
data:
title: 'Help vacuum'
value1: "{{ states('sensor.l10s_vacuum_error') }} - {{states('sensor.l10s_vacuum_current_room')}}"
who: 'family'
ios_category: 'camera'
camera_entity: 'camera.l10s_vacuum_map'
content_type: 'jpeg'
group: 'information'
- wait_template: "{{ is_state('group.bed', 'off') }}"
- wait_template: "{{ is_state('group.family', 'home') }}"
- delay: 00:03:00
- service: vacuum.locate
entity_id: vacuum.l10s_vacuum
- service: script.speech_engine
data:
value1: >
{{ "Vacuum error: " ~ states('sensor.l10s_vacuum_error') ~ " [ask Residents to help]" }}
Currently in {{states('sensor.l10s_vacuum_current_room')}}
- delay: 00:01:00
- service: vacuum.locate
entity_id: vacuum.l10s_vacuum
- delay: 00:20:00
- event: event_did_someone_help_vacuum_loop
- alias: "Vacuum Error Resolved - Clear Repair Issue"
id: 2a0b3f7f-2f1e-4d2d-8dd4-0f6e4e34b02b
mode: single
trigger:
- platform: state
entity_id: sensor.l10s_vacuum_error
to: 'no_error'
action:
- service: repairs.remove
continue_on_error: true
data:
issue_id: "vacuum_error"
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Vacuum error cleared (phase: {{ states('input_select.l10s_vacuum_phase') }})."
- alias: "Vacuum Phase Changed"
id: 3e99c6fb-7c4a-4a9f-8f2d-9f1b9a6b4baf
mode: single
trigger:
- platform: state
entity_id: input_select.l10s_vacuum_phase
condition:
- condition: template
value_template: "{{ trigger.from_state is not none and trigger.to_state is not none }}"
action:
- service: script.send_to_logbook
data:
topic: "VACUUM"
message: "Phase changed: {{ trigger.from_state.state }} -> {{ trigger.to_state.state }}."

Powered by TurnKey Linux.