From 4ad85faacedc755fd25b7edd0df41234c98876f0 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 7 Jan 2020 16:52:31 +0100 Subject: shack/glados: init hass config --- krebs/2configs/shack/glados/multi/schlechte_luft.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 krebs/2configs/shack/glados/multi/schlechte_luft.nix (limited to 'krebs/2configs/shack/glados/multi/schlechte_luft.nix') diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix new file mode 100644 index 00000000..94cb768b --- /dev/null +++ b/krebs/2configs/shack/glados/multi/schlechte_luft.nix @@ -0,0 +1,19 @@ +let + airlevel = name: threshold: color: + { alias = "${name} Air trigger ${color}"; + trigger = [ + ]; + action = + [ + # create spark effect with color + ]; + }; +in +{ + # LED + switch = [ + ]; + automation = + [ + ]; +} -- cgit v1.2.3 From 5d2e66eb2c0cb5c4c6a5592e53d1baad21721430 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Jan 2020 10:16:21 +0100 Subject: shack/glados: enable schlechte_luft --- .../2configs/shack/glados/multi/schlechte_luft.nix | 87 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 11 deletions(-) (limited to 'krebs/2configs/shack/glados/multi/schlechte_luft.nix') 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"; + }; + } + ]; + } ]; } -- cgit v1.2.3 From c5d90459230c806771b0265788494a3fa52108c9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Jan 2020 18:42:09 +0100 Subject: filebitch.r: init;shack/glados: fix schlechte_luft automation, add hass-restart --- krebs/2configs/shack/glados/multi/schlechte_luft.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'krebs/2configs/shack/glados/multi/schlechte_luft.nix') diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index 95ea60c0..a72d32d9 100644 --- a/krebs/2configs/shack/glados/multi/schlechte_luft.nix +++ b/krebs/2configs/shack/glados/multi/schlechte_luft.nix @@ -29,7 +29,7 @@ in [ { service = "light.turn_on"; data = { - entity = "fablab_led"; + entity_id = "light.fablab_led"; effect = "Twinkle"; color_name = "green"; }; @@ -54,7 +54,7 @@ in [ { service = "light.turn_on"; data = { - entity = "fablab_led"; + entity_id = "light.fablab_led"; effect = "Twinkle"; color_name = "yellow"; }; @@ -73,7 +73,7 @@ in [ { service = "light.turn_on"; data = { - entity = "fablab_led"; + entity_id = "light.fablab_led"; effect = "Twinkle"; color_name = "red"; }; -- cgit v1.2.3 From dddc3e4f6ffd4aff8aed1c18c0fa7053cb3a1185 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 9 Jan 2020 22:42:39 +0100 Subject: shack/glados/schlechte_luft: add fallbacks, fix sensor naming --- .../2configs/shack/glados/multi/schlechte_luft.nix | 45 ++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'krebs/2configs/shack/glados/multi/schlechte_luft.nix') diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index a72d32d9..9cd2c56f 100644 --- a/krebs/2configs/shack/glados/multi/schlechte_luft.nix +++ b/krebs/2configs/shack/glados/multi/schlechte_luft.nix @@ -12,6 +12,7 @@ in (glados.esphome.led { name = "Fablab LED Part D"; host = "fablab_led"; topic = "D";}) ]; sensor = [ + (glados.esphome.temp { host = "fablab_feinstaub";}) (glados.esphome.dust_25m { host = "fablab_feinstaub";}) (glados.esphome.dust_100m { host = "fablab_feinstaub";}) ]; @@ -22,7 +23,7 @@ in { platform = "numeric_state"; below = 25; - entity_id = "sensor.fablab_feinstaub_25m"; + entity_id = "sensor.fablab_feinstaub_2_5um"; } ]; action = @@ -47,7 +48,7 @@ in platform = "numeric_state"; above = 25; below = 50; - entity_id = "sensor.fablab_feinstaub_25m"; + entity_id = "sensor.fablab_feinstaub_2_5um"; } ]; action = @@ -66,7 +67,7 @@ in { platform = "numeric_state"; above = 50; - entity_id = "sensor.fablab_feinstaub_25m"; + entity_id = "sensor.fablab_feinstaub_2_5um"; } ]; action = @@ -80,5 +81,43 @@ in } ]; } + { alias = "Luft Sensor nicht verfügbar"; + trigger = [ + { + platform = "state"; + to = "unavailable"; + entity_id = "sensor.fablab_feinstaub_2_5um"; + } + ]; + action = + [ + { service = "light.turn_on"; + data = { + entity_id = "light.fablab_led"; + effect = "Rainbow"; + color_name = "blue"; + }; + } + ]; + } + { alias = "Fablab Licht Reboot"; + trigger = [ + { + platform = "state"; + from = "unavailable"; + entity_id = "light.fablab_led"; + } + ]; + action = + [ + { service = "light.turn_on"; + data = { + entity_id = "light.fablab_led"; + effect = "Rainbow"; + color_name = "orange"; + }; + } + ]; + } ]; } -- cgit v1.2.3