Vanding: rainbird.start_irrigation, duration sliders, toggle scripts, smart vanding med alternering og notifikation
This commit is contained in:
@@ -33,19 +33,275 @@ cards:
|
||||
name: I morgen
|
||||
icon: mdi:briefcase-outline
|
||||
|
||||
# 👨👩👧👦 Familien
|
||||
- type: glance
|
||||
entities:
|
||||
- entity: person.daniel_schusler_dethlefsen
|
||||
# 👨👩👧👦 Familien – tryk for at toggle syg/rask
|
||||
- type: grid
|
||||
columns: 4
|
||||
square: false
|
||||
cards:
|
||||
|
||||
- type: custom:button-card
|
||||
entity: person.daniel_schusler_dethlefsen
|
||||
name: Daniel
|
||||
- entity: person.claus_dethlefsen
|
||||
show_name: true
|
||||
show_state: false
|
||||
show_label: true
|
||||
show_icon: false
|
||||
show_entity_picture: true
|
||||
label: >
|
||||
[[[
|
||||
const s = entity.state;
|
||||
const sick = states['input_select.daniel_status'] &&
|
||||
states['input_select.daniel_status'].state === 'syg';
|
||||
const loc = s === 'home' ? 'Hjemme' : s === 'not_home' ? 'Ude' : s;
|
||||
return sick ? loc + ' · Syg' : loc;
|
||||
]]]
|
||||
styles:
|
||||
card:
|
||||
- padding: 8px 4px
|
||||
- border: >
|
||||
[[[
|
||||
return states['input_select.daniel_status'] &&
|
||||
states['input_select.daniel_status'].state === 'syg'
|
||||
? '2px solid rgba(220,50,50,0.8)' : '2px solid transparent';
|
||||
]]]
|
||||
- border-radius: 12px
|
||||
entity_picture:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- border-radius: 50%
|
||||
- object-fit: cover
|
||||
- filter: >
|
||||
[[[
|
||||
return states['input_select.daniel_status'] &&
|
||||
states['input_select.daniel_status'].state === 'syg'
|
||||
? 'grayscale(100%)' : 'none';
|
||||
]]]
|
||||
name:
|
||||
- font-size: 12px
|
||||
- font-weight: 600
|
||||
- padding-top: 6px
|
||||
- color: >
|
||||
[[[
|
||||
return states['input_select.daniel_status'] &&
|
||||
states['input_select.daniel_status'].state === 'syg'
|
||||
? 'rgb(220,50,50)' : 'var(--primary-text-color)';
|
||||
]]]
|
||||
label:
|
||||
- font-size: 10px
|
||||
- color: var(--secondary-text-color)
|
||||
- padding-bottom: 2px
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: input_select.select_option
|
||||
service_data:
|
||||
entity_id: input_select.daniel_status
|
||||
option: >
|
||||
[[[
|
||||
return states['input_select.daniel_status'] &&
|
||||
states['input_select.daniel_status'].state === 'syg'
|
||||
? 'hjemme' : 'syg';
|
||||
]]]
|
||||
hold_action:
|
||||
action: more-info
|
||||
entity: person.daniel_schusler_dethlefsen
|
||||
|
||||
- type: custom:button-card
|
||||
entity: person.claus_dethlefsen
|
||||
name: Claus
|
||||
- entity: person.anne_schusler_dethlefsen
|
||||
show_name: true
|
||||
show_state: false
|
||||
show_label: true
|
||||
show_icon: false
|
||||
show_entity_picture: true
|
||||
label: >
|
||||
[[[
|
||||
const s = entity.state;
|
||||
const sick = states['input_select.claus_status'] &&
|
||||
states['input_select.claus_status'].state === 'syg';
|
||||
const loc = s === 'home' ? 'Hjemme' : s === 'not_home' ? 'Ude' : s;
|
||||
return sick ? loc + ' · Syg' : loc;
|
||||
]]]
|
||||
styles:
|
||||
card:
|
||||
- padding: 8px 4px
|
||||
- border: >
|
||||
[[[
|
||||
return states['input_select.claus_status'] &&
|
||||
states['input_select.claus_status'].state === 'syg'
|
||||
? '2px solid rgba(220,50,50,0.8)' : '2px solid transparent';
|
||||
]]]
|
||||
- border-radius: 12px
|
||||
entity_picture:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- border-radius: 50%
|
||||
- object-fit: cover
|
||||
- filter: >
|
||||
[[[
|
||||
return states['input_select.claus_status'] &&
|
||||
states['input_select.claus_status'].state === 'syg'
|
||||
? 'grayscale(100%)' : 'none';
|
||||
]]]
|
||||
name:
|
||||
- font-size: 12px
|
||||
- font-weight: 600
|
||||
- padding-top: 6px
|
||||
- color: >
|
||||
[[[
|
||||
return states['input_select.claus_status'] &&
|
||||
states['input_select.claus_status'].state === 'syg'
|
||||
? 'rgb(220,50,50)' : 'var(--primary-text-color)';
|
||||
]]]
|
||||
label:
|
||||
- font-size: 10px
|
||||
- color: var(--secondary-text-color)
|
||||
- padding-bottom: 2px
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: input_select.select_option
|
||||
service_data:
|
||||
entity_id: input_select.claus_status
|
||||
option: >
|
||||
[[[
|
||||
return states['input_select.claus_status'] &&
|
||||
states['input_select.claus_status'].state === 'syg'
|
||||
? 'hjemme' : 'syg';
|
||||
]]]
|
||||
hold_action:
|
||||
action: more-info
|
||||
entity: person.claus_dethlefsen
|
||||
|
||||
- type: custom:button-card
|
||||
entity: person.anne_schusler_dethlefsen
|
||||
name: Anne
|
||||
- entity: person.andreas_schusler_dethlefsen
|
||||
show_name: true
|
||||
show_state: false
|
||||
show_label: true
|
||||
show_icon: false
|
||||
show_entity_picture: true
|
||||
label: >
|
||||
[[[
|
||||
const s = entity.state;
|
||||
const sick = states['input_select.anne_status'] &&
|
||||
states['input_select.anne_status'].state === 'syg';
|
||||
const loc = s === 'home' ? 'Hjemme' : s === 'not_home' ? 'Ude' : s;
|
||||
return sick ? loc + ' · Syg' : loc;
|
||||
]]]
|
||||
styles:
|
||||
card:
|
||||
- padding: 8px 4px
|
||||
- border: >
|
||||
[[[
|
||||
return states['input_select.anne_status'] &&
|
||||
states['input_select.anne_status'].state === 'syg'
|
||||
? '2px solid rgba(220,50,50,0.8)' : '2px solid transparent';
|
||||
]]]
|
||||
- border-radius: 12px
|
||||
entity_picture:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- border-radius: 50%
|
||||
- object-fit: cover
|
||||
- filter: >
|
||||
[[[
|
||||
return states['input_select.anne_status'] &&
|
||||
states['input_select.anne_status'].state === 'syg'
|
||||
? 'grayscale(100%)' : 'none';
|
||||
]]]
|
||||
name:
|
||||
- font-size: 12px
|
||||
- font-weight: 600
|
||||
- padding-top: 6px
|
||||
- color: >
|
||||
[[[
|
||||
return states['input_select.anne_status'] &&
|
||||
states['input_select.anne_status'].state === 'syg'
|
||||
? 'rgb(220,50,50)' : 'var(--primary-text-color)';
|
||||
]]]
|
||||
label:
|
||||
- font-size: 10px
|
||||
- color: var(--secondary-text-color)
|
||||
- padding-bottom: 2px
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: input_select.select_option
|
||||
service_data:
|
||||
entity_id: input_select.anne_status
|
||||
option: >
|
||||
[[[
|
||||
return states['input_select.anne_status'] &&
|
||||
states['input_select.anne_status'].state === 'syg'
|
||||
? 'hjemme' : 'syg';
|
||||
]]]
|
||||
hold_action:
|
||||
action: more-info
|
||||
entity: person.anne_schusler_dethlefsen
|
||||
|
||||
- type: custom:button-card
|
||||
entity: person.andreas_schusler_dethlefsen
|
||||
name: Andreas
|
||||
- entity: binary_sensor.family_presence
|
||||
name: Familie
|
||||
show_name: true
|
||||
show_state: false
|
||||
show_label: true
|
||||
show_icon: false
|
||||
show_entity_picture: true
|
||||
label: >
|
||||
[[[
|
||||
const s = entity.state;
|
||||
const sick = states['input_select.andreas_status'] &&
|
||||
states['input_select.andreas_status'].state === 'syg';
|
||||
const loc = s === 'home' ? 'Hjemme' : s === 'not_home' ? 'Ude' : s;
|
||||
return sick ? loc + ' · Syg' : loc;
|
||||
]]]
|
||||
styles:
|
||||
card:
|
||||
- padding: 8px 4px
|
||||
- border: >
|
||||
[[[
|
||||
return states['input_select.andreas_status'] &&
|
||||
states['input_select.andreas_status'].state === 'syg'
|
||||
? '2px solid rgba(220,50,50,0.8)' : '2px solid transparent';
|
||||
]]]
|
||||
- border-radius: 12px
|
||||
entity_picture:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- border-radius: 50%
|
||||
- object-fit: cover
|
||||
- filter: >
|
||||
[[[
|
||||
return states['input_select.andreas_status'] &&
|
||||
states['input_select.andreas_status'].state === 'syg'
|
||||
? 'grayscale(100%)' : 'none';
|
||||
]]]
|
||||
name:
|
||||
- font-size: 12px
|
||||
- font-weight: 600
|
||||
- padding-top: 6px
|
||||
- color: >
|
||||
[[[
|
||||
return states['input_select.andreas_status'] &&
|
||||
states['input_select.andreas_status'].state === 'syg'
|
||||
? 'rgb(220,50,50)' : 'var(--primary-text-color)';
|
||||
]]]
|
||||
label:
|
||||
- font-size: 10px
|
||||
- color: var(--secondary-text-color)
|
||||
- padding-bottom: 2px
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: input_select.select_option
|
||||
service_data:
|
||||
entity_id: input_select.andreas_status
|
||||
option: >
|
||||
[[[
|
||||
return states['input_select.andreas_status'] &&
|
||||
states['input_select.andreas_status'].state === 'syg'
|
||||
? 'hjemme' : 'syg';
|
||||
]]]
|
||||
hold_action:
|
||||
action: more-info
|
||||
entity: person.andreas_schusler_dethlefsen
|
||||
|
||||
# 🪟 Gardiner
|
||||
- type: grid
|
||||
|
||||
@@ -161,30 +161,96 @@ sections:
|
||||
entity: calendar.annes_vanding
|
||||
name: Vandingsplan
|
||||
|
||||
# 📊 Vandingshistorik
|
||||
- type: grid
|
||||
cards:
|
||||
- type: heading
|
||||
heading: Vandingstid i dag (minutter)
|
||||
icon: mdi:chart-bar
|
||||
|
||||
- type: entities
|
||||
title: Vandingstid i dag
|
||||
entities:
|
||||
- entity: sensor.vanding_hojbed_1_i_dag
|
||||
name: HB1 Ærter
|
||||
- entity: sensor.vanding_hojbed_2_i_dag
|
||||
name: HB2 Kartofler
|
||||
- entity: sensor.vanding_hojbed_3_i_dag
|
||||
name: HB3 Rabarber
|
||||
- entity: sensor.vanding_drivhus_i_dag
|
||||
name: Drivhus
|
||||
|
||||
# ▶️ Manuel start/stop
|
||||
- type: grid
|
||||
cards:
|
||||
- type: heading
|
||||
heading: Smart vanding – manuel styring
|
||||
icon: mdi:water-pump
|
||||
|
||||
- type: tile
|
||||
entity: script.vanding_hojbed_skiftevis
|
||||
name: Start smart vanding
|
||||
icon: mdi:sprinkler-variant
|
||||
tap_action:
|
||||
action: toggle
|
||||
|
||||
- type: entities
|
||||
title: Varighed pr. cyklus (smart)
|
||||
entities:
|
||||
- entity: input_number.vanding_varighed_smart
|
||||
name: Minutter pr. cyklus
|
||||
|
||||
# 🌿 Zonekontrol
|
||||
- type: grid
|
||||
cards:
|
||||
- type: heading
|
||||
heading: Zoner – manuel styring
|
||||
heading: Zoner – manuel styring med varighed
|
||||
icon: mdi:water-pump
|
||||
|
||||
- type: tile
|
||||
entity: switch.hojbed_1
|
||||
name: Højbed 1 – Ærter
|
||||
icon: mdi:sprinkler
|
||||
|
||||
- type: vertical-stack
|
||||
cards:
|
||||
- type: entities
|
||||
entities:
|
||||
- entity: input_number.vanding_varighed_hojbed_1
|
||||
name: Varighed HB1 – Ærter
|
||||
- type: tile
|
||||
entity: switch.hojbed_2
|
||||
name: Højbed 1 – Ærter
|
||||
icon: mdi:sprinkler
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: script.vanding_toggle_hojbed_1
|
||||
|
||||
- type: vertical-stack
|
||||
cards:
|
||||
- type: entities
|
||||
entities:
|
||||
- entity: input_number.vanding_varighed_hojbed_2
|
||||
name: Varighed HB2 – Kartofler
|
||||
- type: tile
|
||||
entity: switch.hojbed_1
|
||||
name: Højbed 2 – Kartofler
|
||||
icon: mdi:sprinkler
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: script.vanding_toggle_hojbed_2
|
||||
|
||||
- type: vertical-stack
|
||||
cards:
|
||||
- type: entities
|
||||
entities:
|
||||
- entity: input_number.vanding_varighed_hojbed_3
|
||||
name: Varighed HB3 – Rabarber
|
||||
- type: tile
|
||||
entity: switch.drivhus_drypvanding
|
||||
name: Højbed 3 – Rabarber
|
||||
icon: mdi:sprinkler
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: script.vanding_toggle_hojbed_3
|
||||
|
||||
- type: tile
|
||||
entity: switch.hojbed_3
|
||||
name: Højbed 3 – Rabarber
|
||||
icon: mdi:sprinkler
|
||||
|
||||
- type: tile
|
||||
entity: switch.drivhus_drypvanding
|
||||
name: Drivhus
|
||||
icon: mdi:greenhouse
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ sections:
|
||||
entities:
|
||||
- entity: device_tracker.andreas_iphone_12
|
||||
name: Andreas
|
||||
- entity: device_tracker.daniels_iphone_7_3
|
||||
- entity: device_tracker.daniels_iphone_17pro
|
||||
name: Daniel
|
||||
- entity: device_tracker.annes_iphone_xs_4
|
||||
name: Anne
|
||||
|
||||
@@ -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() }}"
|
||||
@@ -0,0 +1,3 @@
|
||||
400: Bad Request
|
||||
[]
|
||||
EXIT: 0
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"count": 7, "items": [{"date": "2026-05-23", "recipe": {"name": "Ingen hjemme", "slug": ""}}, {"date": "2026-05-24", "recipe": {"name": "Kylling i cremet sennepssauce", "slug": "kylling-i-cremet-sennepssauce"}}, {"date": "2026-05-22", "recipe": {"name": "M\u00f8rbradb\u00f8ffer med bl\u00f8de l\u00f8g og fl\u00f8desauce", "slug": "morbradboffer-med-blode-log-og-flodesauce"}}, {"date": "2026-05-21", "recipe": {"name": "Frikadeller", "slug": "frikadeller"}}, {"date": "2026-05-20", "recipe": {"name": "Rester fra mandag (Lasagne)", "slug": ""}}, {"date": "2026-05-19", "recipe": {"name": "Rester fra s\u00f8ndag (Flyvende Jacob)", "slug": ""}}, {"date": "2026-05-18", "recipe": {"name": "Lasagne", "slug": "lasagne"}}]}
|
||||
{"count": 7, "items": [{"date": "2026-05-29", "recipe": {"name": "Laks med sesam og citron", "slug": "laks-med-sesam-og-citron"}}, {"date": "2026-05-30", "recipe": {"name": "Hjemmelavet laksesushi", "slug": "hjemmelavet-laksesushi"}}, {"date": "2026-05-28", "recipe": {"name": "One Pot Pasta med chorizo", "slug": "one-pot-pasta-med-chorizo"}}, {"date": "2026-05-27", "recipe": {"name": "Rester fra mandag (Bolognese)", "slug": ""}}, {"date": "2026-05-26", "recipe": {"name": "Rester fra s\u00f8ndag (Kylling i sennepssauce)", "slug": ""}}, {"date": "2026-05-25", "recipe": {"name": "Spaghetti Bolognese - pasta med k\u00f8dsovs", "slug": "spaghetti-bolognese-pasta-med-kodsovs"}}, {"date": "2026-05-24", "recipe": {"name": "Kylling i cremet sennepssauce", "slug": "kylling-i-cremet-sennepssauce"}}]}
|
||||
Reference in New Issue
Block a user