summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/multi/wasser.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-04-11 22:33:28 +0200
committermakefu <github@syntax-fehler.de>2023-04-11 22:49:26 +0200
commit6e44c39fe0946d29436766c49ee73de6c69191c8 (patch)
tree657e209c66b93c8bbe2e9c3c3d7c8d77ad13b36f /krebs/2configs/shack/glados/multi/wasser.nix
parent7239ec83c5531fa100d1863fec9d82033d13ad34 (diff)
k shack/glados: now a docker deployment
Diffstat (limited to 'krebs/2configs/shack/glados/multi/wasser.nix')
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix113
1 files changed, 0 insertions, 113 deletions
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix
deleted file mode 100644
index 9ca5e4500..000000000
--- a/krebs/2configs/shack/glados/multi/wasser.nix
+++ /dev/null
@@ -1,113 +0,0 @@
-# uses:
-# switch.crafting_giesskanne_relay
-let
- glados = import ../lib;
- seconds = 20;
- wasser = "switch.crafting_giesskanne_relay";
- brotbox = {
- minutes = 10;
- pump = "switch.crafting_brotbox_pumpe";
- sensor = "sensor.statistics_for_sensor_crafting_brotbox_soil_moisture";
- };
-in
-{
- services.home-assistant.config =
- {
- sensor = map ( entity_id: {
- platform = "statistics";
- name = "Statistics for ${entity_id}";
- inherit entity_id;
- max_age.minutes = "60";
- sampling_size = 1000;
- }) ["sensor.crafting_brotbox_soil_moisture"];
-
-
- automation =
- [
- ### Brotbox #####
- #{ alias = "Brotbox: water for ${toString brotbox.minutes} minutes every hour";
- # trigger =
- # { # Trigger once every hour at :42
- # platform = "time_pattern";
- # minutes = 42;
- # };
- # condition = {
- # condition = "numeric_state";
- # entity_id = brotbox.sensor;
- # value_template = "{{ state_attr('${brotbox.sensor}', 'median') }}";
- # below = 75;
- # };
- # action =
- # [
- # {
- # service = "homeassistant.turn_on";
- # entity_id = brotbox.pump;
- # }
- # { delay.minutes = brotbox.minutes; }
- # {
- # service = "homeassistant.turn_off";
- # entity_id = brotbox.pump ;
- # }
- # ];
- #}
- { alias = "Brotbox: Always turn off water after ${toString (brotbox.minutes * 2)} minutes";
- trigger =
- {
- platform = "state";
- entity_id = brotbox.pump;
- to = "on";
- for.minutes = brotbox.minutes*2;
- };
- action =
- {
- service = "homeassistant.turn_off";
- entity_id = brotbox.pump;
- };
- }
-
- ##### Kaffeemaschine
- { alias = "Water the plant for ${toString seconds} seconds";
- trigger = [
- { # trigger at 20:00 no matter what
- # TODO: retry or run only if switch.wasser is available
- platform = "time";
- at = "20:00:00";
- }
- ];
- action =
- [
- {
- service = "homeassistant.turn_on";
- entity_id = [
- wasser
- ];
- }
- { delay.seconds = seconds; }
- {
- service = "homeassistant.turn_off";
- entity_id = [
- wasser
- ];
- }
- ];
- }
- { alias = "Always turn off water after ${toString (seconds * 2)}seconds";
- trigger = [
- {
- platform = "state";
- entity_id = wasser;
- to = "on";
- for.seconds = seconds*2;
- }
- ];
- action =
- [
- {
- service = "homeassistant.turn_off";
- entity_id = [ wasser ];
- }
- ];
- }
- ];
- };
-}