Vanding: rainbird.start_irrigation, duration sliders, toggle scripts, smart vanding med alternering og notifikation
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
- alias: 'Daniel ankommer til skole (mor)'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.daniels_iphone_7_3
|
||||
entity_id: device_tracker.daniels_iphone_17pro
|
||||
to: 'Østre Alle'
|
||||
|
||||
action:
|
||||
@@ -106,7 +106,7 @@
|
||||
- alias: 'Daniel ankommer til skole'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.daniels_iphone_7_3
|
||||
entity_id: device_tracker.daniels_iphone_17pro
|
||||
to: 'Østre Alle'
|
||||
|
||||
action:
|
||||
@@ -117,7 +117,7 @@
|
||||
- alias: 'Daniel tager fra skole'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.daniels_iphone_7_3
|
||||
entity_id: device_tracker.daniels_iphone_17pro
|
||||
from: 'Skole'
|
||||
|
||||
action:
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
- alias: 'Vanding morgen kl. 06'
|
||||
trigger:
|
||||
platform: time
|
||||
at: '06:00:00'
|
||||
action:
|
||||
- service: script.vanding_hojbed_skiftevis
|
||||
|
||||
- alias: 'Vanding aften kl. 22'
|
||||
trigger:
|
||||
platform: time
|
||||
at: '22:00:00'
|
||||
action:
|
||||
- service: script.vanding_hojbed_skiftevis
|
||||
|
||||
- alias: 'Vanding sikkerhedsstop morgen kl. 8'
|
||||
trigger:
|
||||
platform: time
|
||||
at: '08:00:00'
|
||||
action:
|
||||
- service: script.turn_off
|
||||
data:
|
||||
entity_id: script.vanding_hojbed_skiftevis
|
||||
- service: switch.turn_off
|
||||
data:
|
||||
entity_id:
|
||||
- switch.hojbed_1
|
||||
- switch.hojbed_2
|
||||
- switch.drivhus_drypvanding
|
||||
|
||||
- alias: 'Vanding sikkerhedsstop nat kl. 23'
|
||||
trigger:
|
||||
platform: time
|
||||
at: '23:00:00'
|
||||
action:
|
||||
- service: script.turn_off
|
||||
data:
|
||||
entity_id: script.vanding_hojbed_skiftevis
|
||||
- service: switch.turn_off
|
||||
data:
|
||||
entity_id:
|
||||
- switch.hojbed_1
|
||||
- switch.hojbed_2
|
||||
- switch.drivhus_drypvanding
|
||||
@@ -125,8 +125,8 @@
|
||||
{% set people = [
|
||||
('person.claus_dethlefsen', 'notify.mobile_app_claus_iphone_15pro'),
|
||||
('person.anne_schusler_dethlefsen', 'notify.mobile_app_annes_iphone_14_pro'),
|
||||
('person.andreas_schusler_dethlefsen', 'notify.mobile_app_andreas_iphone_12'),
|
||||
('person.daniel_schusler_dethlefsen', 'notify.mobile_app_daniels_iphone_13_mini')
|
||||
('person.andreas_schusler_dethlefsen', 'notify.mobile_app_andreas_iphone_17pro'),
|
||||
('person.daniel_schusler_dethlefsen', 'notify.mobile_app_daniels_iphone_17pro')
|
||||
] %}
|
||||
{% set ns = namespace(latest='2000-01-01T00:00:00+00:00', svc='notify.mobile_app_claus_iphone_15pro') %}
|
||||
{% for person_id, notify_svc in people %}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Vandingsvarighed per zone (minutter)
|
||||
vanding_varighed_hojbed_1:
|
||||
name: Varighed – Højbed 1 Ærter
|
||||
min: 0
|
||||
max: 60
|
||||
step: 5
|
||||
unit_of_measurement: min
|
||||
initial: 15
|
||||
icon: mdi:timer
|
||||
|
||||
vanding_varighed_hojbed_2:
|
||||
name: Varighed – Højbed 2 Kartofler
|
||||
min: 0
|
||||
max: 60
|
||||
step: 5
|
||||
unit_of_measurement: min
|
||||
initial: 15
|
||||
icon: mdi:timer
|
||||
|
||||
vanding_varighed_hojbed_3:
|
||||
name: Varighed – Højbed 3 Rabarber
|
||||
min: 0
|
||||
max: 60
|
||||
step: 5
|
||||
unit_of_measurement: min
|
||||
initial: 15
|
||||
icon: mdi:timer
|
||||
|
||||
vanding_varighed_smart:
|
||||
name: Varighed pr. cyklus – smart vanding
|
||||
min: 5
|
||||
max: 60
|
||||
step: 5
|
||||
unit_of_measurement: min
|
||||
initial: 15
|
||||
icon: mdi:timer-cog
|
||||
@@ -50,7 +50,7 @@ varme_komfort_forgang:
|
||||
max: 28
|
||||
step: 0.5
|
||||
unit_of_measurement: "°C"
|
||||
initial: 24
|
||||
initial: 23
|
||||
icon: mdi:thermometer
|
||||
|
||||
varme_komfort_lille_bad:
|
||||
@@ -59,7 +59,7 @@ varme_komfort_lille_bad:
|
||||
max: 28
|
||||
step: 0.5
|
||||
unit_of_measurement: "°C"
|
||||
initial: 24
|
||||
initial: 22.5
|
||||
icon: mdi:thermometer
|
||||
|
||||
varme_komfort_badevarelse:
|
||||
@@ -68,7 +68,7 @@ varme_komfort_badevarelse:
|
||||
max: 28
|
||||
step: 0.5
|
||||
unit_of_measurement: "°C"
|
||||
initial: 21.5
|
||||
initial: 25
|
||||
icon: mdi:thermometer
|
||||
|
||||
varme_komfort_stue:
|
||||
@@ -77,7 +77,7 @@ varme_komfort_stue:
|
||||
max: 28
|
||||
step: 0.5
|
||||
unit_of_measurement: "°C"
|
||||
initial: 25
|
||||
initial: 24
|
||||
icon: mdi:thermometer
|
||||
|
||||
# Globale sænkninger
|
||||
|
||||
@@ -7,7 +7,7 @@ vi_laver_mad:
|
||||
entity_id: person.andreas_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_andreas_iphone_12
|
||||
- service: notify.mobile_app_andreas_iphone_17pro
|
||||
data:
|
||||
message: >-
|
||||
{% set meal = states('sensor.dagens_aftensmad') %}
|
||||
@@ -22,7 +22,7 @@ vi_laver_mad:
|
||||
entity_id: person.daniel_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_daniels_iphone_13_mini
|
||||
- service: notify.mobile_app_daniels_iphone_17pro
|
||||
data:
|
||||
message: >-
|
||||
{% set meal = states('sensor.dagens_aftensmad') %}
|
||||
@@ -168,7 +168,7 @@ mad_announcement:
|
||||
entity_id: person.andreas_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_andreas_iphone_12
|
||||
- service: notify.mobile_app_andreas_iphone_17pro
|
||||
data:
|
||||
message: >-
|
||||
{% set meal = states('sensor.dagens_aftensmad') %}
|
||||
@@ -183,7 +183,7 @@ mad_announcement:
|
||||
entity_id: person.daniel_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_daniels_iphone_13_mini
|
||||
- service: notify.mobile_app_daniels_iphone_17pro
|
||||
data:
|
||||
message: >-
|
||||
{% set meal = states('sensor.dagens_aftensmad') %}
|
||||
@@ -291,7 +291,7 @@ tv_hygge_announcement:
|
||||
entity_id: person.andreas_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_andreas_iphone_12
|
||||
- service: notify.mobile_app_andreas_iphone_17pro
|
||||
data:
|
||||
message: Der er TV hygge
|
||||
- choose:
|
||||
@@ -300,7 +300,7 @@ tv_hygge_announcement:
|
||||
entity_id: person.daniel_schusler_dethlefsen
|
||||
state: home
|
||||
sequence:
|
||||
- service: notify.mobile_app_daniels_iphone_13_mini
|
||||
- service: notify.mobile_app_daniels_iphone_17pro
|
||||
data:
|
||||
message: Der er TV hygge
|
||||
- service: media_player.volume_set
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
# Manuel toggle per zone – starter med slider-varighed, stopper hvis allerede aktiv
|
||||
vanding_toggle_hojbed_1:
|
||||
alias: Toggle Højbed 1 – Ærter
|
||||
mode: single
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.hojbed_2
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.hojbed_2
|
||||
default:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.hojbed_2
|
||||
duration: "{{ states('input_number.vanding_varighed_hojbed_1') | int(15) }}"
|
||||
|
||||
vanding_toggle_hojbed_2:
|
||||
alias: Toggle Højbed 2 – Kartofler
|
||||
mode: single
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.hojbed_1
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.hojbed_1
|
||||
default:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.hojbed_1
|
||||
duration: "{{ states('input_number.vanding_varighed_hojbed_2') | int(15) }}"
|
||||
|
||||
vanding_toggle_hojbed_3:
|
||||
alias: Toggle Højbed 3 – Rabarber
|
||||
mode: single
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.drivhus_drypvanding
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.drivhus_drypvanding
|
||||
default:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.drivhus_drypvanding
|
||||
duration: "{{ states('input_number.vanding_varighed_hojbed_3') | int(15) }}"
|
||||
|
||||
vanding_hojbed_skiftevis:
|
||||
alias: Smart vanding – højbed 1, 2 og 3 efter fugtighed
|
||||
mode: single
|
||||
sequence:
|
||||
# Stop hvis regnsensor er aktiv eller regn-forsinkelse sat
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.annes_vanding_rainsensor
|
||||
state: "off"
|
||||
- condition: numeric_state
|
||||
entity_id: number.annes_vanding_rain_delay
|
||||
below: 1
|
||||
|
||||
# Gem startfugtighed og nulstil vandingstæller
|
||||
- variables:
|
||||
start_hb1: "{{ states('sensor.annes_havesensor_soil_moisture_1') | float(0) | round(1) }}"
|
||||
start_hb2: "{{ states('sensor.annes_havesensor_soil_moisture_2') | float(0) | round(1) }}"
|
||||
start_hb3: "{{ states('sensor.annes_havesensor_soil_moisture_3') | float(0) | round(1) }}"
|
||||
count_hb1: 0
|
||||
count_hb2: 0
|
||||
count_hb3: 0
|
||||
|
||||
# Ydre løkke: bliv ved mens mindst ét bed er tørt – maks 8 runder
|
||||
- repeat:
|
||||
while:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{
|
||||
states('sensor.annes_havesensor_soil_moisture_1') | float(100) < 40 or
|
||||
states('sensor.annes_havesensor_soil_moisture_2') | float(100) < 40 or
|
||||
states('sensor.annes_havesensor_soil_moisture_3') | float(100) < 40
|
||||
}}
|
||||
- condition: template
|
||||
value_template: "{{ repeat.index <= 8 }}"
|
||||
sequence:
|
||||
# HB1 – Ærter (switch.hojbed_2) – kun hvis tørt
|
||||
- if:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.annes_havesensor_soil_moisture_1
|
||||
below: 40
|
||||
then:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.hojbed_2
|
||||
duration: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- delay:
|
||||
minutes: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- variables:
|
||||
count_hb1: "{{ count_hb1 | int + 1 }}"
|
||||
|
||||
# HB2 – Kartofler (switch.hojbed_1) – kun hvis tørt
|
||||
- if:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.annes_havesensor_soil_moisture_2
|
||||
below: 40
|
||||
then:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.hojbed_1
|
||||
duration: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- delay:
|
||||
minutes: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- variables:
|
||||
count_hb2: "{{ count_hb2 | int + 1 }}"
|
||||
|
||||
# HB3 – Rabarber (switch.drivhus_drypvanding) – kun hvis tørt
|
||||
- if:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.annes_havesensor_soil_moisture_3
|
||||
below: 40
|
||||
then:
|
||||
- service: rainbird.start_irrigation
|
||||
data:
|
||||
entity_id: switch.drivhus_drypvanding
|
||||
duration: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- delay:
|
||||
minutes: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- variables:
|
||||
count_hb3: "{{ count_hb3 | int + 1 }}"
|
||||
|
||||
# Send notifikation med resultat
|
||||
- variables:
|
||||
slut_hb1: "{{ states('sensor.annes_havesensor_soil_moisture_1') | float(0) | round(1) }}"
|
||||
slut_hb2: "{{ states('sensor.annes_havesensor_soil_moisture_2') | float(0) | round(1) }}"
|
||||
slut_hb3: "{{ states('sensor.annes_havesensor_soil_moisture_3') | float(0) | round(1) }}"
|
||||
varighed: "{{ states('input_number.vanding_varighed_smart') | int(15) }}"
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "Vanding afsluttet 🌱"
|
||||
message: >
|
||||
HB1 Ærter: {{ start_hb1 }}% → {{ slut_hb1 }}% ({{ count_hb1 | int * varighed | int }} min)
|
||||
HB2 Kartofler: {{ start_hb2 }}% → {{ slut_hb2 }}% ({{ count_hb2 | int * varighed | int }} min)
|
||||
HB3 Rabarber: {{ start_hb3 }}% → {{ slut_hb3 }}% ({{ count_hb3 | int * varighed | int }} min)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
- platform: history_stats
|
||||
name: vanding_hojbed_1_i_dag
|
||||
entity_id: switch.hojbed_2
|
||||
state: "on"
|
||||
type: time
|
||||
start: "{{ today_at() }}"
|
||||
end: "{{ now() }}"
|
||||
|
||||
- platform: history_stats
|
||||
name: vanding_hojbed_2_i_dag
|
||||
entity_id: switch.hojbed_1
|
||||
state: "on"
|
||||
type: time
|
||||
start: "{{ today_at() }}"
|
||||
end: "{{ now() }}"
|
||||
|
||||
- platform: history_stats
|
||||
name: vanding_hojbed_3_i_dag
|
||||
entity_id: switch.drivhus_drypvanding
|
||||
state: "on"
|
||||
type: time
|
||||
start: "{{ today_at() }}"
|
||||
end: "{{ now() }}"
|
||||
|
||||
- platform: history_stats
|
||||
name: vanding_drivhus_i_dag
|
||||
entity_id: switch.hojbed_3
|
||||
state: "on"
|
||||
type: time
|
||||
start: "{{ today_at() }}"
|
||||
end: "{{ now() }}"
|
||||
Reference in New Issue
Block a user