Improve Roborock auto-start trigger and add debug notifications
This commit is contained in:
@@ -46,70 +46,74 @@
|
||||
mode: single
|
||||
|
||||
trigger:
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
- platform: state
|
||||
entity_id: binary_sensor.family_presence
|
||||
state: "off"
|
||||
to: "off"
|
||||
for: "00:05:00"
|
||||
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% set t = state_attr('input_datetime.house_became_empty', 'timestamp') %}
|
||||
{{ t is not none and (as_timestamp(now()) - t) > 300 }}
|
||||
|
||||
- condition: numeric_state
|
||||
entity_id: input_number.roborock_auto_runs_today
|
||||
below: 2
|
||||
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: vacuum.roborock_s8_pro_ultra
|
||||
state: "cleaning"
|
||||
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ state_attr('vacuum.roborock_s8_pro_ultra','battery_level') | int(0) > 20 }}
|
||||
variables:
|
||||
roborock_family_away: "{{ is_state('binary_sensor.family_presence', 'off') }}"
|
||||
roborock_auto_runs: "{{ states('input_number.roborock_auto_runs_today') | int(0) }}"
|
||||
roborock_is_cleaning: "{{ is_state('vacuum.roborock_s8_pro_ultra', 'cleaning') }}"
|
||||
roborock_battery: "{{ state_attr('vacuum.roborock_s8_pro_ultra', 'battery_level') | int(0) }}"
|
||||
|
||||
action:
|
||||
- service: button.press
|
||||
target:
|
||||
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
|
||||
|
||||
- delay: "00:00:20"
|
||||
|
||||
- choose:
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: vacuum.roborock_s8_pro_ultra
|
||||
state: "cleaning"
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{
|
||||
roborock_family_away
|
||||
and roborock_auto_runs < 2
|
||||
and not roborock_is_cleaning
|
||||
and roborock_battery > 20
|
||||
}}
|
||||
sequence:
|
||||
- service: input_number.increment
|
||||
- service: button.press
|
||||
target:
|
||||
entity_id: input_number.roborock_auto_runs_today
|
||||
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
|
||||
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "🧹 Roborock startet"
|
||||
message: >
|
||||
Hus har været tomt i {{
|
||||
((as_timestamp(now()) - state_attr('input_datetime.house_became_empty','timestamp')) / 60) | int
|
||||
}} min.
|
||||
- delay: "00:00:20"
|
||||
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: vacuum.roborock_s8_pro_ultra
|
||||
state: "cleaning"
|
||||
sequence:
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "⚠️ Roborock start fejlede"
|
||||
message: "Startkommando sendt, men den begyndte ikke at køre."
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: vacuum.roborock_s8_pro_ultra
|
||||
state: "cleaning"
|
||||
sequence:
|
||||
- service: input_number.increment
|
||||
target:
|
||||
entity_id: input_number.roborock_auto_runs_today
|
||||
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "🧹 Roborock startet"
|
||||
message: >
|
||||
Hus har været tomt i {{
|
||||
((as_timestamp(now()) - state_attr('input_datetime.house_became_empty','timestamp')) / 60) | int
|
||||
}} min.
|
||||
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: vacuum.roborock_s8_pro_ultra
|
||||
state: "cleaning"
|
||||
sequence:
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "⚠️ Roborock start fejlede"
|
||||
message: "Startkommando sendt, men den begyndte ikke at køre."
|
||||
default:
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "ℹ️ Roborock ikke startet"
|
||||
message: >
|
||||
Smart rengøring blev sprunget over.
|
||||
Familie hjemme: {{ not roborock_family_away }}.
|
||||
Auto-kørsler i dag: {{ roborock_auto_runs }}.
|
||||
Kører allerede: {{ roborock_is_cleaning }}.
|
||||
Batteri: {{ roborock_battery }}%.
|
||||
|
||||
|
||||
# 🏠 Stop når nogen kommer hjem
|
||||
|
||||
Reference in New Issue
Block a user