summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/bureautomation')
-rw-r--r--makefu/2configs/bureautomation/automation/bureau-shutdown.nix87
-rw-r--r--makefu/2configs/bureautomation/automation/daily-news.nix20
-rw-r--r--makefu/2configs/bureautomation/automation/hass-restart.nix34
-rw-r--r--makefu/2configs/bureautomation/automation/nachtlicht.nix38
-rw-r--r--makefu/2configs/bureautomation/automation/philosophische-tuer.nix100
-rw-r--r--makefu/2configs/bureautomation/automation/quotes.nix4
-rw-r--r--makefu/2configs/bureautomation/automation/schlechteluft.nix75
-rw-r--r--makefu/2configs/bureautomation/binary_sensor/buttons.nix20
-rw-r--r--makefu/2configs/bureautomation/binary_sensor/motion.nix15
-rw-r--r--makefu/2configs/bureautomation/brother-ql-web.nix23
-rw-r--r--makefu/2configs/bureautomation/camera/comic.nix13
-rw-r--r--makefu/2configs/bureautomation/camera/stuttgart.nix30
-rw-r--r--makefu/2configs/bureautomation/camera/verkehrskamera.nix17
-rw-r--r--makefu/2configs/bureautomation/comic-updater.nix37
-rw-r--r--makefu/2configs/bureautomation/default.nix203
-rw-r--r--makefu/2configs/bureautomation/deps/aresponses.nix38
-rw-r--r--makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix34
-rw-r--r--makefu/2configs/bureautomation/device_tracker/openwrt.nix18
-rw-r--r--makefu/2configs/bureautomation/devices/users.nix17
-rw-r--r--makefu/2configs/bureautomation/kalauerbot.nix28
-rw-r--r--makefu/2configs/bureautomation/led-fader.nix23
-rw-r--r--makefu/2configs/bureautomation/lib/scripts.nix18
-rw-r--r--makefu/2configs/bureautomation/light/buzzer.nix30
-rw-r--r--makefu/2configs/bureautomation/light/statuslight.nix58
-rw-r--r--makefu/2configs/bureautomation/mpd.nix9
-rw-r--r--makefu/2configs/bureautomation/multi/10h_timers.nix210
-rw-r--r--makefu/2configs/bureautomation/multi/aramark.nix27
-rw-r--r--makefu/2configs/bureautomation/multi/daily-standup.nix57
-rw-r--r--makefu/2configs/bureautomation/multi/frosch.nix103
-rw-r--r--makefu/2configs/bureautomation/multi/matrix.nix69
-rw-r--r--makefu/2configs/bureautomation/multi/mittagessen.nix92
-rw-r--r--makefu/2configs/bureautomation/office-radio/default.nix6
-rw-r--r--makefu/2configs/bureautomation/office-radio/mpd.nix58
-rw-r--r--makefu/2configs/bureautomation/office-radio/mpdconfig.nix6
-rw-r--r--makefu/2configs/bureautomation/office-radio/webserver.nix40
-rw-r--r--makefu/2configs/bureautomation/ota.nix15
-rw-r--r--makefu/2configs/bureautomation/person/team.nix87
-rw-r--r--makefu/2configs/bureautomation/printer.nix28
-rw-r--r--makefu/2configs/bureautomation/puppy-proxy.nix5
-rw-r--r--makefu/2configs/bureautomation/rhasspy.nix41
-rw-r--r--makefu/2configs/bureautomation/script/multi_blink.nix60
-rw-r--r--makefu/2configs/bureautomation/sensor/airquality.nix12
-rw-r--r--makefu/2configs/bureautomation/sensor/espeasy.nix33
-rw-r--r--makefu/2configs/bureautomation/sensor/outside.nix32
-rw-r--r--makefu/2configs/bureautomation/sensor/pollen.nix7
-rw-r--r--makefu/2configs/bureautomation/sensor/tasmota_firmware.nix19
-rw-r--r--makefu/2configs/bureautomation/stream/puppies.nix4
-rw-r--r--makefu/2configs/bureautomation/switch/rfbridge.nix19
-rw-r--r--makefu/2configs/bureautomation/switch/tasmota_switch.nix25
-rw-r--r--makefu/2configs/bureautomation/visitor-photostore.nix57
-rw-r--r--makefu/2configs/bureautomation/zigbee2mqtt/default.nix31
-rw-r--r--makefu/2configs/bureautomation/zigbee2mqtt/hass.nix130
52 files changed, 0 insertions, 2262 deletions
diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
deleted file mode 100644
index f4c10adc8..000000000
--- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- services.home-assistant.config.automation =
- [
- { alias = "Turn on Fernseher on group home";
- trigger = {
- platform = "state";
- entity_id = "group.team";
- from = "not_home";
- to = "home";
- for.seconds = 30;
- };
- action = [
- {
- service = "homeassistant.turn_on";
- entity_id = [
- "switch.fernseher"
- "switch.feuer"
- ];
- }
- {
- service = "media_player.kodi_call_method";
- data = {
- entity_id = "media_player.kodi";
- method = "Player.Open";
- item.partymode = "music";
- };
- }
- {
- service = "notify.telegrambot";
- data = {
- title = "Bureau Startup";
- message = "Das Büro wurde eröffnet";
- };
- }
- ];
- }
- { alias = "Turn off Fernseher after last in group left";
- trigger = [
- { # trigger when movement was detected at the time
- platform = "state";
- entity_id = "group.team";
- from = "home";
- to = "not_home";
- }
- { # trigger at 18:00 no matter what
- # to avoid 'everybody left before 18:00:00'
- platform = "time";
- at = "18:00:00";
- }
- ];
- action = [
- {
- service = "homeassistant.turn_off";
- entity_id = [
- "switch.fernseher"
- "switch.feuer"
- "light.status_felix"
- "light.status_daniel"
- ];
- }
- {
- service = "notify.telegrambot";
- data_template = {
- title = "Bureau Shutdown";
- message = "All devices are turned off due to {{ trigger.platform }}";
- };
- }
- ];
- condition =
- { condition = "and";
- conditions = [
- {
- condition = "time";
- before = "06:30:00"; #only turn off between 6:30 and 18:00
- after = "18:00:00";
- # weekday = [ "mon" "tue" "wed" "thu" "fri" ];
- }
- { # if anybody is still there
- condition = "state";
- entity_id = "group.team";
- state = "not_home";
- }
- ];
- };
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/automation/daily-news.nix b/makefu/2configs/bureautomation/automation/daily-news.nix
deleted file mode 100644
index 2bafe4795..000000000
--- a/makefu/2configs/bureautomation/automation/daily-news.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-[
- {
- alias = "Daily news for Felix";
- trigger = {
- platform = "time";
- at = "07:35:00";
- };
- action =
- [
- {
- service = "notify.telegrambot";
- data_template = {
- title = "Daily News";
- # TODO
- message = "";
- };
- }
- ];
- }
-]
diff --git a/makefu/2configs/bureautomation/automation/hass-restart.nix b/makefu/2configs/bureautomation/automation/hass-restart.nix
deleted file mode 100644
index 3b3ce0599..000000000
--- a/makefu/2configs/bureautomation/automation/hass-restart.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- services.home-assistant.config.automation =
- [
- { alias = "State on HA start-up";
- trigger = {
- platform = "homeassistant";
- event = "start";
- };
- action = [
- # Startup State
- { service = "mqtt.publish";
- data = {
- topic = "/bam/sonoffs/cmnd/state";
- payload = "";
- };
- }
- # Firmware Version
- { service = "mqtt.publish";
- data = {
- topic = "/bam/sonoffs/cmnd/status";
- payload = "2";
- };
- }
- # Will trigger restart of all devices!
- #{ service = "mqtt.publish";
- # data = {
- # topic = "sonoffs/cmnd/SetOption59"; # configure sending state on power change
- # payload = "1";
- # };
- #}
- ];
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/automation/nachtlicht.nix b/makefu/2configs/bureautomation/automation/nachtlicht.nix
deleted file mode 100644
index ade89418d..000000000
--- a/makefu/2configs/bureautomation/automation/nachtlicht.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- services.home-assistant.config.automation =
- [
- # TODO: trigger if it is before dusk and somebody arives but nachtlichter are
- # off from last day
- # TODO: do not have nachtlicht turned on at night
- {
- alias = "Turn on Nachtlicht at dusk"; # when it gets dim
- trigger =
- { platform = "numeric_state";
- entity_id = "sun.sun";
- value_template = "{{ state.attributes.elevation }}";
- below = 10;
-
- };
- action =
- { service = "homeassistant.turn_on";
- entity_id = [ "group.nachtlicht" ];
- };
- }
- {
- alias = "Turn off Nachtlicht at dawn";
- trigger =
- { platform = "sun";
- event = "sunrise";
- offset = "01:30:00"; # on dawn
- };
- # TODO: when somebody is still in the buero
- # condition =
- #{
- #};
- action =
- { service = "homeassistant.turn_off";
- entity_id = [ "group.nachtlicht" ];
- };
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/automation/philosophische-tuer.nix b/makefu/2configs/bureautomation/automation/philosophische-tuer.nix
deleted file mode 100644
index 9586d9a46..000000000
--- a/makefu/2configs/bureautomation/automation/philosophische-tuer.nix
+++ /dev/null
@@ -1,100 +0,0 @@
-{ config, pkgs, lib, ... }:
-
-let
- short_threshold = 30; #seconds
- long_threshold = 30; #minutes
- sensor = "binary_sensor.buerotuer_contact";
-
- # get the list of all
- name = "tueraudio";
- prefix = "http://localhost:8123/local/${name}";
- audiodir = "${config.services.home-assistant.configDir}/www/${name}";
- recordrepo = pkgs.fetchFromGitHub {
- owner = "makefu";
- repo = "philosophische_tuer";
- rev = "607eff7";
- sha256 = "1qlyqmc65yfb42q4fzd92vinx4i191w431skmcp7xjncb45lfp8j";
- };
- samples = user: lib.mapAttrsToList
- (file: _: ''"${prefix}/${user}/${file}"'')
- (builtins.readDir (toString ( recordrepo+ "/recordings/${user}")));
- random_tuerspruch = ''{{['' + (lib.concatStringsSep "," (
- (samples "Felix") ++ (samples "Sofia") ++ (samples "Markus")
- )) + ''] | random}}''; # TODO read from derivation
-in
-{
- systemd.services.copy-philosophische-tuersounds = {
- description = "copy philosophische tuer";
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- Type = "oneshot";
- ExecStart = pkgs.writeDash "update-samples" ''
- rm -rf "${audiodir}"
- cp -vr "${recordrepo}/recordings" "${audiodir}"
- '';
- };
- };
- services.home-assistant.config = {
- media_extractor = { };
- script."philosophische_tuer" = {
- alias = "Durchsage der philosophischen Tür";
- sequence = [
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- { service = "media_extractor.play_media";
- entity_id = "media_player.mpd";
- data_template = {
- media_content_id = random_tuerspruch;
- media_content_type = "MUSIC";
- };
- }
- ];
- };
- automation =
- [
- {
- alias = "Tür offen seit ${toString short_threshold} sekunden";
- trigger =
- { platform = "state";
- entity_id = sensor;
- to = "on";
- for.seconds = 60;
- };
- action = [
- { service = "homeassistant.turn_on";
- entity_id = "script.philosophische_tuer";
- }
- ];
- }
- {
- alias = "Tür offen seit ${toString long_threshold} minuten";
- trigger =
- { platform = "state";
- entity_id = sensor;
- to = "on";
- for.minutes = long_threshold;
- };
-
- action = [
- { service = "homeassistant.turn_on";
- entity_id = "script.philosophische_tuer" ;
- }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = "BEEP BOOP - Die Tür ist schon seit ${toString long_threshold} Minuten offen! Student Nummer {{ range(1,500) | random }}, bitte schliesse die Tür";
- language = "de";
- };
- }
- ];
- }
- ];
- };
-
-}
diff --git a/makefu/2configs/bureautomation/automation/quotes.nix b/makefu/2configs/bureautomation/automation/quotes.nix
deleted file mode 100644
index c4625ae30..000000000
--- a/makefu/2configs/bureautomation/automation/quotes.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-# heiss
-Lieber Freund, was für ein Sommer! Ich denke Sie mir im Zimmer sitzend, mehr Omelette als Mensch.
-Sommer ist die Zeit, in der es zu heiß ist, um das zu tun, wozu es im Winter zu kalt war.
-
diff --git a/makefu/2configs/bureautomation/automation/schlechteluft.nix b/makefu/2configs/bureautomation/automation/schlechteluft.nix
deleted file mode 100644
index ea1d44515..000000000
--- a/makefu/2configs/bureautomation/automation/schlechteluft.nix
+++ /dev/null
@@ -1,75 +0,0 @@
-let
- long_threshold = 30;
-in
-{
- services.home-assistant.config.automation =
- [
- {
- alias = "Bad Air Alarm 60 seconds";
- trigger =
- { platform = "numeric_state";
- entity_id = "sensor.air_quality";
- above = 1523;
- for.seconds = 60;
- };
- condition = {
- condition = "and";
- conditions = [
- { condition = "state";
- entity_id = "group.team";
- state = "home";
- }
- { condition = "time";
- after = "06:00:00";
- before = "20:00:00";
- }
- ];
- };
-
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.schlechteluft"
- ];
- }
- ];
- }
- {
- alias = "Bad Air Alarm ${toString long_threshold} Minutes";
- trigger =
- { platform = "numeric_state";
- entity_id = "sensor.air_quality";
- above = 1523;
- for.minutes = long_threshold;
- };
- condition = {
- condition = "and";
- conditions = [
- { condition = "state";
- entity_id = "group.team";
- state = "home";
- }
- { condition = "time";
- after = "06:00:00";
- before = "20:00:00";
- }
- ];
- };
-
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.schlechteluft"
- ];
- }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = "BEEP BEEP - Die luft ist schon ${toString long_threshold} Minuten schlecht! Student Nummer {{ range(1,500) | random }}, öffne ein Fenster.";
- language = "de";
- };
- }
- ];
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/binary_sensor/buttons.nix b/makefu/2configs/bureautomation/binary_sensor/buttons.nix
deleted file mode 100644
index 20590a6b3..000000000
--- a/makefu/2configs/bureautomation/binary_sensor/buttons.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-let
- tasmota_button = name: topic:
- # detects a pushbutton press from tasmota
- { platform = "mqtt";
- inherit name;
- state_topic = "/bam/${topic}/cmnd/POWER";
- availability_topic = "/bam/${topic}/tele/LWT";
- payload_on = "ON";
- payload_off = "OFF";
- payload_available= "Online";
- payload_not_available= "Offline";
- # expire_after = "5"; #expire after 5 seconds
- qos = 1;
- };
-in {
- services.home-assistant.config.binary_sensor =
- [
- (tasmota_button "RedButton" "redbutton")
- ];
-}
diff --git a/makefu/2configs/bureautomation/binary_sensor/motion.nix b/makefu/2configs/bureautomation/binary_sensor/motion.nix
deleted file mode 100644
index 0c5a808e0..000000000
--- a/makefu/2configs/bureautomation/binary_sensor/motion.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- services.home-assistant.config.binary_sensor =
- [
- { platform = "mqtt";
- device_class = "motion";
- name = "Motion";
- state_topic = "/bam/easy2/movement/Switch";
- payload_on = "1";
- payload_off = "0";
- availability_topic = "/bam/easy2/tele/LWT";
- payload_available = "Online";
- payload_not_available = "Offline";
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/brother-ql-web.nix b/makefu/2configs/bureautomation/brother-ql-web.nix
deleted file mode 100644
index 26887db03..000000000
--- a/makefu/2configs/bureautomation/brother-ql-web.nix
+++ /dev/null
@@ -1,23 +0,0 @@
- {pkgs, ... }:
- let
- pkg = pkgs.brother_ql_web;
- in {
- systemd.services.brother-ql-web = {
- after = [ "network.target" ];
- description = "Brother QL Web Interface";
- wantedBy = [ "multi-user.target" ];
- environment = {
- FLASK_PRINTER = "usb://0x04f9:0x209b/000F1Z401759";
- FLASK_MODEL = "QL-800";
- #FLASK_SERVER_PORT = "8013";
- #FLASK_LABEL_DEFAULT_SIZE = "d24";
- #FLASK_LABEL_DEFAULT_QR_SIZE = "7";
- };
- serviceConfig = {
- ExecStart = "${pkg}/bin/brother_ql_web";
- DynamicUser = true;
- SupplementaryGroups = "lp";
- Restart = "always";
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix
deleted file mode 100644
index ae24760e3..000000000
--- a/makefu/2configs/bureautomation/camera/comic.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- services.home-assistant.config.camera =
- [
- { name = "Poorly Drawn Lines";
- platform = "generic";
- still_image_url = http://127.0.0.1:8123/local/lines.png ;
- }
- { name = "XKCD";
- platform = "generic";
- still_image_url = http://127.0.0.1:8123/local/xkcd.png ;
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/camera/stuttgart.nix b/makefu/2configs/bureautomation/camera/stuttgart.nix
deleted file mode 100644
index 0badcb285..000000000
--- a/makefu/2configs/bureautomation/camera/stuttgart.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-
-let
- cam = name: still_image_url:
- {
- inherit name still_image_url;
- platform = "generic";
- };
-in
-{
- services.home-assistant.config.camera =
- [
- ( cam "Max-Eyth-See" https://www.wav-stuttgart.de/webcam/_/webcam1.jpg )
- ( cam "Wilhelma" http://webcam.wilhelma.de/webcam02/webcam02.jpg )
- ( cam "Marktplatz" https://webcam.stuttgart.de/wcam007/current.jpg )
- ( cam "Schoch Areal" https://webcam.stuttgart.de/wcam004/current.jpg )
- ( cam "Leuze" https://webcam.stuttgart.de/wcam005/current.jpg )
- ( cam "Straße Wilhelma" https://webcam.stuttgart.de/wcam006/current.jpg )
- ( cam "Fernsehturm 1" http://webcam.fernsehturmstuttgart.com/current.jpg )
- ( cam "Fernsehturm 2" http://webcam.fernsehturmstuttgart.com/current2.jpg )
- ( cam "Feuerbach Lemberg" http://www.regio7.de/handy/current.jpg )
- ( cam "Flughafen Stuttgart 1" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam2.jpg )
- ( cam "Flughafen Stuttgart 2" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam5.jpg )
- ( cam "Flughafen Stuttgart 3" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam7.jpg )
- ( cam "S21 1" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-03/s21-turm03.jpg )
- ( cam "S21 2" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-02/s21-turm-02.jpg )
- ( cam "S21 3" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-01/s21-turm-01.jpg )
- ( cam "S21 4" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Jaegerstrasse-Nordkopf/s21-jaegerstrassse-nordkopf.jpg )
- ( cam "S21 5" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Bahndirektion-Nord/S21-Bundesbahndirektion-Nord.jpg )
- ];
-}
diff --git a/makefu/2configs/bureautomation/camera/verkehrskamera.nix b/makefu/2configs/bureautomation/camera/verkehrskamera.nix
deleted file mode 100644
index f09dc9423..000000000
--- a/makefu/2configs/bureautomation/camera/verkehrskamera.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- services.home-assistant.config.camera =
- [
- { name = "Baumarkt";
- platform = "generic";
- still_image_url = http://t4915209254324-p80-c0-h6jv2afnujcoftrcstsafb45kdrqv4buy.webdirect.mdex.de/oneshotimage ;# baumarkt
- }
- { name = "Autobahn Heilbronn";
- platform = "generic";
- still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K10 ;
- }
- { name = "Autobahn Singen";
- platform = "generic";
- still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K11 ;
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/comic-updater.nix b/makefu/2configs/bureautomation/comic-updater.nix
deleted file mode 100644
index 5804d66d2..000000000
--- a/makefu/2configs/bureautomation/comic-updater.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ config, lib, pkgs, buildPythonPackage, ... }:
-
-let
- mq = "192.168.8.11";
- pkg = pkgs.ampel;
-in {
- systemd.services.comic-updater = {
- startAt = "daily";
- description = "update our comics";
- after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service");
- path = with pkgs; [ wget xmlstarlet ];
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- # User = "hass";
- #WorkingDirectory = config.services.home-assistant.configDir;
- WorkingDirectory = "/var/lib/homeassistant-docker";
- ExecStart = pkgs.writeDash "update-comics" ''
- set -euf
- mkdir -p www/
- cd www/
- # poorly drawn lines
- pic=$(wget -O- http://www.poorlydrawnlines.com/feed/ \
- | xml sel -t -v '/rss/channel/item/content:encoded' \
- | head -n 2 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
- wget "$pic" -nc && cp -v "$(basename "$pic")" lines.png
-
- #pic=$(curl -L xkcd.com 2>/dev/null | grep imgs.xkcd.com | grep title | sed -n 's/.*src="\([^"]\+\)" .*/https:\1/p')
- # xkcd
- pic=$(wget -O- https://xkcd.com/rss.xml \
- | xml sel -t -v '/rss/channel/item/description' \
- | head -n 1 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
- wget "$pic" -nc && cp -v "$(basename "$pic")" xkcd.png
- '';
- PrivateTmp = true;
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix
deleted file mode 100644
index cd162ba3b..000000000
--- a/makefu/2configs/bureautomation/default.nix
+++ /dev/null
@@ -1,203 +0,0 @@
-{ config, pkgs, lib, ... }:
-let
- kodi-host = "192.168.8.11";
- unstable = import <nixpkgs-unstable> {};
- confdir = "/var/lib/homeassistant-docker";
-in {
- imports = [
- ./ota.nix
- ./comic-updater.nix
- # ./puppy-proxy.nix
-
- ./zigbee2mqtt
- ./rhasspy.nix
-
- # hass config
- ## complex configs
- # ./multi/daily-standup.nix
- #./multi/aramark.nix
- #./multi/matrix.nix
- #./multi/frosch.nix
- #./multi/mittagessen.nix
- #./multi/10h_timers.nix
-
- #./switch/tasmota_switch.nix
- #./switch/rfbridge.nix
-
- #./light/statuslight.nix
- #./light/buzzer.nix
-
- #./script/multi_blink.nix
-
- #./binary_sensor/buttons.nix
- #./binary_sensor/motion.nix
-
- ## ./sensor/pollen.nix requires dwd_pollen
- #./sensor/espeasy.nix
- #./sensor/airquality.nix
- #./sensor/outside.nix
- #./sensor/tasmota_firmware.nix
-
- #./camera/verkehrskamera.nix
- #./camera/comic.nix
- #./camera/stuttgart.nix
- #./automation/bureau-shutdown.nix
- #./automation/nachtlicht.nix
- #./automation/schlechteluft.nix
- #./automation/philosophische-tuer.nix
- #./automation/hass-restart.nix
- #./device_tracker/openwrt.nix
- #./person/team.nix
- ];
-
- networking.firewall.allowedTCPPorts = [ 8123 ];
- state = [ "/var/lib/hass/known_devices.yaml" ];
- virtualisation.oci-containers.containers.hass = {
- image = "homeassistant/home-assistant:latest";
- #user = "${toString config.users.users.kiosk.uid}:${toString config.users.groups.kiosk.gid}";
- #user = "${toString config.users.users.kiosk.uid}:root";
- environment = {
- TZ = "Europe/Berlin";
- PUID = toString config.users.users.kiosk.uid;
- PGID = toString config.users.groups.kiosk.gid;
- UMASK = "007";
- };
- extraOptions = ["--net=host" ];
- volumes = [
- "${confdir}:/config"
- "/data/music:/config/media"
- #"${confdir}/docker-run:/etc/services.d/home-assistant/run:"
- ];
- };
- systemd.tmpfiles.rules = [
- #"f ${confdir}/docker-run 0770 kiosk kiosk - -"
- "d ${confdir} 0770 kiosk kiosk - -"
- ];
- #services.home-assistant = {
- # enable = true;
- # package = (unstable.home-assistant.overrideAttrs (old: {
- # doInstallCheck = false;
- # })).override {
- # extraPackages = p: [
- # # TODO: put somewhere else
- # (p.callPackage <stockholm/makefu/2configs/home/ham/deps/dwdwfsapi.nix> {})
- # # (p.callPackage <stockholm/makefu/2configs/home/ham/deps/pykodi.nix> {})
- # p.APScheduler ];
- # };
- # autoExtraComponents = true;
- # config = {
- # config = {};
- # discovery = {};
- # homeassistant = {
- # name = "Bureautomation";
- # time_zone = "Europe/Berlin";
- # latitude = "48.8265";
- # longitude = "9.0676";
- # elevation = 303;
- # auth_providers = [
- # { type = "homeassistant";}
- # { type = "legacy_api_password";
- # api_password = "sistemas";
- # }
- # { type = "trusted_networks";
- # trusted_networks = [
- # "127.0.0.1/32"
- # "192.168.8.0/24"
- # "::1/128"
- # "fd00::/8"
- # ];
- # # allow_bypass_login = true;
- # }
- # ];
- # };
- # # https://www.home-assistant.io/components/influxdb/
- # influxdb = {
- # database = "hass";
- # tags = {
- # instance = "wbob";
- # source = "hass";
- # };
- # };
- # mqtt = {
- # discovery = true;
- # discovery_prefix = "homeassistant";
- # broker = "localhost";
- # port = 1883;
- # client_id = "home-assistant";
- # keepalive = 60;
- # protocol = 3.1;
- # birth_message = {
- # topic = "/bam/hass/tele/LWT";
- # payload = "Online";
- # qos = 1;
- # retain = true;
- # };
- # will_message = {
- # topic = "/bam/hass/tele/LWT";
- # payload = "Offline";
- # qos = 1;
- # retain = true;
- # };
- # };
- # notify = [
- # {
- # platform = "kodi";
- # name = "wbob-kodi";
- # host = kodi-host;
- # }
- # #{
- # # platform = "telegram";
- # # name = "telegrambot";
- # # chat_id = builtins.elemAt
- # # (builtins.fromJSON (builtins.readFile
- # # <secrets/hass/telegram-bot.json>)).allowed_chat_ids 0;
- # #}
- # ];
- # media_player = [
- # { platform = "kodi";
- # host = kodi-host;
- # }
- # { platform = "mpd";
- # host = "127.0.0.1";
- # }
- # ];
-
- # # sensor = [{ platform = "version"; }]; # pyhaversion
-
-
-
- # frontend = { };
- # http = {
- # # TODO: https://github.com/home-assistant/home-assistant/issues/16149
- # # base_url = "http://192.168.8.11:8123";
- # };
- # conversation = {};
- # history = {};
- # logbook = {};
- # tts = [
- # { platform = "google_translate";
- # language = "de";
- # time_memory = 57600;
- # service_name = "google_say";
- # }
- # { platform = "voicerss";
- # api_key = builtins.readFile <secrets/hass/voicerss.apikey>;
- # language = "de-de";
- # }
- # #{ platform = "picotts";
- # # language = "de-DE";
- # #}
- # ];
- # recorder = {};
- # sun = {};
- # #telegram_bot = [
- # # (builtins.fromJSON
- # # (builtins.readFile <secrets/hass/telegram-bot.json>))
- # #];
- # # only for automation
- # # feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ];
- # # we don't use imports because the expressions do not merge in
- # # home-assistant
- # };
- #};
-}
diff --git a/makefu/2configs/bureautomation/deps/aresponses.nix b/makefu/2configs/bureautomation/deps/aresponses.nix
deleted file mode 100644
index 9e64d2f65..000000000
--- a/makefu/2configs/bureautomation/deps/aresponses.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-# propagatedBuildInputs
-, aiohttp
-# buildInputs
-, pytest
-, pytest-asyncio
-}:
-
-buildPythonPackage rec {
- pname = "aresponses";
- version = "1.1.1";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "d1d6ef52b9a97142d106688cf9b112602ef3dc66f6368de8f91f47241d8cfc9c";
- };
-
- propagatedBuildInputs = [
- aiohttp
- ];
-
- buildInputs = [
- pytest
- pytest-asyncio
- ];
-
- # tests only distributed via git repository, not pypi
- doCheck = false;
-
- meta = with lib; {
- description = "Asyncio testing server";
- homepage = "https://github.com/circleup/aresponses";
- license = licenses.mit;
- maintainers = [ maintainers.makefu ];
- };
-}
diff --git a/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix b/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix
deleted file mode 100644
index 4eceeb146..000000000
--- a/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, click
-, requests
-, packaging
-}:
-
-buildPythonPackage rec {
- pname = "openwrt-luci-rpc";
- version = "1.1.2";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "174a1f6c0bb2a2ed76e5299d14e2be05c612e8bcd4c15b9a9aedee1ef8e18b90";
- };
-
- patchPhase = ''
- sed -i -e "s/requests==2.21.0/requests/" -e "s/packaging==19.1/packaging/" setup.py
- '';
-
- propagatedBuildInputs = [
- click
- requests
- packaging
- ];
-
- meta = with lib; {
- description = "Module for interacting with OpenWrt Luci RPC interface";
- homepage = https://github.com/fbradyirl/openwrt-luci-rpc;
- license = licenses.asl20;
- maintainers = [ maintainers.makefu ];
- };
-}
diff --git a/makefu/2configs/bureautomation/device_tracker/openwrt.nix b/makefu/2configs/bureautomation/device_tracker/openwrt.nix
deleted file mode 100644
index b597548ef..000000000
--- a/makefu/2configs/bureautomation/device_tracker/openwrt.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-# requires `opkg install luci-mod-rpc` on router
-# see https://www.home-assistant.io/components/luci/
-
-{
- services.home-assistant.config.device_tracker =
- [
- { platform = "luci";
- host = "192.168.8.1";
- username = "root";
- password = import <secrets/hass/router.nix>;
- interval_seconds = 30; # instead of 12seconds
- consider_home = 300; # 5 minutes timeout
- new_device_defaults = {
- track_new_devices = true;
- };
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/devices/users.nix b/makefu/2configs/bureautomation/devices/users.nix
deleted file mode 100644
index 305c0ca86..000000000
--- a/makefu/2configs/bureautomation/devices/users.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- thorsten-phone = {
- name = "Thorsten";
- mac = "8c:f5:a3:bc:83:a0";
- track = true;
- hide_if_away = true;
- };
- felix-laptop = {
- name = "Felix";
- mac = "6c:88:14:b4:43:9c";
- track = true;
- hide_if_away = true;
- };
- # b0:e5:ed:52:ee:43 - honor8
- # 38:94:96:b0:13:c7 - android-4ef03e4f4a14b6b9
- # ac:5f:3e:cc:b8:5e - Galaxy S7
-}
diff --git a/makefu/2configs/bureautomation/kalauerbot.nix b/makefu/2configs/bureautomation/kalauerbot.nix
deleted file mode 100644
index aa66e30b4..000000000
--- a/makefu/2configs/bureautomation/kalauerbot.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ config, lib, pkgs, ... }:
-let
- oofdir = fetchTarball {
- url = "https://o.euer.krebsco.de/s/AZn9QPLGFZeDfNq/download";
- sha256 = "1wa59rkgffql6hbiw9vv0zh35wx9x1cp4bnwicprbd0kdxj75miz";
- };
-
-in
-{
- systemd.services.kalauerbot = {
- description = "Kalauerbot";
- after = [ "network-online.target" ];
- wantedBy = [ "multi-user.target" ];
- environment = import <secrets/bureautomation/citadel.nix> // {
- "KALAUER_OOFDIR" = oofdir;
- };
- serviceConfig = {
- DynamicUser = true;
- StateDirectory = "kalauerbot";
- WorkingDirectory = "/var/lib/kalauerbot";
- ExecStart = "${pkgs.kalauerbot}/bin/kalauerbot";
- PrivateTmp = true;
-
- Restart = "always";
- RuntimeMaxSec = "12h";
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/led-fader.nix b/makefu/2configs/bureautomation/led-fader.nix
deleted file mode 100644
index d7f728534..000000000
--- a/makefu/2configs/bureautomation/led-fader.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ config, lib, pkgs, buildPythonPackage, ... }:
-
-let
- mq = "192.168.8.11";
- pkg = pkgs.ampel;
-in {
- systemd.services.led-fader = {
- description = "Send led change to message queue";
- environment = {
- NIX_PATH = "/var/src";
- };
- after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service");
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- # User = "nobody"; # need a user with permissions to run nix-shell
- ExecStartPre = pkgs.writeDash "sleep.sh" "sleep 2";
- ExecStart = "${pkg}/bin/ampel";
- Restart = "always";
- RestartSec = 10;
- PrivateTmp = true;
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/lib/scripts.nix b/makefu/2configs/bureautomation/lib/scripts.nix
deleted file mode 100644
index d8665f94f..000000000
--- a/makefu/2configs/bureautomation/lib/scripts.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ lib, ... }:
-{
- multi_flash = { entity, delays ? [ 500 ], alias ? "${entity}_multi_flash_${toString (lib.length delays)}" }:
- {
- inherit alias;
- sequence = lib.flatten (builtins.map (delay: [
- { service = "homeassistant.turn_on";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- { service = "homeassistant.turn_off";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- ]
- ) delays);
- };
-}
diff --git a/makefu/2configs/bureautomation/light/buzzer.nix b/makefu/2configs/bureautomation/light/buzzer.nix
deleted file mode 100644
index 4851dbd9b..000000000
--- a/makefu/2configs/bureautomation/light/buzzer.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-let
- tasmota_pwm = name: topic: pwmid: max:
- let
- id = "PWM${toString pwmid}";
- in { platform = "mqtt";
- inherit name;
- state_topic = "/bam/${topic}/stat/RESULT";
- state_value_template = ''{%- if value_json["PWM"]["${id}"]| int > 0 -%} ${toString max} {%- else -%} 0 {%- endif -%}'';
-
- command_topic = "/bam/${topic}/cmnd/${id}";
- on_command_type = "brightness";
- brightness_command_topic = "/bam/${topic}/cmnd/${id}";
- brightness_value_template = ''{{value_json["PWM"]["${id}"]}}'';
- brightness_scale = max;
- payload_on = "${toString max}";
- payload_off = "0";
- availability_topic = "/bam/${topic}/tele/LWT";
- payload_available= "Online";
- payload_not_available= "Offline";
- retain = true;
- optimistic = false;
- qos = 0;
- };
-in {
- services.home-assistant.config.light =
- [
- # (tasmota_pwm "RedButton LED" "redbutton" 1 1023) #LED PWM1
- # (tasmota_pwm "RedButton Buzzer" "redbutton" 2 512) #buzzer PWM2
- ];
-}
diff --git a/makefu/2configs/bureautomation/light/statuslight.nix b/makefu/2configs/bureautomation/light/statuslight.nix
deleted file mode 100644
index de65a2379..000000000
--- a/makefu/2configs/bureautomation/light/statuslight.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-let
- tasmota_rgb = name: topic:
-# LED WS2812b
-# effect_state_topic: "stat/led/Scheme"
-# effect_command_topic: "cmnd/led/Scheme"
-# effect_value_template: "{{ value_json.Scheme }}"
- { platform = "mqtt";
- inherit name;
- retain = false;
- qos = 1;
- #optimistic = true;
- # state
- command_topic = "/bam/${topic}/cmnd/POWER";
- state_topic = "/bam/${topic}/tele/STATE";
- value_template = "{{ value_json.POWER }}";
- availability_topic = "/bam/${topic}/tele/LWT";
- payload_on = "ON";
- payload_off = "OFF";
- payload_available= "Online";
- payload_not_available= "Offline";
- # brightness
- brightness_state_topic = "/bam/${topic}/tele/STATE";
- brightness_value_template = "{{value_json.Dimmer|default(100)}}";
- brightness_command_topic = "/bam/${topic}/cmnd/Dimmer";
- brightness_scale = 100;
- # color
- rgb_state_topic = "/bam/${topic}/stat/RESULT";
- rgb_command_topic = "/bam/${topic}/cmnd/Color2";
- rgb_value_template = "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}";
-
- # effects
- effect_state_topic = "/bam/${topic}/tele/STATE";
- effect_value_template = "{{value_json.Scheme|default(0)}}";
- effect_command_topic = "/bam/${topic}/cmnd/Scheme";
- effect_list = [
- 0 # single color for LED light
- 1 # start wake up sequence (same as Wakeup)
- 2 # cycle up through colors using Speed option
- 3 # cycle down through colors using Speed option
- 4 # random cycle through colors using Speed and Fade
- 5 # clock mode (example)
- 6 # candlelight pattern
- 7 # RGB pattern
- 8 # Christmas pattern
- 9 # Hannukah pattern
- 10 # Kwanzaa pattern
- 11 # rainbow pattern
- 12 # fire pattern
- ];
- };
-in {
- services.home-assistant.config.light =
- [
- (tasmota_rgb "Status Felix" "status1")
- (tasmota_rgb "Status Daniel" "status2")
- (tasmota_rgb "Buslicht" "buslicht")
- ];
-}
diff --git a/makefu/2configs/bureautomation/mpd.nix b/makefu/2configs/bureautomation/mpd.nix
deleted file mode 100644
index 1f5acb357..000000000
--- a/makefu/2configs/bureautomation/mpd.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{lib,pkgs, ... }:
-
-{
- systemd.services."ympd-wbob" = {
- description = "mpd ";
- wantedBy = [ "multi-user.target" ];
- serviceConfig.ExecStart = "${pkgs.ympd}/bin/ympd --host localhost --port 6600 --webport 8866 --user nobody";
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/10h_timers.nix b/makefu/2configs/bureautomation/multi/10h_timers.nix
deleted file mode 100644
index 6edcde4b0..000000000
--- a/makefu/2configs/bureautomation/multi/10h_timers.nix
+++ /dev/null
@@ -1,210 +0,0 @@
-{lib, ... }:
-let
- persons = [ "frank" "daniel" "thorsten" "carsten" "ecki" "felix"
- "thierry" # tjeri
- "emeka"
- "tancrede"
- ];
- random_zu_lange = name: ''{{ [
- "Du musst jetzt endlich nach Hause gehen ${name}!",
- "${name} - 10 Stunden sind rum, bald schenkst du den Franzosen deine Lebenszeit",
- "Nur eine Minute über 10 Stunden kann zu einer Stunde Arbeit für Thorsten werden, ${name}.",
- "In 10 Minuten kommt dich der Security Mann holen, ${name}",
- "Das Sandmännchen ist schon vorbei, gleich fallen dir die Augen zu ${name}.",
- "Wenn ${name} sofort los geht, dann ist er noch rechtzeitig für den Tatort zu Hause.",
- "${name} muss jetzt gehen, sonst verpasst er die Tagesschau!",
- "Es ist spät ${name}. Ausstempeln hilft zwar kurzfristig, kann aber zu langfristigen Problemen führen.",
- "${name}, wenn du nach zehn Stunden nach Hause gehst, muss dir dein Vorgesetzter ein Taxi bestellen",
- "${name}, wenn du nach zehn Stunden nach Hause gehst, bist du auf dem Rückweg nicht mehr versichert!",
- "Zu lange, ${name}!" ] | random }}'' ;
-
-
- random_announce = name: ''{{ [
- "${name} is in da House",
- "Ahoi ${name}",
- "Hallöchen Popöchen ${name}",
- "Moinsen ${name}",
- "Moin Moin ${name}",
- "Palim, Palim ${name}",
- "Vorwärts Genosse ${name}",
- "Gemeinsame Grüße, Genosse ${name}",
- "Sozialistische Grüße, Genosse ${name}",
- "Konzentrierte Grüße, Genosse ${name}",
- "Ach, der ${name} ist auch wieder da...",
- "Nicht ${name} schon wieder",
- "Tri tra tralala, der ${name} ist wieder da.",
- "Na sieh mal einer an, ${name} hat es auch her geschafft",
- "Wer ist im Büro eingetroffen? ${name} ist es!",
- "Willkommen in deinem Lieblingsbüro, ${name}.",
- "Klopf, Klopf, wer ist da? ${name} ist da!",
- "Messer, Gabel, Schere, Licht sind für kleinen ${name} nicht.",
- "Ich kenne ein Geheimnis, ${name} ist angekommen",
- "Wir sind ${name}. Sie werden assimiliert werden",
- "Achtung, es erfolgt eine Durchsage. ${name} ist eingetroffen",
- "Die Scanner haben eine dem System bekannte Lebensform mit dem Namen ${name} detektiert",
- "Das Büro sieht dich, ${name}",
- "Das Büro riecht dich, ${name}",
- "Im Kalender von ${name} sind heute acht Meetings eingeplant, von denen zwei bereits verpasst wurden",
- "Das Postfach von ${name} beinhaltet einhundertachtundzwanzig ungelesene E-Mails.",
- "Nachricht von Serge: ${name}, bitte melden Sie sich Umgehend bei mir im Büro!",
- "Luftqualität hat sich durch das Eintreffen von ${name} um zweihundert Punkte verschlechtert, bitte alle Fenster öffnen.",
- "Die Tür geht auf, wer mag das sein? Schon schreitet hier der ${name} ein. Das Volk, es jubelt, Dirnen schmachten. Fürs Festmahl beginnt man schon zu schlachten. Er wird nur nach dem besten streben! Der ${name}, er soll lange leben!",
- "${name} arbeitet gern für seinen Konzern",
- "${name} ist nur froh im Großraumbüro",
- "Für ${name} ist die schönste Zeit ... die Arbeit",
- "Ein Fleißbienchen für ${name} zum rechtzeitigen Erscheinen im Büro",
- "${name} ist heute wohl doch nicht im Office Home",
- "${name} ist bereit für einen Tag voller Meetings",
- "Und es startet für ${name} wieder ein Tag im Paradies",
- "Lieber ${name}, Markus Keck hat dich bereits drei mal Versucht anzurufen!",
- "Trotz schwerer Männergrippe ist ${name} heute im Büro erschienen.",
- "${name} kennt keine Parteien mehr, ${name} kennt nur noch Arbeitsplätze",
- "${name}, Frage nicht, was dein Arbeitsplatz für dich tun kann. Frage, was du für deinen Arbeitsplatz tun kannst",
- "${name} läuft bis in den Jemen - für sein Unternehmen. ${name} schwimmt bis nach Birma - für seine Firma",
- "Der Cyberian ${name} ist gekommen um die Bahnwelt vor Cyber-Angriffen zu schützen",
- "Alles paletto im Ghetto, ${name}?",
- "Hach, ${name}, wenn du hier rein kommst fühlt es sich gleich wieder an wie Montag.",
- "Oh nein, nicht schon wieder ${name}",
- "Wer wohnt in der Ananas ganz tief im Meer? ${name} Schwammkopf!",
- "Arbeit ist Freizeit! Wachstum ist Fortschritt! Sicherheit ist Freiheit! Eine kleine Erinnerung für ${name}"] | random }}'' ;
- tmr_10h = name: {
- "${name}_10h" = {
- name = "${name} 10h Timer";
- duration = "10:00:00";
- };
- };
-
- zu_lange_user = name:
- { "zu_lange_${name}" = {
- alias = "Random Zu Lange ${name}";
-
- sequence = [
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_zu_lange name;
- language = "de";
- };
- }
- ];
- };
- };
- announce_user = name:
- { "announce_${name}" = {
- alias = "Random Announce ${name}";
- sequence = [
- { delay.seconds = 7; }
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 4; }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_announce name;
- language = "de";
- };
- }
- ];
- };
- };
- automation_10h = name: [
- { alias = "start ${name} 10h";
- trigger = {
- platform = "state";
- entity_id = [ "person.${name}"];
- from = "not_home";
- to = "home";
- };
- condition = {
- condition = "and";
- conditions = [
- { condition = "state";
- entity_id = "timer.${name}_10h";
- state = "idle";
- }
- { condition = "time";
- after = "06:00:00";
- before = "12:00:00";
- }
- ];
- };
- action = [
- { service = "timer.start";
- entity_id = [ "timer.${name}_10h" ] ;
- }
- { service = "homeassistant.turn_on";
- entity_id =
- [ "switch.fernseher"
- "script.blitz_10s"
- "script.announce_${name}"
- ];
- }
- ];
- }
-
- { alias = "pommes announce ${name}";
- trigger =
- { platform = "event";
- event_type = "timer.started";
- event_data.entity_id = "timer.${name}_10h";
- };
-
- condition =
- { condition = "state";
- entity_id = "binary_sensor.pommes";
- state = "on";
- };
-
- action =
- { service = "homeassistant.turn_on";
- entity_id = "script.blasen_10s" ;
- };
- }
-
- { alias = "Zu lange ${name}!";
- trigger =
- { platform = "event";
- event_type = "timer.finished";
- event_data.entity_id = "timer.${name}_10h";
- };
-
- condition =
- { condition = "state";
- entity_id = "person.${name}";
- state = "home";
- };
-
- action =
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.blitz_10s"
- "script.zu_lange_${name}"
- ];
- };
- }
- ];
-in
-{
- services.home-assistant.config = {
- timer =lib.fold lib.recursiveUpdate {}
- (map tmr_10h persons);
- automation = (lib.flatten (map automation_10h persons));
- script = lib.fold lib.recursiveUpdate {} (
- (map announce_user persons) ++
- (map zu_lange_user persons)
- );
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/aramark.nix b/makefu/2configs/bureautomation/multi/aramark.nix
deleted file mode 100644
index 45fadb082..000000000
--- a/makefu/2configs/bureautomation/multi/aramark.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ lib, ... }:
-let
- aramark = topic: name:
- { platform = "mqtt";
- inherit name;
- state_topic = "/aramark/thales-deutschland/${topic}";
- };
- aramark_menue = menue:
- [
- (aramark "${menue}/title" menue)
- (aramark "${menue}/description" "${menue} Text")
- ((aramark "${menue}/price" "${menue} Preis") // { unit_of_measurement = "€"; })
- ];
-in
- {
- services.home-assistant.config =
- {
- sensor = (aramark_menue "Menü 1")
- ++ (aramark_menue "Menü 2")
- ++ (aramark_menue "Mercato")
- ++ (aramark_menue "Aktion");
- binary_sensor =
- [
- ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; })
- ];
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/daily-standup.nix b/makefu/2configs/bureautomation/multi/daily-standup.nix
deleted file mode 100644
index 063def1ef..000000000
--- a/makefu/2configs/bureautomation/multi/daily-standup.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{lib, ... }:
-let
- random_daily_text = ''{{ [
- "Es ist so weit, es ist Standup Zeit!",
- "Zehn Uhr Fünfunddreissig ist genau die richtige Zeit für ein Standup!",
- "Hat jeder seine zum Standup seine Hausaufgaben gemacht. Bitte einmal aufstehen und den Zettel nach rechts geben",
- "Aufstehen zum Appell, es wird die Anwesenheit kontrolliert!",
- "Hallo Kinder, wisst ihr welche Zeit es ist ... Genau ... Standup Zeit!",
- "Morgens, halb elf in Deutschland - das Standupchen" ] | random }}'';
-
-in {
- services.home-assistant.config =
- {
- script =
- { "random_daily" = {
- alias = "Random Daily Introduction";
-
- sequence = [
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_daily_text;
- language = "de";
- };
- }
- ];
- };
- };
- automation = [
- {
- alias = "Daily Standup";
- trigger = {
- platform = "time";
- at = "10:35:00";
- };
- action =
- [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.blitz_10s"
- "script.random_daily"
- ];
- }
- ];
-
- }
- ];
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/frosch.nix b/makefu/2configs/bureautomation/multi/frosch.nix
deleted file mode 100644
index 61606d4eb..000000000
--- a/makefu/2configs/bureautomation/multi/frosch.nix
+++ /dev/null
@@ -1,103 +0,0 @@
-{lib, ... }:
-# needs: binary_sensor.pommes
-# notify.matrix_notify
-let
- random_pommes = '' {{ [
- "Nur ein Pommes Tag ist ein guter Tag",
- "Schaut wie schön sie fliegen, die Pommes Seifenblasen",
- "zwo ... eins ... Pommes Zeit",
- "I cannot believe it is not Pommes",
- "Naja, wenn es sonst schon nichts anderes gibt, kann man jetzt auch pommes nehmen",
- "Wenn Aramark was kann, dann ist es frittieren",
- "Einmal das Hauptgericht mit Pommes, ohne Hauptgericht",
- "Rieche ich da etwa Pommes? JA!",
- "Pommes ist auch nur Gemüse,also keine Reue und schlag zu!",
- "Mit nur fünf Portionen Pommes kann man schon satt werden.",
- "Heute für Sie, 15 Pommes von hand abgezählt",
- "Der Weltmarktpreis von Pommes ist durch verschiedene Weltkrisen leider so hoch, dass Aramark den Verkaufspreis verdoppeln musste.",
- "Vorfreude, schönste Freude, Freude bei Aramark. Pommes in die Schale rein, alle Kunden werden glücklich sein.",
- "In 15 Minuten ist es wieder so weit, es ist Pommes Zeit!"] | random }}'';
-in
-{
- services.home-assistant.config =
- {
- sensor = [
- { platform = "mqtt";
- name = "frosch brightness";
- device_class = "illuminance";
- state_topic = "/bam/frosch/sensor/brightness/state";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- binary_sensor = [
- { platform = "mqtt";
- name = "frosch auge";
- state_topic = "/bam/frosch/binary_sensor/froschauge/state";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- switch = [
- { platform = "mqtt";
- name = "frosch blasen";
- state_topic = "/bam/frosch/switch/blasen/state";
- command_topic = "/bam/frosch/switch/blasen/command";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- light = [];
- automation = [
- { alias = "Pommeszeit";
- trigger = {
- platform = "time";
- at = "11:00:00";
- };
- condition = {
- condition = "state";
- entity_id = "binary_sensor.pommes"; # from multi/aramark.nix
- state = "on";
- };
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.pommes_announce"
- "script.seifenblasen_30s" # from script/multi_blink.nix
- ];
- }
- ];
- }
- ];
- script = {
- pommes_announce = {
- alias = "Random Pommes announce";
- sequence = [
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- {
- service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_pommes;
- language = "de";
- };
- }
- { service = "notify.matrix_notify";
- data_template.message = random_pommes;
- }
- ];
- };
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/matrix.nix b/makefu/2configs/bureautomation/multi/matrix.nix
deleted file mode 100644
index b9b8fc4e8..000000000
--- a/makefu/2configs/bureautomation/multi/matrix.nix
+++ /dev/null
@@ -1,69 +0,0 @@
-{ lib, ... }:
-#matrix:
-# password: supersecurepassword
-# rooms:
-# - "#hasstest:matrix.org"
-# commands:
-# - word: my_command
-# name: my_command
-let
- mom_room = "!kTQjvTQvfVsvfEtmth:thales.citadel.team";
-in
-{
- services.home-assistant.config =
- {
- matrix =
- {
- # secrets:
- # homeserver, username, password
- homeserver = "https://ext01.citadel.team";
- rooms = [
- mom_room
- ];
- commands = [
- {
- # alternative: expression for regexp
- word = "version";
- name = "version";
- }
- {
- word = "luftqualität";
- name = "luftqualitaet";
- }
- ];
- } // (builtins.fromJSON (builtins.readFile
- <secrets/hass/citadel-bot.json>));
- automation = [
- {
- alias = "React to !version";
- trigger = {
- platform = "event";
- event_type = "matrix_command";
- event_data.command = "version";
- };
- action = {
- service = "notify.matrix_notify";
- data_template.message = "Running home-assistant {{states.sensor.current_version.state}}";
- };
- }
- {
- alias = "React to !luftqualität";
- trigger = {
- platform = "event";
- event_type = "matrix_command";
- event_data.command = "luftqualitaet";
- };
- action = {
- service = "notify.matrix_notify";
- data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}'';
- };
- }
-
- ];
- notify = [{
- name = "matrix_notify";
- platform = "matrix";
- default_room = mom_room;
- }];
- };
-}
diff --git a/makefu/2configs/bureautomation/multi/mittagessen.nix b/makefu/2configs/bureautomation/multi/mittagessen.nix
deleted file mode 100644
index 52ec99a92..000000000
--- a/makefu/2configs/bureautomation/multi/mittagessen.nix
+++ /dev/null
@@ -1,92 +0,0 @@
-{ lib, ... }:
-let
- # TODO: remove redundant code (from multi_blink) via lib
- flash_entity = { entity, delay ? 500, count ? 4, alias ? "${entity}_blink_${toString count}_${toString delay}" }:
- {
- inherit alias;
- sequence = lib.flatten (builtins.genList (i: [
- { service = "homeassistant.turn_on";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- { service = "homeassistant.turn_off";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- ]
- ) count);
- };
- # TODO: use influxdb and check if pommes
- random_mittagessen = '' {{ [
- "Es ist 12 uhr 30. Der Aramark Gourmettempel hat, wie jeden Tag, wieder die feinsten Köstlichkeiten für euch Vorbereitet",
- "Heute bei Aramark: Rezepte aus Ländern, von denen Ihr noch nie gehört habt, Deutsch zubereitet",
- "Heute bei Aramark im Angebot: Scheiss mit Reis oder Reste von Freitag",
- "MHHHH es ist wieder mal so weit, lecker Bayerisch Kraut mit asiatischen Nudeln",
- "Es ist 12 Uhr 30 und Heute gibt es nur Pommes, wenn der Pommesfrosch Blasen gespuckt hat.",
- "Heute gibt es Pommes leider nicht einzeln zu verkaufen, da die Schälchen alle sind",
- "Heute gibt es Pommes, verarscht! Natürlich gibt es nur salzlosen Reis, oder salzlose Nudeln.",
- "Heute auf dem Speiseplan: Sushi vom Vortag",
- "Aramark Kantinenessen: Der Hunger treibt es rein, der Geiz hält es drin.",
- "Das Essen in der Snackeria sieht heute wie die bessere Alternative aus",
- "Heute ist wohl wieder ein Beilagen-Tag",
- "Lunch time! Good luck, you will need it!",
- "Heute vielleicht lieber doch nur einen Salat?",
- "Im Büro ist es eh gerade viel zu warm, also ab zur Kantine",
- "Im Büro ist es eh gerade viel zu kalt, also ab zur Kantine",
- "Heute scheint die Auswahl wieder sehr schwierig zu sein. Vielleicht doch lieber ein Brötchen mit Fleischkäse vom Bäcker beim Baumarkt?",
- "Wer hat hier schon wieder ein Meeting auf 12 Uhr gelegt? Skandal!",
- "Jetzt nur noch kurz die Mail fertig schreiben und schon kann es los gehen.",
- "Es ist 13 Uhr und die Mittagspause ist bald vorbei .... Kleiner Scherz, es ist erst 12:30, aber Ihr hättet auch nicht wirklich etwas verpasst.",
- "Hallo, es ist nun 12 Uhr 30! Dies entspricht der Essenszeit aller Büroinsassen. Bitte begebt euch zur Aramark Essensausgabe um euren menschlichen Bedürfnissen nachzukommen."] | random }}'';
-in
-{
- services.home-assistant.config = {
- automation = [
- { alias = "Mittagessen";
- trigger = {
- platform = "time";
- at = "12:30:00";
- };
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.mittagessen_announce"
- "script.blitz_10s"
- "script.mittagessenlicht"
- ];
- }
- ];
- }
- ];
- script = {
- mittagessenlicht = (flash_entity {
- entity = "switch.bauarbeiterlampe";
- alias = "Bauarbeiterlampe Mittagessenlicht";
- delay = 1000;
- count = 5;
- });
- mittagessen_announce = {
- alias = "Random Mittagessen announce";
- sequence = [
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- {
- service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_mittagessen;
- language = "de";
- };
- }
- ];
- };
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/office-radio/default.nix b/makefu/2configs/bureautomation/office-radio/default.nix
deleted file mode 100644
index d1c0f4730..000000000
--- a/makefu/2configs/bureautomation/office-radio/default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- imports = [
- ./mpd.nix
- ./webserver.nix
- ];
-}
diff --git a/makefu/2configs/bureautomation/office-radio/mpd.nix b/makefu/2configs/bureautomation/office-radio/mpd.nix
deleted file mode 100644
index 4fc31fff9..000000000
--- a/makefu/2configs/bureautomation/office-radio/mpd.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-let
- mpds = import ./mpdconfig.nix;
- systemd_mpd = name: value: let
- path = "/var/lib/mpd-${name}";
- num = lib.strings.fixedWidthNumber 2 value;
- mpdconf = pkgs.writeText "mpd-config-${name}" ''
- music_directory "${path}/music"
- playlist_directory "${path}/playlists"
- db_file "${path}/tag_cache"
- state_file "${path}/state"
- sticker_file "${path}/sticker.sql"
-
- bind_to_address "127.0.0.1"
- port "66${num}"
- log_level "default"
- auto_update "yes"
- audio_output {
- type "httpd"
- name "Office Radio ${num} - ${name}"
- encoder "vorbis" # optional
- port "280${num}"
- quality "5.0" # do not define if bitrate is defined
- # bitrate "128" # do not define if quality is defined
- format "44100:16:2"
- always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped.
- tags "yes" # httpd supports sending tags to listening streams.
- }
- '';
-in {
- after = [ "network.target" ];
- description = "Office Radio MPD ${toString value} - ${name}";
- wantedBy = ["multi-user.target"];
- serviceConfig = {
- #User = "mpd";
- DynamicUser = true;
- ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdconf}";
- LimitRTPRIO = 50;
- LimitRTTIME = "infinity";
- ProtectSystem = true;
- NoNewPrivileges = true;
- ProtectKernelTunables = true;
- ProtectControlGroups = true;
- ProtectKernelModules = true;
- RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX AF_NETLINK";
- RestrictNamespaces = true;
- Restart = "always";
- StateDirectory = [ "mpd-${name}" ];
- };
- };
-in
- {
- systemd.services = lib.attrsets.mapAttrs' (name: value:
- lib.attrsets.nameValuePair
- ("office-radio-" +name) (systemd_mpd name value))
- mpds;
- }
diff --git a/makefu/2configs/bureautomation/office-radio/mpdconfig.nix b/makefu/2configs/bureautomation/office-radio/mpdconfig.nix
deleted file mode 100644
index b48ceb629..000000000
--- a/makefu/2configs/bureautomation/office-radio/mpdconfig.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "cybertisch1" = 0;
- "cybertisch2" = 1;
- "cyberklo" = 2;
- "baellebad" = 3;
-}
diff --git a/makefu/2configs/bureautomation/office-radio/webserver.nix b/makefu/2configs/bureautomation/office-radio/webserver.nix
deleted file mode 100644
index e2fc6d9e8..000000000
--- a/makefu/2configs/bureautomation/office-radio/webserver.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ pkgs, ... }:
-let
- mpds = import ./mpdconfig.nix;
- pkg = pkgs.office-radio;
-in {
- systemd.services.office-radio-appsrv = {
- after = [ "network.target" ];
- description = "Office Radio Appserver";
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- ExecStart = "${pkg}/bin/office-radio";
- DynamicUser = true;
- ProtectSystem = true;
- NoNewPrivileges = true;
- ProtectKernelTunables = true;
- ProtectControlGroups = true;
- ProtectKernelModules = true;
- RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX AF_NETLINK";
- RestrictNamespaces = true;
- Restart = "always";
- };
- };
- systemd.services.office-radio-stopper = {
- after = [ "network.target" ];
- description = "Office Radio Script to stop idle streams";
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- ExecStart = "${pkg}/bin/stop-idle-streams";
- DynamicUser = true;
- ProtectSystem = true;
- NoNewPrivileges = true;
- ProtectKernelTunables = true;
- ProtectControlGroups = true;
- ProtectKernelModules = true;
- RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX AF_NETLINK";
- RestrictNamespaces = true;
- Restart = "always";
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/ota.nix b/makefu/2configs/bureautomation/ota.nix
deleted file mode 100644
index f2f931d21..000000000
--- a/makefu/2configs/bureautomation/ota.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- # mosquitto_pub -t /bam/sonoffs/cmnd/OtaUrl -m "http://192.168.8.11/sonoff.bin"
- # mosquitto_pub -t /bam/sonoffs/cmnd/upgrade -m "6.5.0"
- # wget https://github.com/arendst/Sonoff-Tasmota/releases/download/v6.5.0/sonoff.bin
- # wget https://github.com/arendst/Sonoff-Tasmota/releases/download/v6.5.0/sonoff-minimal.bin
- services.nginx = {
- enable = true;
- virtualHosts."192.168.8.11" = {
- root = "/var/www/tasmota";
- extraConfig = ''
- autoindex on;
- '';
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/person/team.nix b/makefu/2configs/bureautomation/person/team.nix
deleted file mode 100644
index d0d13dd98..000000000
--- a/makefu/2configs/bureautomation/person/team.nix
+++ /dev/null
@@ -1,87 +0,0 @@
-{config, ... }:
-{
- # all configured persons become part of group "team"
- services.home-assistant.config.group.team = {
- name = "team";
- entities = map (x: "person.${x.name}" ) config.services.home-assistant.config.person;
- };
- services.home-assistant.config.person =
- [
- { name = "Thorsten";
- id = 1;
- device_trackers = [
- "device_tracker.thorsten_phone"
- #"device_tracker.thorsten_arbeitphone"
- ];
- }
- { name = "Felix";
- id = 2;
- device_trackers = [
- "device_tracker.felix_phone"
- "device_tracker.felix_laptop"
- ];
- }
- { name = "Ecki";
- id = 3;
- device_trackers = [
- "device_tracker.ecki_phone"
- "device_tracker.ecki_tablet"
- ];
- }
- { name = "Daniel";
- id = 4;
- device_trackers = [
- "device_tracker.daniel_phone"
- ];
- }
- { name = "Thierry";
- id = 5;
- device_trackers = [
- "device_tracker.thierry_phone"
- ];
- }
- { name = "Frank";
- id = 6;
- device_trackers = [
- "device_tracker.frank_phone"
- ];
- }
- #{ name = "Carsten";
- # id = 7;
- # device_trackers = [
- # "device_tracker.carsten_phone"
- # ];
- #}
- { name = "Emeka";
- id = 8;
- device_trackers = [
- "device_tracker.emeka_phone"
- ];
- }
- { name = "Sabine";
- id = 9;
- device_trackers = [
- "device_tracker.sabine_phone"
- ];
- }
- #{ name = "Tobias";
- # id = 10;
- # device_trackers = [
- # "device_tracker.tobias_phone"
- # ];
- #}
- #{ name = "Tancrede";
- # id = 11;
- # device_trackers = [
- # "device_tracker.tancrede_phone"
- # "device_tracker.tancrede_laptop"
- # ];
- #}
- { name = "Chris";
- id = 12;
- device_trackers = [
- "device_tracker.chris_phone"
- ];
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/printer.nix b/makefu/2configs/bureautomation/printer.nix
deleted file mode 100644
index 86d5a4069..000000000
--- a/makefu/2configs/bureautomation/printer.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ pkgs, config, ... }:
-let
- mainUser = config.krebs.build.user.name;
-in {
- imports = [
- ./brother-ql-web.nix
- ];
- services.printing = {
- enable = true;
- drivers = with pkgs;[
- brlaser
- cups-ptouch
- ];
- };
- users.users.kiosk.extraGroups = [ "scanner" "lp" ];
- state = [ "/var/lib/cups"];
- users.users.kiosk.packages = with pkgs;[
- python3Packages.brother-ql
- libreoffice
- qrencode
- imagemagick
- ];
-
- services.udev.extraRules = ''
- SUBSYSTEMS=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="209b", ATTRS{serial}=="000F1Z401759", MODE="0664", GROUP="lp", SYMLINK+="usb/lp0"
- '';
-
-}
diff --git a/makefu/2configs/bureautomation/puppy-proxy.nix b/makefu/2configs/bureautomation/puppy-proxy.nix
deleted file mode 100644
index 9e3542509..000000000
--- a/makefu/2configs/bureautomation/puppy-proxy.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ pkgs, ... }:
-# streamlink 'https://www.ustream.tv/channel/maximilian-schnauzers-cam4' worst --player-external-http --player-external-http-port 15321 --player-passthrough rtsp --retry-streams 60
-{
- environment.systemPackages = [ pkgs.liveproxy ];
-}
diff --git a/makefu/2configs/bureautomation/rhasspy.nix b/makefu/2configs/bureautomation/rhasspy.nix
deleted file mode 100644
index 8fbfd9312..000000000
--- a/makefu/2configs/bureautomation/rhasspy.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ config, ... }:
-let
- profiles = "/var/lib/rhasspy";
- kiosk_id = toString config.users.users.kiosk.uid;
-in
-{
- virtualisation.oci-containers.containers.rhasspy = {
- image = "rhasspy/rhasspy:latest";
-
- environment = {
- TZ = "Europe/Berlin";
- #PULSE_SERVER = "unix:/run/user/0/pulse/native";
- PULSE_SERVER = "tcp:${ config.krebs.build.host.name }:4713";
-
- };
-
- ports = [
- "12101:12101"
- # "12183:12183"
- ];
- #user = kiosk_id;
-
- volumes = [
- "/etc/localtime:/etc/localtime:ro"
- "${profiles}:/profiles"
- # TODO pulseaudio
- #"/run/user/${kiosk_id}/pulse/native:/run/user/0/pulse/native"
- #"${config.users.users.kiosk.home}/.config/pulse/cookie:/root/.config/pulse/cookie:ro"
- ];
-
- cmd = [ "--user-profiles" "/profiles" "--profile" "de" ];
- extraOptions = [
- "--device=/dev/snd:/dev/snd" "--group-add=audio"
- "--net=host"
- ];
- };
- systemd.tmpfiles.rules = [
- "d ${profiles} 0770 root root - -"
- ];
- systemd.services.docker-rhasspy.after = [ "desktop-manager.service" ];
-}
diff --git a/makefu/2configs/bureautomation/script/multi_blink.nix b/makefu/2configs/bureautomation/script/multi_blink.nix
deleted file mode 100644
index 753918f31..000000000
--- a/makefu/2configs/bureautomation/script/multi_blink.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{lib, ... }:
-let
- # TODO: flash with different delay
-
- # let an entity blink for X times with a delay of Y milliseconds
- flash_entity = { entity, delay ? 500, count ? 4, alias ? "${entity}_blink_${toString count}_${toString delay}" }:
- {
- inherit alias;
- sequence = lib.flatten (builtins.genList (i: [
- { service = "homeassistant.turn_on";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- { service = "homeassistant.turn_off";
- data.entity_id = entity;
- }
- { delay.milliseconds = delay; }
- ]
- ) count);
- };
-in {
- services.home-assistant.config.script =
- {
- buzz_red_led = (flash_entity {
- entity = "light.redbutton_buzzer";
- alias = "Red Button Buzz";
- count = 4;
- });
- buzz_red_led_fast = (flash_entity {
- entity = "light.redbutton_buzzer";
- delay = 250;
- count = 2;
- alias = "Red Button Buzz fast";
- });
- blitz_10s = (flash_entity {
- entity = "switch.blitzdings";
- delay = 10000;
- count = 1;
- alias = "blitz for 10 seconds";
- });
- blasen_10s = (flash_entity {
- entity = "switch.frosch_blasen";
- delay = 10000;
- count = 1;
- alias = "blasen for 10 seconds";
- });
- blasen_30s = (flash_entity {
- entity = "switch.frosch_blasen";
- delay = 30000;
- count = 1;
- alias = "blasen for 30 seconds";
- });
- schlechteluft = (flash_entity {
- entity = "switch.bauarbeiterlampe";
- alias = "Schlechte Luft Lampe 5 secs";
- delay = 5000;
- count = 1;
- });
- };
-}
diff --git a/makefu/2configs/bureautomation/sensor/airquality.nix b/makefu/2configs/bureautomation/sensor/airquality.nix
deleted file mode 100644
index 7d95c3c15..000000000
--- a/makefu/2configs/bureautomation/sensor/airquality.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- services.home-assistant.config.sensor =
- [
- # coming from 2configs/stats/telegraf/
- { platform = "mqtt";
- name = "Air Quality";
- state_topic = "/telegraf/wbob/airquality";
- value_template = "{{ value_json.fields.value }}";
- unit_of_measurement = "VOC";
- }
- ];
-}
diff --git a/makefu/2configs/bureautomation/sensor/espeasy.nix b/makefu/2configs/bureautomation/sensor/espeasy.nix
deleted file mode 100644
index c68f39f1a..000000000
--- a/makefu/2configs/bureautomation/sensor/espeasy.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-let
- espeasy_dht22 = name: [
- { platform = "mqtt";
- name = "${name} DHT22 Temperature";
- device_class = "temperature";
- state_topic = "/bam/${name}/dht22/Temperature";
- availability_topic = "/bam/${name}/tele/LWT";
- payload_available = "Online";
- payload_not_available = "Offline";
- }
- { platform = "mqtt";
- device_class = "humidity";
- name = "${name} DHT22 Humidity";
- state_topic = "/bam/${name}/dht22/Humidity";
- availability_topic = "/bam/${name}/tele/LWT";
- payload_available = "Online";
- payload_not_available = "Offline";
- }];
- espeasy_ds18 = name:
- { platform = "mqtt";
- name = "${name} DS18 Temperature";
- state_topic = "/bam/${name}/ds18/Temperature";
- availability_topic = "/bam/${name}/tele/LWT";
- payload_available = "Online";
- payload_not_available = "Offline";
- };
-in {
- services.home-assistant.config.sensor =
- (espeasy_dht22 "easy1") ++
- (espeasy_dht22 "easy2") ++ [
- (espeasy_ds18 "easy3" )
- ];
-}
diff --git a/makefu/2configs/bureautomation/sensor/outside.nix b/makefu/2configs/bureautomation/sensor/outside.nix
deleted file mode 100644
index e7b4d9a7c..000000000
--- a/makefu/2configs/bureautomation/sensor/outside.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{lib,...}:
-{
- services.home-assistant.config.sensor =
- [
- { platform = "darksky";
- api_key = lib.removeSuffix "\n"
- (builtins.readFile <secrets/hass/darksky.apikey>);
- language = "de";
- monitored_conditions = [
- "summary" "icon"
- "nearest_storm_distance" "precip_probability"
- "precip_intensity"
- "temperature" # "temperature_high" "temperature_low"
- "apparent_temperature"
- "hourly_summary" # next 24 hours text
- "humidity"
- "pressure"
- "uv_index"
- ];
- units = "si" ;
- scan_interval = "00:30:00";
- }
- ];
- services.home-assistant.config.luftdaten = {
- sensor_id = "26237";
- show_on_map = true;
- sensors.monitored_conditions = [
- "P1"
- "P2"
- ];
- };
-}
diff --git a/makefu/2configs/bureautomation/sensor/pollen.nix b/makefu/2configs/bureautomation/sensor/pollen.nix
deleted file mode 100644
index 8ddb49e58..000000000
--- a/makefu/2configs/bureautomation/sensor/pollen.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-[ {
- platform = "dwd_pollen";
- partregion_ids = [
- 112
- ];
-}
-]
diff --git a/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix b/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix
deleted file mode 100644
index f5f063dbf..000000000
--- a/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-let
- tasmota_firmware = topic:
- { platform = "mqtt";
- name = "${topic} Firmware";
- state_topic = "/bam/${topic}/stat/STATUS2";
- availability_topic = "/bam/${topic}/tele/LWT";
- value_template = "v{{value_json.StatusFWR.Version}}";
- payload_available= "Online";
- payload_not_available= "Offline";
- };
-in
-{
- services.home-assistant.config.sensor =
- map tasmota_firmware [
- "plug" "plug2" "plug3" "plug4" "plug5"
- "status1" "status2" "buslicht"
- "rfbridge"
- ];
-}
diff --git a/makefu/2configs/bureautomation/stream/puppies.nix b/makefu/2configs/bureautomation/stream/puppies.nix
deleted file mode 100644
index d22be9ea6..000000000
--- a/makefu/2configs/bureautomation/stream/puppies.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-[
- { stream_source = "http://127.0.0.1:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy51c3RyZWFtLnR2L2NoYW5uZWwvbWF4aW1pbGlhbi1zY2huYXV6ZXJzLWNhbTIgd29yc3Q=/";
- }
-]
diff --git a/makefu/2configs/bureautomation/switch/rfbridge.nix b/makefu/2configs/bureautomation/switch/rfbridge.nix
deleted file mode 100644
index 9b9de7793..000000000
--- a/makefu/2configs/bureautomation/switch/rfbridge.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-let
- topic = "rfbridge";
- bridge = name: payload_on: payload_off:
- { platform = "mqtt";
- inherit name payload_on payload_off;
- command_topic = "/bam/${topic}/cmnd/rfcode";
- availability_topic = "/bam/${topic}/tele/LWT";
- payload_available= "Online";
- payload_not_available= "Offline";
- };
-in {
- services.home-assistant.config.switch =
- [
- (bridge "Nachtlicht A" "#414551" "#414554")
- (bridge "Nachtlicht B" "#415151" "#415154")
- (bridge "Nachtlicht C" "#415451" "#415454")
- (bridge "Nachtlicht D" "#41551F" "#415514")
- ];
-}
diff --git a/makefu/2configs/bureautomation/switch/tasmota_switch.nix b/makefu/2configs/bureautomation/switch/tasmota_switch.nix
deleted file mode 100644
index 6c5f6b8a6..000000000
--- a/makefu/2configs/bureautomation/switch/tasmota_switch.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-let
- tasmota_plug = name: topic:
- { platform = "mqtt";
- inherit name;
- state_topic = "/bam/${topic}/tele/STATE";
- value_template = "{{ value_json.POWER }}";
- command_topic = "/bam/${topic}/cmnd/POWER";
- availability_topic = "/bam/${topic}/tele/LWT";
- payload_on= "ON";
- payload_off= "OFF";
- payload_available= "Online";
- payload_not_available= "Offline";
- retain = false;
- qos = 1;
- };
-in {
- services.home-assistant.config.switch =
- [
- (tasmota_plug "Bauarbeiterlampe" "plug")
- (tasmota_plug "Blitzdings" "plug2")
- (tasmota_plug "Fernseher" "plug3")
- (tasmota_plug "Feuer" "plug4")
- (tasmota_plug "Blaulicht" "plug5")
- ];
-}
diff --git a/makefu/2configs/bureautomation/visitor-photostore.nix b/makefu/2configs/bureautomation/visitor-photostore.nix
deleted file mode 100644
index 762226549..000000000
--- a/makefu/2configs/bureautomation/visitor-photostore.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ config, lib, pkgs, ... }:
-# more than just nginx config but not enough to become a module
-let
- wsgi-sock = "${workdir}/uwsgi-photostore.sock";
- workdir = config.services.uwsgi.runDir;
- wifi-itf = "wlp2s0";
- wifi-ip = "172.16.9.96";
-in {
-
- services.uwsgi = {
- enable = true;
- user = "nginx";
- runDir = "/var/lib/photostore";
- plugins = [ "python3" ];
- instance = {
- type = "emperor";
- vassals = {
- cameraupload-server = {
- type = "normal";
- pythonPackages = self: with self; [ pkgs.cameraupload-server ];
- socket = wsgi-sock;
- };
- };
- };
- };
-
- services.nginx = {
- enable = lib.mkDefault true;
- virtualHosts.${wifi-ip} = {
- locations = {
- "/".extraConfig = ''
- expires -1;
- uwsgi_pass unix://${wsgi-sock};
- uwsgi_param UWSGI_CHDIR ${workdir};
- uwsgi_param UWSGI_MODULE cuserver.main;
- uwsgi_param UWSGI_CALLABLE app;
- include ${pkgs.nginx}/conf/uwsgi_params;
- '';
- };
- };
- };
-
- networking.firewall.allowedTCPPorts = [ 80 ];
-# networking.interfaces.${wifi-itf}.ipv4.addresses = [{
-# address = wifi-ip;
-# prefixLength = 24;
-# }];
-
- networking.wireless = {
- enable = true;
- interfaces = [ wifi-itf ];
- networks.Mobility = {
- priority = -999;
- psk = null;
- };
- };
-}
diff --git a/makefu/2configs/bureautomation/zigbee2mqtt/default.nix b/makefu/2configs/bureautomation/zigbee2mqtt/default.nix
deleted file mode 100644
index 9bf587d56..000000000
--- a/makefu/2configs/bureautomation/zigbee2mqtt/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{config, pkgs, lib, ...}:
-
-let
- dataDir = "/var/lib/zigbee2mqtt";
-in
- {
- # symlink the zigbee controller
-
- services.zigbee2mqtt = {
- enable = true;
- inherit dataDir;
- settings = {
- permit_join = true;
- serial.port = "/dev/zigbee";
- homeassistant = true;
- frontend.port = 8521;
- };
- };
-
- state = [ "${dataDir}/devices.yaml" "${dataDir}/state.json" ];
-
- systemd.services.zigbee2mqtt = {
- # override automatic configuration.yaml deployment
- environment.ZIGBEE2MQTT_DATA = dataDir;
- after = [
- "home-assistant.service"
- "mosquitto.service"
- "network-online.target"
- ];
- };
-}
diff --git a/makefu/2configs/bureautomation/zigbee2mqtt/hass.nix b/makefu/2configs/bureautomation/zigbee2mqtt/hass.nix
deleted file mode 100644
index faf864ba6..000000000
--- a/makefu/2configs/bureautomation/zigbee2mqtt/hass.nix
+++ /dev/null
@@ -1,130 +0,0 @@
-# provides:
-# switch
-# automation
-# binary_sensor
-# sensor
-# input_select
-# timer
-let
- inherit (import ../lib) zigbee;
- prefix = zigbee.prefix;
-in
-{
- services.home-assistant.config = {
- sensor =
-
- [
- # Sensor for monitoring the bridge state
- {
- platform = "mqtt";
- name = "Zigbee2mqtt Bridge state";
- state_topic = "${prefix}/bridge/state";
- icon = "mdi:router-wireless";
- }
- # Sensor for Showing the Zigbee2mqtt Version
- {
- platform = "mqtt";
- name = "Zigbee2mqtt Version";
- state_topic = "${prefix}/bridge/config";
- value_template = "{{ value_json.version }}";
- icon = "mdi:zigbee";
- }
- # Sensor for Showing the Coordinator Version
- {
- platform = "mqtt";
- name = "Coordinator Version";
- state_topic = "${prefix}/bridge/config";
- value_template = "{{ value_json.coordinator }}";
- icon = "mdi:chip";
- }
- ];
- switch = [
- {
- platform = "mqtt";
- name = "Zigbee2mqtt Main join";
- state_topic = "${prefix}/bridge/config/permit_join";
- command_topic = "${prefix}/bridge/config/permit_join";
- payload_on = "true";
- payload_off = "false";
- }
- ];
- automation = [
- {
- alias = "Zigbee2mqtt Log Level";
- initial_state = "on";
- trigger = {
- platform = "state";
- entity_id = "input_select.zigbee2mqtt_log_level";
- };
- action = [
- {
- service = "mqtt.publish";
- data = {
- payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}";
- topic = "${prefix}/bridge/config/log_level";
- };
- }
- ];
- }
- # Automation to start timer when enable join is turned on
- {
- id = "zigbee_join_enabled";
- alias = "Zigbee Join Enabled";
- trigger =
- {
- platform = "state";
- entity_id = "switch.zigbee2mqtt_main_join";
- to = "on";
- };
- action =
- {
- service = "timer.start";
- entity_id = "timer.zigbee_permit_join";
- };
- }
- # # Automation to stop timer when switch turned off and turn off switch when timer finished
- {
- id = "zigbee_join_disabled";
- alias = "Zigbee Join Disabled";
- trigger = [
- {
- platform = "event";
- event_type = "timer.finished";
- event_data.entity_id = "timer.zigbee_permit_join";
- }
- {
- platform = "state";
- entity_id = "switch.zigbee2mqtt_main_join";
- to = "off";
- }
- ];
- action = [
- { service = "timer.cancel";
- data.entity_id = "timer.zigbee_permit_join";
- }
- { service = "switch.turn_off";
- entity_id = "switch.zigbee2mqtt_main_join";
- }
- ];
- }
- ];
- input_select.zigbee2mqtt_log_level =
- {
- name = "Zigbee2mqtt Log Level";
- options = [
- "debug"
- "info"
- "warn"
- "error"
- ];
- initial = "info";
- icon = "mdi:format-list-bulleted";
- };
-
- timer.zigbee_permit_join =
- {
- name = "Zigbee Time remaining";
- duration = 120;
- };
- };
-}
[cgit] Unable to lock slot /tmp/cgit/1e000000.lock: No such file or directory (2)