Add scheduled Roborock syd cleaning

This commit is contained in:
2026-04-06 10:06:25 +02:00
parent e5136d3aed
commit 1169411aca
+96 -37
View File
@@ -1,3 +1,4 @@
# 🏠 Track hvornår huset bliver tomt
- id: track_house_empty_time - id: track_house_empty_time
alias: Track House Empty Time alias: Track House Empty Time
mode: restart mode: restart
@@ -7,15 +8,26 @@
entity_id: binary_sensor.family_presence entity_id: binary_sensor.family_presence
to: "off" to: "off"
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: binary_sensor.family_presence
state: "off"
action: action:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
target: target:
entity_id: input_datetime.house_became_empty entity_id: input_datetime.house_became_empty
data: data:
timestamp: "{{ now().timestamp() }}" timestamp: "{{ now().timestamp() }}"
# 🔄 Reset daglig tæller
- id: roborock_reset_daily_counter - id: roborock_reset_daily_counter
alias: Roborock Reset Daily Counter alias: Roborock Reset Daily Counter
trigger: trigger:
- platform: time - platform: time
at: "00:00:00" at: "00:00:00"
@@ -27,6 +39,8 @@
data: data:
value: 0 value: 0
# 🤖 Smart rengøring
- id: roborock_smart_cleaning_start - id: roborock_smart_cleaning_start
alias: Roborock Smart Cleaning Start alias: Roborock Smart Cleaning Start
mode: single mode: single
@@ -42,50 +56,36 @@
- condition: template - condition: template
value_template: > value_template: >
{{ states('input_datetime.house_became_empty') not in ['unknown','unavailable',''] and {% set t = state_attr('input_datetime.house_became_empty', 'timestamp') %}
(as_timestamp(now()) - as_timestamp(states('input_datetime.house_became_empty'))) > 1800 }} {{ t is not none and (as_timestamp(now()) - t) > 300 }}
- condition: numeric_state - condition: numeric_state
entity_id: input_number.roborock_auto_runs_today entity_id: input_number.roborock_auto_runs_today
below: 2 below: 2
- condition: template - condition: not
value_template: > conditions:
{{ states('vacuum.roborock_s8_pro_ultra') in ['docked','idle','charging'] }} - condition: state
entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
- condition: template - condition: template
value_template: > value_template: >
{% set b = state_attr('vacuum.roborock_s8_pro_ultra','battery_level') %} {{ state_attr('vacuum.roborock_s8_pro_ultra','battery_level') | int(0) > 20 }}
{{ b is number and b > 20 }}
action: action:
- variables: - service: button.press
started: false target:
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
- repeat: - delay: "00:00:20"
count: 3
sequence:
- service: button.press
target:
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
- delay: "00:00:20"
- if:
- condition: state
entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
then:
- variables:
started: true
- stop: "Cleaning started"
- choose: - choose:
# ✅ SUCCESS → send notifikation
- conditions: - conditions:
- condition: template - condition: state
value_template: "{{ started }}" entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
sequence: sequence:
- service: input_number.increment - service: input_number.increment
target: target:
@@ -95,19 +95,24 @@
data: data:
title: "🧹 Roborock startet" title: "🧹 Roborock startet"
message: > message: >
Rengøring startet automatisk. Hus har været tomt i {{
Hus har været tomt i {{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.house_became_empty'))) / 60) | int }} min. ((as_timestamp(now()) - state_attr('input_datetime.house_became_empty','timestamp')) / 60) | int
}} min.
# ❌ FAIL → send fejl-notifikation
- conditions: - conditions:
- condition: template - condition: not
value_template: "{{ not started }}" conditions:
- condition: state
entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
sequence: sequence:
- service: notify.mobile_app_clausiphone15 - service: notify.mobile_app_clausiphone15
data: data:
title: "⚠️ Roborock start fejlede" title: "⚠️ Roborock start fejlede"
message: "Automation forsøgte 3 gange uden succes." message: "Startkommando sendt, men den begyndte ikke at køre."
# 🏠 Stop når nogen kommer hjem
- id: roborock_stop_when_home - id: roborock_stop_when_home
alias: Roborock Stop When Someone Comes Home alias: Roborock Stop When Someone Comes Home
mode: restart mode: restart
@@ -131,3 +136,57 @@
data: data:
title: "🏠 Roborock stoppet" title: "🏠 Roborock stoppet"
message: "Rengøring stoppet fordi nogen er kommet hjem." message: "Rengøring stoppet fordi nogen er kommet hjem."
# 🧹 Syd på arbejdsdage
- id: roborock_syd_workday_vacuum
alias: Roborock støvsug syd på arbejdsdage
mode: single
trigger:
- platform: time
at: "10:00:00"
condition:
- condition: state
entity_id: binary_sensor.arbejdsdag
state: "on"
- condition: not
conditions:
- condition: state
entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
action:
- service: button.press
target:
entity_id: button.roborock_s8_pro_ultra_syd
# 🧽 Syd vask på arbejdsdage mandag og onsdag
- id: roborock_syd_workday_mop
alias: Roborock vask syd på arbejdsdage mandag og onsdag
mode: single
trigger:
- platform: time
at: "12:00:00"
condition:
- condition: state
entity_id: binary_sensor.arbejdsdag
state: "on"
- condition: time
weekday:
- mon
- wed
- condition: not
conditions:
- condition: state
entity_id: vacuum.roborock_s8_pro_ultra
state: "cleaning"
action:
- service: button.press
target:
entity_id: button.roborock_s8_pro_ultra_syd_vask