Compare commits
8 Commits
800bc5b7ea
...
734bbe9ad6
| Author | SHA1 | Date | |
|---|---|---|---|
| 734bbe9ad6 | |||
| 2ec90e316b | |||
| 8c1dded88e | |||
| ed6a67b7af | |||
| 290b0aa373 | |||
| a93cad7434 | |||
| 2d51a1a41c | |||
| 5c90741847 |
@@ -12,7 +12,7 @@
|
|||||||
- alias: 'Daniel kommer hjem (mor)'
|
- alias: 'Daniel kommer hjem (mor)'
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.daniels_iphone_7_3
|
entity_id: device_tracker.unifi_daniel
|
||||||
to: 'home'
|
to: 'home'
|
||||||
|
|
||||||
action:
|
action:
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
- alias: 'Daniel kommer hjem'
|
- alias: 'Daniel kommer hjem'
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.daniels_iphone_7_3
|
entity_id: device_tracker.unifi_daniel
|
||||||
to: 'home'
|
to: 'home'
|
||||||
|
|
||||||
action:
|
action:
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
- alias: 'Andreas kommer hjem (mor)'
|
- alias: 'Andreas kommer hjem (mor)'
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.andreas_iphone_12
|
entity_id: device_tracker.unifi_andreas
|
||||||
to: 'home'
|
to: 'home'
|
||||||
|
|
||||||
action:
|
action:
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
- alias: 'Andreas kommer hjem'
|
- alias: 'Andreas kommer hjem'
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.andreas_iphone_12
|
entity_id: device_tracker.unifi_andreas
|
||||||
to: 'home'
|
to: 'home'
|
||||||
|
|
||||||
action:
|
action:
|
||||||
|
|||||||
@@ -1,29 +1,31 @@
|
|||||||
- id: garage_auto_claus_distance
|
- id: garage_auto_claus_presence
|
||||||
alias: Garage auto Claus
|
alias: Garage auto Claus
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: numeric_state
|
- platform: state
|
||||||
entity_id: sensor.claus_distance_home
|
entity_id: device_tracker.clausiphone
|
||||||
below: 40
|
to: "home"
|
||||||
id: arriving
|
id: arriving
|
||||||
|
|
||||||
- platform: numeric_state
|
- platform: state
|
||||||
entity_id: sensor.claus_distance_home
|
entity_id: device_tracker.clausiphone
|
||||||
above: 60
|
from: "home"
|
||||||
|
to: "not_home"
|
||||||
id: leaving
|
id: leaving
|
||||||
|
|
||||||
condition:
|
condition:
|
||||||
- condition: time
|
- condition: time
|
||||||
after: "05:30:00"
|
after: "05:00:00"
|
||||||
before: "22:30:00"
|
before: "23:00:00"
|
||||||
|
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: device_tracker.snowywhite_location_tracker
|
entity_id: device_tracker.snowywhite_location_tracker
|
||||||
state: "home"
|
state: "home"
|
||||||
|
|
||||||
action:
|
action:
|
||||||
- choose:
|
- choose:
|
||||||
|
|
||||||
# ÅBN
|
# ÅBN (Arriving)
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: arriving
|
id: arriving
|
||||||
@@ -35,7 +37,11 @@
|
|||||||
target:
|
target:
|
||||||
entity_id: cover.anne
|
entity_id: cover.anne
|
||||||
|
|
||||||
# LUK
|
- service: notify.mobile_app_clausiphone15
|
||||||
|
data:
|
||||||
|
message: "Garage opened (arrival detected)"
|
||||||
|
|
||||||
|
# LUK (Leaving)
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: leaving
|
id: leaving
|
||||||
@@ -47,5 +53,9 @@
|
|||||||
target:
|
target:
|
||||||
entity_id: cover.anne
|
entity_id: cover.anne
|
||||||
|
|
||||||
|
- service: notify.mobile_app_clausiphone15
|
||||||
|
data:
|
||||||
|
message: "Garage closed (departure detected)"
|
||||||
|
|
||||||
mode: single
|
mode: single
|
||||||
|
|
||||||
|
|||||||
@@ -1,74 +1,107 @@
|
|||||||
- id: roborock_smart_cleaning
|
- id: track_house_empty_time
|
||||||
alias: Roborock Smart Cleaning
|
alias: Track House Empty Time
|
||||||
mode: single
|
mode: restart
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- id: house_empty
|
- platform: state
|
||||||
platform: state
|
|
||||||
entity_id: binary_sensor.family_presence
|
entity_id: binary_sensor.family_presence
|
||||||
to: "off"
|
to: "off"
|
||||||
for: "00:30:00"
|
|
||||||
|
|
||||||
- id: someone_home
|
condition:
|
||||||
platform: state
|
- condition: template
|
||||||
entity_id: binary_sensor.family_presence
|
value_template: "{{ trigger.from_state.state != 'unavailable' }}"
|
||||||
to: "on"
|
|
||||||
|
|
||||||
- id: midnight
|
action:
|
||||||
platform: time
|
- service: input_datetime.set_datetime
|
||||||
|
target:
|
||||||
|
entity_id: input_datetime.house_became_empty
|
||||||
|
data:
|
||||||
|
timestamp: "{{ now().timestamp() }}"
|
||||||
|
|
||||||
|
- id: roborock_reset_daily_counter
|
||||||
|
alias: Roborock Reset Daily Counter
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
at: "00:00:00"
|
at: "00:00:00"
|
||||||
|
|
||||||
action:
|
action:
|
||||||
- choose:
|
- service: input_number.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_number.roborock_auto_runs_today
|
||||||
|
data:
|
||||||
|
value: 0
|
||||||
|
|
||||||
# 🔹 Reset daglig tæller ved midnat
|
- id: roborock_smart_cleaning_start
|
||||||
- conditions:
|
alias: Roborock Smart Cleaning Start
|
||||||
- condition: trigger
|
mode: single
|
||||||
id: midnight
|
|
||||||
sequence:
|
|
||||||
- service: input_number.set_value
|
|
||||||
target:
|
|
||||||
entity_id: input_number.roborock_auto_runs_today
|
|
||||||
data:
|
|
||||||
value: 0
|
|
||||||
|
|
||||||
# 🔹 Start rengøring hvis huset har været tomt i 30 min
|
trigger:
|
||||||
- conditions:
|
# Tjek løbende mens huset er tomt
|
||||||
- condition: trigger
|
- platform: time_pattern
|
||||||
id: house_empty
|
minutes: "/5"
|
||||||
|
|
||||||
- condition: numeric_state
|
condition:
|
||||||
entity_id: input_number.roborock_auto_runs_today
|
# Huset er tomt
|
||||||
below: 2
|
- condition: state
|
||||||
|
entity_id: binary_sensor.family_presence
|
||||||
|
state: "off"
|
||||||
|
|
||||||
- condition: state
|
# Har været tomt i 30 min (robust)
|
||||||
entity_id: vacuum.roborock_s8_pro_ultra
|
- condition: template
|
||||||
state: docked
|
value_template: >
|
||||||
|
{{ states('input_datetime.house_became_empty') not in ['unknown','unavailable',''] and
|
||||||
|
(as_timestamp(now()) - as_timestamp(states('input_datetime.house_became_empty'))) > 1800 }}
|
||||||
|
|
||||||
- condition: numeric_state
|
# Max 2 gange dagligt
|
||||||
entity_id: vacuum.roborock_s8_pro_ultra
|
- condition: numeric_state
|
||||||
attribute: battery_level
|
entity_id: input_number.roborock_auto_runs_today
|
||||||
above: 20
|
below: 2
|
||||||
|
|
||||||
sequence:
|
# Støvsuger klar (robust state check)
|
||||||
- service: button.press
|
- condition: template
|
||||||
target:
|
value_template: >
|
||||||
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
|
{{ states('vacuum.roborock_s8_pro_ultra') in ['docked','idle','charging'] }}
|
||||||
|
|
||||||
- service: input_number.increment
|
# Batteri OK
|
||||||
target:
|
- condition: numeric_state
|
||||||
entity_id: input_number.roborock_auto_runs_today
|
entity_id: vacuum.roborock_s8_pro_ultra
|
||||||
|
attribute: battery_level
|
||||||
|
above: 20
|
||||||
|
|
||||||
# 🔹 Stop robotten hvis nogen kommer hjem
|
action:
|
||||||
- conditions:
|
- alias: "Start cleaning (retry op til 3 gange)"
|
||||||
- condition: trigger
|
repeat:
|
||||||
id: someone_home
|
count: 3
|
||||||
|
sequence:
|
||||||
|
- service: button.press
|
||||||
|
target:
|
||||||
|
entity_id: button.roborock_s8_pro_ultra_kokken_bryggers
|
||||||
|
|
||||||
- condition: state
|
- delay: "00:00:20"
|
||||||
entity_id: vacuum.roborock_s8_pro_ultra
|
|
||||||
state: cleaning
|
|
||||||
|
|
||||||
sequence:
|
- condition: state
|
||||||
- service: vacuum.return_to_base
|
entity_id: vacuum.roborock_s8_pro_ultra
|
||||||
target:
|
state: "cleaning"
|
||||||
entity_id: vacuum.roborock_s8_pro_ultra
|
|
||||||
|
- service: input_number.increment
|
||||||
|
target:
|
||||||
|
entity_id: input_number.roborock_auto_runs_today
|
||||||
|
|
||||||
|
- id: roborock_stop_when_home
|
||||||
|
alias: Roborock Stop When Someone Comes Home
|
||||||
|
mode: restart
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.family_presence
|
||||||
|
to: "on"
|
||||||
|
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: vacuum.roborock_s8_pro_ultra
|
||||||
|
state: "cleaning"
|
||||||
|
|
||||||
|
action:
|
||||||
|
- service: vacuum.return_to_base
|
||||||
|
target:
|
||||||
|
entity_id: vacuum.roborock_s8_pro_ultra
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
house_became_empty:
|
||||||
|
name: House Became Empty
|
||||||
|
has_date: true
|
||||||
|
has_time: true
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
roborock_auto_runs_today:
|
roborock_auto_runs_today:
|
||||||
name: Roborock Auto Runs Today
|
name: Roborock Auto Runs Today
|
||||||
min: 0
|
min: 0
|
||||||
max: 2
|
max: 5
|
||||||
step: 1
|
step: 1
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ binary_sensor:
|
|||||||
device_class: presence
|
device_class: presence
|
||||||
state: >
|
state: >
|
||||||
{{ [
|
{{ [
|
||||||
states('person.anne_schusler_dethlefsen'),
|
states('device_tracker.unifi_anne'),
|
||||||
states('person.claus_dethlefsen'),
|
states('device_tracker.unifi_claus'),
|
||||||
states('person.andreas_schusler_dethlefsen'),
|
states('device_tracker.unifi_andreas'),
|
||||||
states('person.daniel_schusler_dethlefsen')
|
states('device_tracker.unifi_daniel')
|
||||||
] | select('eq', 'home') | list | count > 0 }}
|
] | select('eq', 'home') | list | count > 0 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user