summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/multi
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-01-08 10:16:21 +0100
committermakefu <github@syntax-fehler.de>2020-01-08 10:16:21 +0100
commit5d2e66eb2c0cb5c4c6a5592e53d1baad21721430 (patch)
tree9c68690cb233350864b7786b8c5a442cade54df8 /krebs/2configs/shack/glados/multi
parent4ad85faacedc755fd25b7edd0df41234c98876f0 (diff)
shack/glados: enable schlechte_luft
Diffstat (limited to 'krebs/2configs/shack/glados/multi')
-rw-r--r--krebs/2configs/shack/glados/multi/schlechte_luft.nix87
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix2
2 files changed, 77 insertions, 12 deletions
diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix
index 94cb768b..95ea60c0 100644
--- a/krebs/2configs/shack/glados/multi/schlechte_luft.nix
+++ b/krebs/2configs/shack/glados/multi/schlechte_luft.nix
@@ -1,19 +1,84 @@
let
- airlevel = name: threshold: color:
- { alias = "${name} Air trigger ${color}";
- trigger = [
- ];
- action =
- [
- # create spark effect with color
- ];
- };
+ glados = import ../lib;
in
{
# LED
- switch = [
+ light = [
+ (glados.esphome.led { name = "Fablab LED"; host = "fablab_led"; topic = "led_ring"; })
+
+ (glados.esphome.led { name = "Fablab LED Part A"; host = "fablab_led"; topic = "A";})
+ (glados.esphome.led { name = "Fablab LED Part B"; host = "fablab_led"; topic = "B";})
+ (glados.esphome.led { name = "Fablab LED Part C"; host = "fablab_led"; topic = "C";})
+ (glados.esphome.led { name = "Fablab LED Part D"; host = "fablab_led"; topic = "D";})
+ ];
+ sensor = [
+ (glados.esphome.dust_25m { host = "fablab_feinstaub";})
+ (glados.esphome.dust_100m { host = "fablab_feinstaub";})
];
automation =
- [
+ [
+ { alias = "Gute Luft Fablab";
+ trigger = [
+ {
+ platform = "numeric_state";
+ below = 25;
+ entity_id = "sensor.fablab_feinstaub_25m";
+ }
+ ];
+ action =
+ [
+ { service = "light.turn_on";
+ data = {
+ entity = "fablab_led";
+ effect = "Twinkle";
+ color_name = "green";
+ };
+ }
+ ];
+ }
+ { alias = "mäßige Luft Fablab";
+ trigger = [
+ #{
+ # platform = "numeric_state";
+ # above = 25;
+ # entity_id = "sensor.fablab_feinstaub_25m";
+ #}
+ {
+ platform = "numeric_state";
+ above = 25;
+ below = 50;
+ entity_id = "sensor.fablab_feinstaub_25m";
+ }
+ ];
+ action =
+ [
+ { service = "light.turn_on";
+ data = {
+ entity = "fablab_led";
+ effect = "Twinkle";
+ color_name = "yellow";
+ };
+ }
+ ];
+ }
+ { alias = "schlechte Luft Fablab";
+ trigger = [
+ {
+ platform = "numeric_state";
+ above = 50;
+ entity_id = "sensor.fablab_feinstaub_25m";
+ }
+ ];
+ action =
+ [
+ { service = "light.turn_on";
+ data = {
+ entity = "fablab_led";
+ effect = "Twinkle";
+ color_name = "red";
+ };
+ }
+ ];
+ }
];
}
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix
index e3e7eb2a..e909cce7 100644
--- a/krebs/2configs/shack/glados/multi/wasser.nix
+++ b/krebs/2configs/shack/glados/multi/wasser.nix
@@ -4,7 +4,7 @@ let
in
{
switch = [
- (glados.tasmota.plug "Wasser" "plug")
+ (glados.tasmota.plug { name = "Wasser"; topic = "plug";} )
];
automation =