From 1c6fafdaa0f43af0384d460ca8b47d15a30bec41 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 27 Nov 2019 09:52:53 +0100 Subject: krebs exim-smarthost: RIP slash16 --- krebs/2configs/exim-smarthost.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/exim-smarthost.nix b/krebs/2configs/exim-smarthost.nix index 698e20da1..224a38ac3 100644 --- a/krebs/2configs/exim-smarthost.nix +++ b/krebs/2configs/exim-smarthost.nix @@ -15,13 +15,12 @@ in { makefu tv ]; - eloop-ml = spam-ml ++ [ ciko ]; + eloop-ml = spam-ml; spam-ml = [ lass makefu tv ]; - ciko.mail = "ciko@slash16.net"; in { "anmeldung@eloop.org" = eloop-ml; "brain@krebsco.de" = brain-ml; -- cgit v1.2.3 From 1270ea945a0c78b753e73a6a2249bb15b15128bc Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 17 Dec 2019 20:53:53 +0100 Subject: shack: update muellshack --- krebs/2configs/shack/muellshack.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/muellshack.nix b/krebs/2configs/shack/muellshack.nix index c1c957da3..c67d8f523 100644 --- a/krebs/2configs/shack/muellshack.nix +++ b/krebs/2configs/shack/muellshack.nix @@ -4,8 +4,8 @@ let pkg = pkgs.callPackage ( pkgs.fetchgit { url = "https://git.shackspace.de/rz/muellshack"; - rev = "4601f59787de090c83be6dbae6ca72d7fc84ab9f"; - sha256 = "1cshbd6ipvynbm3gmnsm58ccc1m5xc87cpd3b6jx0s6pr2j19g9j"; + rev = "c3d1f70325e5b90f280c5be60110e14f4de653ae"; + sha256 = "1dd4kqwdr4v413rmkvmyjzzvw8id9747nifp96pg0c2cy6bhzj24"; }) { mkYarnPackage = pkgs.yarn2nix-moretea.mkYarnPackage; }; home = "/var/lib/muellshack"; port = "8081"; -- cgit v1.2.3 From 479ce8c4c5747d6da60d2d907d662e7a5708bfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20=28xq=29=20Quei=C3=9Fner?= Date: Fri, 3 Jan 2020 00:15:01 +0100 Subject: shack: init shackDNS --- krebs/2configs/shack/shackDNS.nix | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 krebs/2configs/shack/shackDNS.nix (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/shackDNS.nix b/krebs/2configs/shack/shackDNS.nix new file mode 100644 index 000000000..807bb7e65 --- /dev/null +++ b/krebs/2configs/shack/shackDNS.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, ... }: + +let + pkg = + pkgs.fetchgit { + url = "https://git.shackspace.de/rz/shackdns"; + rev = "e55cc906c734b398683f9607b93f1ad6435d8575"; + sha256 = "1hkwhf3hqb4fz06b1ckh7sl0zcyi4da5fgdlksian8lxyd19n8sq"; + }; + home = "/var/lib/shackDNS"; + port = "8083"; + config_file = pkgs.writeText "config" '' + # Points to a bind configuration file + dns-db = ${home}/db.shack + + # Points to a shackles configuration file + # See `shackles.json` in repo + shackles-db = ${home}/shackles.json + + # Points to a REST service with the DHCP leases + leases-api = http://dhcp.shack/dhcpd.leases + + # Wrap this binding with https proxy or similar + binding = http://localhost:${port}/ + ''; +in { + # receive response from light.shack / standby.shack + networking.firewall.allowedTCPPorts = [ ]; + + users.users.shackDNS = { + inherit home; + createHome = true; + }; + services.nginx.virtualHosts."leases.shack" = { + locations."/" = { + proxyPass = "http://localhost:${port}/"; + }; + }; + services.nginx.virtualHosts."shackdns.shack" = { + locations."/" = { + proxyPass = "http://localhost:${port}/"; + }; + }; + services.nginx.virtualHosts."shackles.shack" = { + locations."/" = { + proxyPass = "http://localhost:${port}/"; + }; + }; + + systemd.services.shackDNS = { + description = "shackDNS provides an overview over DHCP and DNS as well as a replacement for shackles"; + wantedBy = [ "multi-user.target" ]; + environment.PORT = port; + serviceConfig = { + User = "shackDNS"; + WorkingDirectory = home; + ExecStart = "${pkgs.mono6}/bin/mono ${pkg}/shackDNS.exe ${config_file}"; + PrivateTmp = true; + Restart = "always"; + RestartSec = "15"; + }; + }; +} -- cgit v1.2.3 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/default.nix | 1 + krebs/2configs/shack/glados/lib/default.nix | 46 ++++++++++++++++++++++ .../2configs/shack/glados/multi/schlechte_luft.nix | 19 +++++++++ krebs/2configs/shack/glados/multi/wasser.nix | 17 ++------ krebs/2configs/shack/glados/sensors/hass.nix | 23 ++--------- 5 files changed, 72 insertions(+), 34 deletions(-) create mode 100644 krebs/2configs/shack/glados/lib/default.nix create mode 100644 krebs/2configs/shack/glados/multi/schlechte_luft.nix (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index d000af397..2c9a01af3 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -2,6 +2,7 @@ let shackopen = import ./multi/shackopen.nix; wasser = import ./multi/wasser.nix; + badair = import ./multi/schlechte_luft.nix; in { services.nginx.virtualHosts."hass.shack" = { serverAliases = [ "glados.shack" ]; diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix new file mode 100644 index 000000000..debe8e5c2 --- /dev/null +++ b/krebs/2configs/shack/glados/lib/default.nix @@ -0,0 +1,46 @@ +let + lib = import ; + prefix = "glados"; +in +{ + esphome = + { + temp = name: + { + platform = "mqtt"; + name = "${name} Temperature"; + device_class = "temperature"; + state_topic = "${prefix}/${name}/sensor/temperature/state"; + availability_topic = "${prefix}/${name}/status"; + payload_available = "online"; + payload_not_available = "offline"; + }; + hum = name: + { + platform = "mqtt"; + device_class = "humidity"; + name = "${name} Humidity"; + state_topic = "${prefix}/${name}/sensor/humidity/state"; + availability_topic = "${prefix}/${name}/status"; + payload_available = "online"; + payload_not_available = "offline"; + }; + }; + tasmota = + { + plug = name: topic: + { + platform = "mqtt"; + inherit name; + state_topic = "sonoff/stat/${topic}/POWER1"; + command_topic = "sonoff/cmnd/${topic}/POWER1"; + availability_topic = "sonoff/tele/${topic}/LWT"; + payload_on= "ON"; + payload_off= "OFF"; + payload_available= "Online"; + payload_not_available= "Offline"; + retain = false; + qos = 1; + }; + }; +} 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 000000000..94cb768b9 --- /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 = + [ + ]; +} diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix index 578bb0750..e3e7eb2a0 100644 --- a/krebs/2configs/shack/glados/multi/wasser.nix +++ b/krebs/2configs/shack/glados/multi/wasser.nix @@ -1,23 +1,12 @@ let - tasmota_plug = name: topic: - { platform = "mqtt"; - inherit name; - state_topic = "sonoff/stat/${topic}/POWER1"; - command_topic = "sonoff/cmnd/${topic}/POWER1"; - availability_topic = "sonoff/tele/${topic}/LWT"; - payload_on= "ON"; - payload_off= "OFF"; - payload_available= "Online"; - payload_not_available= "Offline"; - retain = false; - qos = 1; - }; + glados = import ../lib; seconds = 20; in { switch = [ - (tasmota_plug "Wasser" "plug") + (glados.tasmota.plug "Wasser" "plug") ]; + automation = [ { alias = "Water the plant for ${toString seconds} seconds"; diff --git a/krebs/2configs/shack/glados/sensors/hass.nix b/krebs/2configs/shack/glados/sensors/hass.nix index 634758701..ced6d9752 100644 --- a/krebs/2configs/shack/glados/sensors/hass.nix +++ b/krebs/2configs/shack/glados/sensors/hass.nix @@ -1,22 +1,5 @@ let - esphome_temp = name: - { platform = "mqtt"; - name = "${name} Temperature"; - device_class = "temperature"; - state_topic = "glados/${name}/sensor/temperature/state"; - availability_topic = "glados/${name}/status"; - payload_available = "online"; - payload_not_available = "offline"; - }; - esphome_hum = name: - { platform = "mqtt"; - device_class = "humidity"; - name = "${name} Humidity"; - state_topic = "glados/${name}/sensor/humidity/state"; - availability_topic = "glados/${name}/status"; - payload_available = "online"; - payload_not_available = "offline"; - }; + glados = import ../lib; in - (map esphome_temp [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) - ++ (map esphome_hum [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + (map glados.esphome.temp [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + ++ (map glados.esphome.hum [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) -- 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 --- krebs/2configs/shack/glados/default.nix | 7 +- krebs/2configs/shack/glados/lib/default.nix | 73 ++++++++++++++++-- .../2configs/shack/glados/multi/schlechte_luft.nix | 87 +++++++++++++++++++--- krebs/2configs/shack/glados/multi/wasser.nix | 2 +- krebs/2configs/shack/glados/sensors/hass.nix | 4 +- 5 files changed, 150 insertions(+), 23 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index 2c9a01af3..59b636697 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -90,7 +90,7 @@ in { }; }; switch = wasser.switch; - light = []; + light = badair.light; media_player = [ { platform = "mpd"; host = "lounge.mpd.shack"; @@ -100,7 +100,8 @@ in { sensor = (import ./sensors/hass.nix) ++ (import ./sensors/power.nix) - ++ shackopen.sensor; + ++ shackopen.sensor + ++ badair.sensor; binary_sensor = shackopen.binary_sensor; @@ -127,7 +128,7 @@ in { #recorder = {}; sun = {}; - automation = wasser.automation; + automation = wasser.automation ++ badair.automation; device_tracker = []; }; }; diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix index debe8e5c2..19c657e64 100644 --- a/krebs/2configs/shack/glados/lib/default.nix +++ b/krebs/2configs/shack/glados/lib/default.nix @@ -1,34 +1,95 @@ let - lib = import ; prefix = "glados"; in { esphome = { - temp = name: + temp = {name, topic ? "temperature" }: { platform = "mqtt"; name = "${name} Temperature"; device_class = "temperature"; - state_topic = "${prefix}/${name}/sensor/temperature/state"; + unit_of_measurement = "°C"; + icon = "mdi:thermometer"; + state_topic = "${prefix}/${name}/sensor/${topic}/state"; availability_topic = "${prefix}/${name}/status"; payload_available = "online"; payload_not_available = "offline"; }; - hum = name: + hum = {name, topic ? "humidity" }: { platform = "mqtt"; + unit_of_measurement = "%"; + icon = "mdi:water-percent"; device_class = "humidity"; name = "${name} Humidity"; - state_topic = "${prefix}/${name}/sensor/humidity/state"; + state_topic = "${prefix}/${name}/sensor/${topic}/state"; availability_topic = "${prefix}/${name}/status"; payload_available = "online"; payload_not_available = "offline"; }; + # copied from "homeassistant/light/fablab_led/led_ring/config" + led = {name, topic ? "led", host ? name }: + { # name: fablab_led + # topic: led_ring + platform = "mqtt"; + inherit name; + schema = "json"; + brightness = true; + rgb = true; + effect = true; + effect_list = [ # TODO: may be different + "Random" + "Strobe" + "Rainbow" + "Color Wipe" + "Scan" + "Twinkle" + "Fireworks" + "Addressable Flicker" + "None" + ]; + state_topic = "${prefix}/${host}/light/${topic}/state"; + command_topic = "${prefix}/${host}/light/${topic}/command"; + availability_topic = "${prefix}/${host}/status"; + payload_available = "online"; + payload_not_available = "offline"; + qos = 1; + }; + # Feinstaub + dust_25m = { host, name ? "${host} < 2.5µm", topic ? "particulate_matter_25m_concentration" }: + { + platform = "mqtt"; + unit_of_measurement = "µg/m³"; + icon = "mdi:chemical-weapon"; + inherit name; + state_topic = "${prefix}/${host}/sensor/${topic}/state"; + availability_topic = "${prefix}/${name}/status"; + }; + dust_100m = {host, name ? "${host} < 10µm", topic ? "particulate_matter_100m_concentration" }: + { + platform = "mqtt"; + unit_of_measurement = "µg/m³"; + icon = "mdi:chemical-weapon"; + inherit name; + state_topic = "${prefix}/${name}/sensor/${topic}/state"; + availability_topic = "${prefix}/${name}/status"; + }; + switch = {host, name ? "${host} Button", topic ? "btn" }: + # host: ampel + # name: Button 1 + # topic: btn1 + { + inherit name; + platform = "mqtt"; + state_topic = "${prefix}/${host}/sensor/${topic}/state"; + command_topic = "${prefix}/${host}/switch/${topic}/state"; + availability_topic = "${prefix}/${host}/status"; + }; }; tasmota = { - plug = name: topic: + plug = {name, topic ? name }: { platform = "mqtt"; inherit name; diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index 94cb768b9..95ea60c04 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 e3e7eb2a0..e909cce74 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 = diff --git a/krebs/2configs/shack/glados/sensors/hass.nix b/krebs/2configs/shack/glados/sensors/hass.nix index ced6d9752..997344366 100644 --- a/krebs/2configs/shack/glados/sensors/hass.nix +++ b/krebs/2configs/shack/glados/sensors/hass.nix @@ -1,5 +1,5 @@ let glados = import ../lib; in - (map glados.esphome.temp [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) - ++ (map glados.esphome.hum [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + (map (name: glados.esphome.temp {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + ++ (map (name: glados.esphome.hum {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) -- 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 --- .../2configs/shack/glados/automation/hass-restart.nix | 19 +++++++++++++++++++ krebs/2configs/shack/glados/default.nix | 7 +++++-- krebs/2configs/shack/glados/multi/schlechte_luft.nix | 6 +++--- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 krebs/2configs/shack/glados/automation/hass-restart.nix (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/glados/automation/hass-restart.nix b/krebs/2configs/shack/glados/automation/hass-restart.nix new file mode 100644 index 000000000..0b4439d97 --- /dev/null +++ b/krebs/2configs/shack/glados/automation/hass-restart.nix @@ -0,0 +1,19 @@ +# needs: +# light.fablab_led +[ + { alias = "State on HA start-up"; + trigger = { + platform = "homeassistant"; + event = "start"; + }; + action = [ + { service = "light.turn_on"; + data = { + entity_id = "light.fablab_led"; + effect = "Rainbow"; + }; + } + ]; + } +] + diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index 59b636697..bdbfa02f9 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -45,7 +45,7 @@ in { autoExtraComponents = true; config = { homeassistant = { - name = "Bureautomation"; + name = "Glados"; time_zone = "Europe/Berlin"; latitude = "48.8265"; longitude = "9.0676"; @@ -128,7 +128,10 @@ in { #recorder = {}; sun = {}; - automation = wasser.automation ++ badair.automation; + automation = wasser.automation + ++ badair.automation + ++ (import ./automation/hass-restart.nix); + device_tracker = []; }; }; diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index 95ea60c04..a72d32d96 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 bf80be669fd57a9be70bc6fbecf9cb5dbd793519 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 9 Jan 2020 16:50:47 +0100 Subject: shack/ssh-keys: add xq --- krebs/2configs/shack/ssh-keys.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/ssh-keys.nix b/krebs/2configs/shack/ssh-keys.nix index 9c7f507f1..95c869bc9 100644 --- a/krebs/2configs/shack/ssh-keys.nix +++ b/krebs/2configs/shack/ssh-keys.nix @@ -4,6 +4,7 @@ config.krebs.users."0x4A6F".pubkey config.krebs.users.ulrich.pubkey config.krebs.users.raute.pubkey + config.krebs.users.xq.pubkey "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQDb9NPa2Hf51afcG1H13UPbE5E02J8aC9a1sGCRls592wAVlQbmojYR1jWDPA2m32Bsyv0ztqi81zDyndWWZPQVJVBk00VjYBcgk6D5ifqoAuWLzfuHJPWZGOvBf/U74/LNFNUkj1ywjneK7HYTRPXrRBBfBSQNmQzkvue7s599L2vdueZKyjNsMpx2m6nm2SchaMuDskSQut/168JgU1l4M8BeT68Bo4WdelhBYnhSI1a59FGkgdu2SCjyighLQRy2sOH3ksnkHWENPkA+wwQOlKl7R3DsEybrNd4NU9FSwFDyDmdhfv5gJp8UGSFdjAwx43+8zM5t5ruZ25J0LnVb0PuTuRA00UsW83MkLxFpDQLrQV08tlsY6iGrqxP67C3VJ6t4v6oTp7/vaRLhEFc1PhOLh+sZ18o8MLO+e2rGmHGHQnSKfBOLUvDMGa4jb01XBGjdnIXLOkVo79YR5jZn7jJb2gTZ95OD6bWSDADoURSuwuLa7kh4ti1ItAKuhkIvbuky3rRVvQEc92kJ6aNUswIUXJa0K2ibbIY6ycKAA3Ljksl3Mm9KzOn6yc/i/lSF+SOrTGhabPJigKkIoqKIwnV5IU3gkfsxPQJOBMPqHDGAOeYQe3WpWedEPYuhQEczw4exMb9TkNE96F71PzuQPJDl5sPAWyPLeMKpy5XbfRiF2by4nxN3ZIQvjtoyVkjNV+qM0q0yKBzLxuRAEQOZ2yCEaBudZQkQiwHD97H2vu4SRQ/2aOie1XiOnmdbQRDZSO3BsoDK569K1w+gDfSnqY7zVUMj6tw+uKx6Gstck5lbvYMtdWKsfPv/pDM8eyIVFLL93dKTX+ertcQj6xDwLfOiNubE5ayFXhYkjwImV6NgfBuq+3hLK0URP2rPlOZbbZTQ0WlKD6CCRZPMSZCU9oD2zYfqpvRArBUcdkAwGePezORkfJQLE6mYEJp6pdFkJ/IeFLbO6M0lZVlfnpzAC9kjjkMCRofZUETcFSppyTImCbgo3+ok59/PkNU5oavBXyW80ue2tWHr08HX/QALNte3UITmIIlU6SFMCPMWJqadK1eDPWfJ4H4iDXRNn3D5wqN++iMloKvpaj0wieqXLY4+YfvNTNr177OU48GEWW8DnoEkbpwsCbjPxznGDQhdDqdYyMY/fDgRQReKITvKYGHRzesGysw5cKsp9LEfXD0R6WE2TeiiENla5AWzTgXJB0AyZEcOiIfqOgT9Nr9S8q5gc/BdA7P+jhGGJgEHhV3dVlfIZ7pmZc27Yu7UTQ0lbAKWqcMSTOdne+QL6ILzbvLrQwdvax4tQdm5opfU16SrOox1AMwAbkdq84z6uJqYVx3cUXfMJgTyDNrVv3or root@plattenschwein" # for backup "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1Lx5MKtVjB/Ef6LpEiIAgVwY5xKQFdHuLQR+odQO4cAgxj1QaIXGN0moixY52DebVQhAtiCNiFZ83uJyOj8kmu30yuXwtSOQeqziA859qMJKZ4ZcYdKvbXwnf2Chm5Ck/0FvtpjTWHIZAogwP1wQto/lcqHOjrTAnZeJfQuHTswYUSnmUU5zdsEZ9HidDPUc2Gv0wkBNd+KMQyOZl0HkaxHWvn0h4KK4hYZisOpeTfXJxD87bo+Eg4LL2vvnHW6dF6Ygrbd/0XRMsRRI8OAReVBUoJn7IE1wwAl/FpblNmhaF9hlL7g7hR1ADvaWMMw0e8SSzW6Y+oIa8qFQL6wR1 gitlab-builder" # for being deployed by gitlab ci ]; -- 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') diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index a72d32d96..9cd2c56f4 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 From 5f3dcaa95810e1729a884df1d999b236c6eaaccc Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 10 Jan 2020 09:59:11 +0100 Subject: shack/glados: use host consistently --- .../shack/glados/automation/hass-restart.nix | 1 + krebs/2configs/shack/glados/lib/default.nix | 26 +++++++++++----------- krebs/2configs/shack/glados/multi/wasser.nix | 2 +- krebs/2configs/shack/glados/sensors/hass.nix | 4 ++-- 4 files changed, 17 insertions(+), 16 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/glados/automation/hass-restart.nix b/krebs/2configs/shack/glados/automation/hass-restart.nix index 0b4439d97..e87354978 100644 --- a/krebs/2configs/shack/glados/automation/hass-restart.nix +++ b/krebs/2configs/shack/glados/automation/hass-restart.nix @@ -11,6 +11,7 @@ data = { entity_id = "light.fablab_led"; effect = "Rainbow"; + color_name = "yellow"; }; } ]; diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix index 19c657e64..6737af842 100644 --- a/krebs/2configs/shack/glados/lib/default.nix +++ b/krebs/2configs/shack/glados/lib/default.nix @@ -4,32 +4,32 @@ in { esphome = { - temp = {name, topic ? "temperature" }: + temp = {host, topic ? "temperature" }: { platform = "mqtt"; - name = "${name} Temperature"; + name = "${host} Temperature"; device_class = "temperature"; unit_of_measurement = "°C"; icon = "mdi:thermometer"; - state_topic = "${prefix}/${name}/sensor/${topic}/state"; - availability_topic = "${prefix}/${name}/status"; + state_topic = "${prefix}/${host}/sensor/${topic}/state"; + availability_topic = "${prefix}/${host}/status"; payload_available = "online"; payload_not_available = "offline"; }; - hum = {name, topic ? "humidity" }: + hum = {host, topic ? "humidity" }: { platform = "mqtt"; unit_of_measurement = "%"; icon = "mdi:water-percent"; device_class = "humidity"; - name = "${name} Humidity"; - state_topic = "${prefix}/${name}/sensor/${topic}/state"; - availability_topic = "${prefix}/${name}/status"; + name = "${host} Humidity"; + state_topic = "${prefix}/${host}/sensor/${topic}/state"; + availability_topic = "${prefix}/${host}/status"; payload_available = "online"; payload_not_available = "offline"; }; # copied from "homeassistant/light/fablab_led/led_ring/config" - led = {name, topic ? "led", host ? name }: + led = {host, topic ? "led", name ? host}: { # name: fablab_led # topic: led_ring platform = "mqtt"; @@ -64,7 +64,7 @@ in icon = "mdi:chemical-weapon"; inherit name; state_topic = "${prefix}/${host}/sensor/${topic}/state"; - availability_topic = "${prefix}/${name}/status"; + availability_topic = "${prefix}/${host}/status"; }; dust_100m = {host, name ? "${host} < 10µm", topic ? "particulate_matter_100m_concentration" }: { @@ -72,8 +72,8 @@ in unit_of_measurement = "µg/m³"; icon = "mdi:chemical-weapon"; inherit name; - state_topic = "${prefix}/${name}/sensor/${topic}/state"; - availability_topic = "${prefix}/${name}/status"; + state_topic = "${prefix}/${host}/sensor/${topic}/state"; + availability_topic = "${prefix}/${host}/status"; }; switch = {host, name ? "${host} Button", topic ? "btn" }: # host: ampel @@ -89,7 +89,7 @@ in }; tasmota = { - plug = {name, topic ? name }: + plug = {host, name ? host, topic ? host}: { platform = "mqtt"; inherit name; diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix index e909cce74..cdfe01405 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 { name = "Wasser"; topic = "plug";} ) + (glados.tasmota.plug { host = "Wasser"; topic = "plug";} ) ]; automation = diff --git a/krebs/2configs/shack/glados/sensors/hass.nix b/krebs/2configs/shack/glados/sensors/hass.nix index 997344366..8de0ef391 100644 --- a/krebs/2configs/shack/glados/sensors/hass.nix +++ b/krebs/2configs/shack/glados/sensors/hass.nix @@ -1,5 +1,5 @@ let glados = import ../lib; in - (map (name: glados.esphome.temp {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) - ++ (map (name: glados.esphome.hum {inherit name;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + (map (host: glados.esphome.temp {inherit host;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) + ++ (map (host: glados.esphome.hum {inherit host;}) [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ]) -- cgit v1.2.3 From 5d3fbb2af9c1c7d166ca45cd9d119bd77a3acd80 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 10 Jan 2020 10:18:39 +0100 Subject: shack/glados: enable logbook,recorder,history --- krebs/2configs/shack/glados/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index bdbfa02f9..e48a54551 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -115,8 +115,9 @@ in { trusted_proxies = "127.0.0.1"; }; #conversation = {}; - #history = {}; - #logbook = {}; + history = {}; + logbook = {}; + recorder = {}; tts = [ { platform = "google_translate"; language = "de"; @@ -125,7 +126,6 @@ in { # language = "de-DE"; #} ]; - #recorder = {}; sun = {}; automation = wasser.automation -- cgit v1.2.3