summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack')
-rwxr-xr-xkrebs/2configs/shack/doorstatus.sh3
-rw-r--r--krebs/2configs/shack/drivedroid.nix4
-rw-r--r--krebs/2configs/shack/esphome.nix7
-rw-r--r--krebs/2configs/shack/gitlab-runner.nix4
-rw-r--r--krebs/2configs/shack/glados/automation/ampel.nix23
-rw-r--r--krebs/2configs/shack/glados/automation/announcement.j228
-rw-r--r--krebs/2configs/shack/glados/automation/hass-restart.nix24
-rw-r--r--krebs/2configs/shack/glados/automation/party-time.nix32
-rw-r--r--krebs/2configs/shack/glados/automation/shack-startup.nix100
-rw-r--r--krebs/2configs/shack/glados/default.nix153
-rw-r--r--krebs/2configs/shack/glados/deps/gtts-token.nix27
-rw-r--r--krebs/2configs/shack/glados/deps/pyhaversion.nix33
-rw-r--r--krebs/2configs/shack/glados/lib/default.nix66
-rw-r--r--krebs/2configs/shack/glados/multi/rollos.nix59
-rw-r--r--krebs/2configs/shack/glados/multi/schlechte_luft.nix109
-rw-r--r--krebs/2configs/shack/glados/multi/shackopen.nix26
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix113
-rw-r--r--krebs/2configs/shack/glados/sensors/darksky.nix24
-rw-r--r--krebs/2configs/shack/glados/sensors/mate.nix20
-rw-r--r--krebs/2configs/shack/glados/sensors/power.nix29
-rw-r--r--krebs/2configs/shack/glados/sensors/sensemap.nix9
-rw-r--r--krebs/2configs/shack/glados/sensors/spaceapi.nix55
-rw-r--r--krebs/2configs/shack/glados/sensors/unifi.nix6
-rw-r--r--krebs/2configs/shack/glados/switch/power.nix44
-rw-r--r--krebs/2configs/shack/glados/zigbee-quirks/__init__.py0
-rw-r--r--krebs/2configs/shack/glados/zigbee-quirks/ts011f_power_monitoring.py96
-rw-r--r--krebs/2configs/shack/glados/zigbee.nix5
-rw-r--r--krebs/2configs/shack/grafana.nix18
-rw-r--r--krebs/2configs/shack/influx.nix10
-rw-r--r--krebs/2configs/shack/mqtt_sub.nix2
-rw-r--r--krebs/2configs/shack/muell_caller.nix4
-rw-r--r--krebs/2configs/shack/muell_mail.nix2
-rw-r--r--krebs/2configs/shack/nix-cacher.nix2
-rw-r--r--krebs/2configs/shack/power/u300-power.nix29
-rw-r--r--krebs/2configs/shack/prometheus/alert-rules.nix21
-rw-r--r--krebs/2configs/shack/prometheus/alertmanager-telegram.nix17
-rw-r--r--krebs/2configs/shack/prometheus/irc-alerts.py207
-rw-r--r--krebs/2configs/shack/prometheus/irc-hooks.nix59
-rw-r--r--krebs/2configs/shack/prometheus/server.nix5
-rw-r--r--krebs/2configs/shack/prometheus/unifi.nix2
-rw-r--r--krebs/2configs/shack/radioactive.nix2
-rw-r--r--krebs/2configs/shack/reaktor.nix15
-rw-r--r--krebs/2configs/shack/s3-power.nix2
-rw-r--r--krebs/2configs/shack/worlddomination.nix2
44 files changed, 486 insertions, 1012 deletions
diff --git a/krebs/2configs/shack/doorstatus.sh b/krebs/2configs/shack/doorstatus.sh
index 11e710cf..aa6c1c3d 100755
--- a/krebs/2configs/shack/doorstatus.sh
+++ b/krebs/2configs/shack/doorstatus.sh
@@ -54,7 +54,8 @@ Herr makefu an Kasse 3 bitte, Kasse 3 bitte Herr makefu. Der API Computer ist ma
EOF
)
-state=$(curl https://api.shackspace.de/v1/space | jq .doorState.open)
+payload=$(curl -fSsk https://api.shackspace.de/v1/space)
+state=$(printf '%s' "$payload" | jq .doorState.open)
prevstate=$(cat state ||:)
if test "$state" == "$(cat state)";then
diff --git a/krebs/2configs/shack/drivedroid.nix b/krebs/2configs/shack/drivedroid.nix
index 12e4a39c..e00db8b8 100644
--- a/krebs/2configs/shack/drivedroid.nix
+++ b/krebs/2configs/shack/drivedroid.nix
@@ -1,5 +1,5 @@
-{ config, pkgs, ... }:
-with import <stockholm/lib>;
+{ config, lib, pkgs, ... }:
+with import ../../../lib/pure.nix { inherit lib; };
let
root = "/var/srv/drivedroid";
in
diff --git a/krebs/2configs/shack/esphome.nix b/krebs/2configs/shack/esphome.nix
new file mode 100644
index 00000000..b6bcbce3
--- /dev/null
+++ b/krebs/2configs/shack/esphome.nix
@@ -0,0 +1,7 @@
+{
+ services.esphome = {
+ enable = true;
+ address = "0.0.0.0";
+ openFirewall = true;
+ };
+}
diff --git a/krebs/2configs/shack/gitlab-runner.nix b/krebs/2configs/shack/gitlab-runner.nix
index d525e798..a27fe29a 100644
--- a/krebs/2configs/shack/gitlab-runner.nix
+++ b/krebs/2configs/shack/gitlab-runner.nix
@@ -1,4 +1,4 @@
-{ pkgs,lib, ... }:
+{ config, lib, pkgs, ... }:
{
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
services.gitlab-runner = {
@@ -10,7 +10,7 @@
# File should contain at least these two variables:
# `CI_SERVER_URL`
# `REGISTRATION_TOKEN`
- registrationConfigFile = toString <secrets/shackspace-gitlab-ci>;
+ registrationConfigFile = "${config.krebs.secret.directory}/shackspace-gitlab-ci";
dockerImage = "alpine";
dockerVolumes = [
"/nix/store:/nix/store:ro"
diff --git a/krebs/2configs/shack/glados/automation/ampel.nix b/krebs/2configs/shack/glados/automation/ampel.nix
deleted file mode 100644
index 4be92a32..00000000
--- a/krebs/2configs/shack/glados/automation/ampel.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-# needs:
-# binary_sensor.lounge_ampel_status
-# light.lounge_ampel_licht_rot
-
-let
- glados = import ../lib;
-in
-{
- services.home-assistant.config.automation =
- [
- {
- alias = "Ampel Rotes Licht";
- initial_state = true;
- trigger = {
- platform = "state";
- entity_id = "binary_sensor.lounge_ampel_status";
- };
- action = { service = "light.turn_on";
- data.entity_id = "light.lounge_ampel_licht_rot";
- };
- }
- ];
-}
diff --git a/krebs/2configs/shack/glados/automation/announcement.j2 b/krebs/2configs/shack/glados/automation/announcement.j2
deleted file mode 100644
index 2ae5f1a4..00000000
--- a/krebs/2configs/shack/glados/automation/announcement.j2
+++ /dev/null
@@ -1,28 +0,0 @@
-Willkommen werter Keyholder {{ states("sensor.keyholder") }} in deinem Lieblingshackerspace.
-
-Es ist {{states("sensor.fablab_feinstaub_temperature") | round(1) | replace('.',' Komma ')}} Grad {% if states("sensor.fablab_feinstaub_temperature")|float > 25 %}heiss{%elif states("sensor.fablab_feinstaub_temperature")|float > 15%}warm{%else%}kalt{%endif%} bei {% if states(" sensor.rz_feinstaub_humidity") | int <45 %}trockenen{% elif states(" sensor.rz_feinstaub_humidity") | int <65 %}angenehmen{%else%}feuchten{%endif%} {{states(" sensor.rz_feinstaub_humidity") | int }} Prozent Luftfeuchtigkeit.
-
-{% if (states("sensor.fullstand_mate_1")|int == 0) and
- states("sensor.fullstand_mate_2")|int == 0 %}ES IST MAHTECALYPSE, BEIDE MAHTESCHÄCHTE SIND LEER! {%if states("sensor.fullstand_mate_cola")| int == 0%} UND SOGAR DIE COLA IST ALLE. Ihr seid sowas von am Arsch!{%else%}Zum Glück gibt es noch Cola, Phew!{%endif%}
-{% elif (states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int) < 5 %}
-Der Mahtestand im Automaten ist mit {{states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int }} verbleibenden Flaschen kritisch!
-{% else %}
-Im Automaten sind noch {{states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int }} Flaschen Mahte und {{states("sensor.fullstand_mate_cola")}} Flaschen Cola.
-{%endif%}
-
-Die Wettervorhersage: {{states("sensor.dark_sky_hourly_summary")}} Aktuell {{states("sensor.dark_sky_summary")}} bei {{states("sensor.dark_sky_temperature") | round(1) | replace('.',' Komma ')}} Grad.
-Der Stromverbrauch liegt bei {{ (( states("sensor.l1_power")|int + states("sensor.l2_power")|int + states("sensor.l3_power")|int ) / 1000 )| round(1) | replace('.',' Komma ')}} Kilowatt.
-
-Im Fablab ist die Feinstaubbelastung {% if states("sensor.fablab_particulate_matter_2_5um_concentration") | float > 50 %}hoch!{%elif states("sensor.fablab_particulate_matter_2_5um_concentration") | float > 25 %}mäßig.{% else %}gering.{%endif%}
-
-{% if is_state("binary_sensor.door_rzl",'on') and is_state("binary_sensor.door_entropia",'on') %}
-Das Raumzeitlabor und Entropia haben geöffnet.
-{% elif is_state("binary_sensor.door_rzl",'off') and is_state("binary_sensor.door_entropia",'off') %}
-Das Raumzeitlabor und Entropia haben geschlossen.
-{% elif is_state("binary_sensor.door_rzl",'on') and is_state("binary_sensor.door_entropia",'off') %}
-Das Raumzeitlabor hat geöffnet und Entropia hat geschlossen.
-{% elif is_state("binary_sensor.door_rzl",'off') and is_state("binary_sensor.door_entropia",'on') %}
-Das Raumzeitlabor hat geschlossen und Entropia hat geöffnet.
-{%endif%}
-
-Die Glados Hackerspace Automation wünscht dir und allen Anwesenden einen produktiven und angenehmen Aufenthalt!
diff --git a/krebs/2configs/shack/glados/automation/hass-restart.nix b/krebs/2configs/shack/glados/automation/hass-restart.nix
deleted file mode 100644
index 5f61e19f..00000000
--- a/krebs/2configs/shack/glados/automation/hass-restart.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-# needs:
-# light.fablab_led
-{
- services.home-assistant.config.automation =
- [
- { alias = "State on HA start-up";
- trigger = {
- platform = "homeassistant";
- event = "start";
- };
- # trigger good/bad air
- action = [
- { service = "light.turn_on";
- data = {
- entity_id = "light.fablab_led";
- effect = "Rainbow";
- color_name = "purple";
- };
- }
- ];
- }
- ];
-}
-
diff --git a/krebs/2configs/shack/glados/automation/party-time.nix b/krebs/2configs/shack/glados/automation/party-time.nix
deleted file mode 100644
index 9e7fe24c..00000000
--- a/krebs/2configs/shack/glados/automation/party-time.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-# Needs:
-# sun.sunset
-# switch.lounge_diskoschalter_relay
-let
- glados = import ../lib;
- disko_schalter = "switch.lounge_diskoschalter_relay";
- player = "media_player.lounge";
-in
-{
- services.home-assistant.config.automation =
- [
- { alias = "Party um 21 Uhr";
- trigger = {
- platform = "sun";
- event = "sunset";
- };
- action =
- ( glados.say.kiosk "Die Sonne geht unter. Und jetzt geht die Party im shack erst richtig los. Partybeleuchtung, aktiviert!" )
- ++
- [
- {
- service = "homeassistant.turn_on";
- entity_id = disko_schalter;
- }
- {
- service = "media_player.turn_on";
- data.entity_id = player;
- } # TODO: also start playlist if nothing is running?
- ];
- }
- ];
-}
diff --git a/krebs/2configs/shack/glados/automation/shack-startup.nix b/krebs/2configs/shack/glados/automation/shack-startup.nix
deleted file mode 100644
index 471d817a..00000000
--- a/krebs/2configs/shack/glados/automation/shack-startup.nix
+++ /dev/null
@@ -1,100 +0,0 @@
-# needs:
-# binary_sensor.portal_lock
-# sensor.keyholder
-# media_player.lounge
-
-# additional state required on:
-# mpd.shack:
-# playlist "ansage"
-# playlist "lassulus"
-# lounge.kiosk.shack:
-# playlist "ansage"
-
-let
- glados = import ../lib;
-in
-{
- services.home-assistant.config.automation =
- [
- {
- alias = "Bedanken bei Übernahme von Key";
- initial_state = true;
- trigger = {
- platform = "state";
- entity_id = "sensor.keyholder";
- };
- condition = {
- condition = "template";
- value_template = "{{ (trigger.from_state.state != 'No Keyholder') and (trigger.from_state.state != 'No Keyholder') }}";
- };
- action = glados.say.kiosk "Danke {{ trigger.to_state.state }} für das Übernehmen des Keys von {{ trigger.from_state.state }}";
- }
- {
- alias = "Keyholder Begrüßen wenn MPD hoch fährt";
- initial_state = true;
- trigger = {
- platform = "state";
- from = "unavailable";
- entity_id = "media_player.kiosk";
- };
- action = glados.say.kiosk (builtins.readFile ./announcement.j2);
- }
- {
- alias = "Start Music on portal lock on";
- trigger = {
- platform = "state";
- entity_id = "binary_sensor.portal_lock";
- to = "on";
- for.seconds = 30;
- };
- condition = {
- condition = "and";
- conditions =
- [
- { # only start if a keyholder opened the door and if the lounge mpd is currently not playing anything
- condition = "template";
- value_template = "{{ state('sensor.keyholder') != 'No Keyholder' }}";
- }
- {
- condition = "state";
- entity_id = "media_player.lounge";
- state = "idle";
- }
- ];
- };
- action = [
- {
- service = "media_player.volume_set";
- data = {
- entity_id = "media_player.lounge";
- volume_level = 1.0;
- };
- }
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.lounge";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 8.5; }
- {
- service = "media_player.volume_set";
- data = {
- entity_id = "media_player.lounge";
- volume_level = 0.6;
- };
- }
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.lounge";
- media_content_type = "playlist";
- media_content_id = "lassulus";
- };
- }
- ];
- }
- ];
-}
diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix
index 7c941a66..e8ed18f0 100644
--- a/krebs/2configs/shack/glados/default.nix
+++ b/krebs/2configs/shack/glados/default.nix
@@ -1,12 +1,30 @@
{ config, pkgs, lib, ... }:
let
- unstable = import (pkgs.fetchFromGitHub {
- owner = "nixos";
- repo = "nixpkgs";
- rev = (lib.importJSON ../../../nixpkgs-unstable.json).rev;
- sha256 = (lib.importJSON ../../../nixpkgs-unstable.json).sha256;
- }) {};
+ kodi-host = "192.168.8.11";
+ confdir = "/var/lib/homeassistant-docker";
in {
+ imports = [ ./zigbee.nix ];
+
+ networking.firewall.allowedTCPPorts = [ 8123 ];
+ virtualisation.oci-containers.containers.hass = {
+ image = "homeassistant/home-assistant:latest";
+ environment = {
+ TZ = "Europe/Berlin";
+ UMASK = "007";
+ };
+ extraOptions = ["--net=host" "--device=/dev/zigbee" ];
+ volumes = [
+ "${confdir}:/config"
+ "${./zigbee-quirks}:/quirks"
+ #"${confdir}/docker-run:/etc/services.d/home-assistant/run:"
+ ];
+ };
+ systemd.tmpfiles.rules = [
+ #"f ${confdir}/docker-run 0770 kiosk kiosk - -"
+ # TODO:
+ "d ${confdir} 0770 root root - -"
+ ];
+
services.nginx.virtualHosts."hass.shack" = {
serverAliases = [ "glados.shack" ];
locations."/" = {
@@ -23,127 +41,4 @@ in {
'';
};
};
- imports = [
- ./multi/shackopen.nix
- ./multi/wasser.nix
- ./multi/schlechte_luft.nix
- ./multi/rollos.nix
-
- ./switch/power.nix
-
- ./sensors/power.nix
- ./sensors/mate.nix
- ./sensors/darksky.nix
- ./sensors/spaceapi.nix
- ./sensors/sensemap.nix
-
- ./automation/shack-startup.nix
- ./automation/party-time.nix
- ./automation/hass-restart.nix
- ./automation/ampel.nix
-
- ];
- services.home-assistant =
- {
- enable = true;
- package = unstable.home-assistant.overrideAttrs (old: {
- doInstallCheck = false;
- });
- config = {
- homeassistant = {
- name = "Glados";
- time_zone = "Europe/Berlin";
- latitude = "48.8265";
- longitude = "9.0676";
- elevation = 303;
- auth_providers = [
- { type = "homeassistant";}
- { type = "trusted_networks";
- trusted_networks = [
- "127.0.0.1/32"
- "10.42.0.0/16"
- "::1/128"
- "fd00::/8"
- ];
- }
- ];
- };
- # https://www.home-assistant.io/components/influxdb/
- influxdb = {
- database = "glados";
- host = "influx.shack";
- component_config_glob = {
- "sensor.*particulate_matter_2_5um_concentration".override_measurement = "2_5um particles";
- "sensor.*particulate_matter_10_0um_concentration".override_measurement ="10um particles";
- };
- tags = {
- instance = "wolf";
- source = "glados";
- };
- };
- esphome = {};
- api = {};
- mqtt = {
- broker = "localhost";
- port = 1883;
- client_id = "home-assistant";
- keepalive = 60;
- protocol = 3.1;
- discovery = true; #enable esphome discovery
- discovery_prefix = "homeassistant";
- birth_message = {
- topic = "glados/hass/status/LWT";
- payload = "Online";
- qos = 1;
- retain = true;
- };
- will_message = {
- topic = "glados/hass/status/LWT";
- payload = "Offline";
- qos = 1;
- retain = true;
- };
- };
- light = [];
- media_player = [
- { platform = "mpd";
- name = "lounge";
- host = "lounge.mpd.shack";
- }
- { platform = "mpd";
- name = "kiosk";
- #host = "lounge.kiosk.shack";
- host = "kiosk.shack";
- }
- ];
-
- camera = [];
- frontend = { };
- config = { };
- sun = {};
- http = {
- base_url = "http://hass.shack";
- use_x_forwarded_for = true;
- trusted_proxies = [ "127.0.0.1" "::1" ];
- };
- #conversation = {};
-
- history = {};
- logbook = {};
- #recorder = {};
-
- logger.default = "info";
-
- tts = [
- { platform = "google_translate";
- service_name = "say";
- language = "de";
- cache = true;
- time_memory = 57600;
- base_url = "http://hass.shack";
- }
- ];
- device_tracker = [];
- };
- };
}
diff --git a/krebs/2configs/shack/glados/deps/gtts-token.nix b/krebs/2configs/shack/glados/deps/gtts-token.nix
deleted file mode 100644
index 69640f03..00000000
--- a/krebs/2configs/shack/glados/deps/gtts-token.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, requests
-}:
-
-buildPythonPackage rec {
- pname = "gtts-token";
- version = "1.1.3";
-
- src = fetchPypi {
- pname = "gTTS-token";
- inherit version;
- sha256 = "9d6819a85b813f235397ef931ad4b680f03d843c9b2a9e74dd95175a4bc012c5";
- };
-
- propagatedBuildInputs = [
- requests
- ];
-
- meta = with lib; {
- description = "Calculates a token to run the Google Translate text to speech";
- homepage = https://github.com/boudewijn26/gTTS-token;
- license = licenses.mit;
- # maintainers = [ maintainers. ];
- };
-}
diff --git a/krebs/2configs/shack/glados/deps/pyhaversion.nix b/krebs/2configs/shack/glados/deps/pyhaversion.nix
deleted file mode 100644
index a75c6a97..00000000
--- a/krebs/2configs/shack/glados/deps/pyhaversion.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchpatch
-, fetchPypi
-, aiohttp
-, async-timeout
-}:
-
-buildPythonPackage rec {
- pname = "pyhaversion";
- version = "2.2.1";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "72b65aa25d7b2dbb839a4d0218df2005c2335e93526035904d365bb668030b9f";
- };
- patches = [
- (fetchpatch { url = "https://github.com/makefu/pyhaversion/commit/f3bdc38970272cd345c2cfbde3037ea492ca27c4.patch";
- sha256 =
- "1rhq4z7mdgnwhwpf5fmarnbc1ba3qysk1wqjdr0hvbzi8vmvbfcc";})
- ];
- doCheck = false;
- propagatedBuildInputs = [
- aiohttp
- async-timeout
- ];
-
- meta = with lib; {
- description = "";
- homepage = https://github.com/ludeeus/pyhaversion;
- # maintainers = [ maintainers. ];
- };
-}
diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix
deleted file mode 100644
index 2cfac3da..00000000
--- a/krebs/2configs/shack/glados/lib/default.nix
+++ /dev/null
@@ -1,66 +0,0 @@
-let
- prefix = "glados";
-in
-{
-
- say = let
- # returns a list of actions to be performed on an mpd to say something
- tts = { message, entity }:
- [
- {
- service = "media_player.turn_on";
- data.entity_id = "media_player.${entity}";
- }
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.${entity}";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- {
- service = "media_player.turn_on";
- data.entity_id = "media_player.${entity}";
- }
- { delay.seconds = 4.5; }
- { service = "tts.say";
- entity_id = "media_player.${entity}";
- data_template = {
- inherit message;
- language = "de";
- };
- }
- ];
- in
- {
- lounge = message: tts {
- inherit message;
- entity = "lounge";
- };
- herrenklo = message: tts {
- inherit message;
- entity = "herrenklo";
- };
- kiosk = message: tts {
- inherit message;
- entity = "kiosk";
- };
- };
- tasmota =
- {
- plug = {host, name ? host, topic ? host}:
- {
- 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/rollos.nix b/krebs/2configs/shack/glados/multi/rollos.nix
deleted file mode 100644
index 29525ad8..00000000
--- a/krebs/2configs/shack/glados/multi/rollos.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-
-let
- glados = import ../lib;
- tempsensor = "sensor.dark_sky_temperature";
- all_covers = [
- "cover.crafting_rollo"
- "cover.elab_rollo"
- "cover.or2_rollo"
- "cover.retroraum_rollo"
- ];
-in
-{
- services.home-assistant.config =
- {
- automation =
- [
- { alias = "Rollos fahren Runter";
- trigger = [
- {
- platform = "numeric_state";
- entity_id = tempsensor;
- above = 25;
- for = "00:30:00";
- }
- ];
- condition =
- [
- {
- condition = "state";
- entity_id = "sun.sun";
- state = "above_horizon";
- }
- ];
- action =
- [
- { service = "cover.close_cover";
- entity_id = all_covers;
- }
- ];
- }
- { alias = "Rollos fahren Hoch";
- trigger = [
- {
- platform = "sun";
- event = "sunset";
- }
- ];
- condition = [ ];
- action =
- [
- { service = "cover.open_cover";
- entity_id = all_covers;
- }
- ];
- }
- ];
- };
-}
diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix
deleted file mode 100644
index c1890361..00000000
--- a/krebs/2configs/shack/glados/multi/schlechte_luft.nix
+++ /dev/null
@@ -1,109 +0,0 @@
-let
- glados = import ../lib;
- feinstaub_sensor = "sensor.fablab_particulate_matter_2_5um_concentration";
- ledring = "light.fablab_led_ring";
-in
-{
- services.home-assistant.config =
- {
- automation =
- [
- { alias = "Gute Luft Fablab";
- trigger = [
- {
- platform = "numeric_state";
- entity_id = feinstaub_sensor;
- below = 3;
- }
- ];
- action =
- [
- { service = "light.turn_on";
- data = {
- entity_id = ledring;
- effect = "Twinkle";
- color_name = "green";
- };
- }
- ];
- }
- { alias = "mäßige Luft Fablab";
- trigger = [
- {
- platform = "numeric_state";
- above = 3;
- below = 10;
- entity_id = feinstaub_sensor;
- }
- ];
- action =
- [
- { service = "light.turn_on";
- data = {
- entity_id = ledring;
- effect = "Twinkle";
- color_name = "yellow";
- };
- }
- ];
- }
- { alias = "schlechte Luft Fablab";
- trigger = [
- {
- platform = "numeric_state";
- above = 10;
- entity_id = feinstaub_sensor;
- }
- ];
- action =
- [
- { service = "light.turn_on";
- data = {
- entity_id = ledring;
- effect = "Fireworks";
- color_name = "red";
- };
- }
- ];
- }