ctucx.git: nixfiles

ctucx' nixfiles

commit 021fb5b4f4bb6ec3b843775ea9214faa96f2aacc
parent 8e724490117062e95eb630da326be94db0cbdb9c
Author: Leah (ctucx) <git@ctu.cx>
Date: Fri, 12 May 2023 15:57:48 +0200

machines/lollo/smarthome -> machines/briefkasten/smarthome
39 files changed, 479 insertions(+), 429 deletions(-)
M
machines/briefkasten/configuration.nix
|
2
++
R
machines/lollo/smarthome/default.nix -> machines/briefkasten/smarthome/default.nix
|
0
R
machines/lollo/smarthome/departures2mqtt.nix -> machines/briefkasten/smarthome/departures2mqtt.nix
|
0
R
machines/lollo/smarthome/homebridge.nix -> machines/briefkasten/smarthome/homebridge.nix
|
0
A
machines/briefkasten/smarthome/influxdb2.nix
|
127
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R
machines/lollo/smarthome/mbusd.nix -> machines/briefkasten/smarthome/mbusd.nix
|
0
A
machines/briefkasten/smarthome/mosquitto.nix
|
54
++++++++++++++++++++++++++++++++++++++++++++++++++++++
R
machines/lollo/smarthome/mqtt-webui/config.nix -> machines/briefkasten/smarthome/mqtt-webui/config.nix
|
0
R
machines/lollo/smarthome/mqtt-webui/default.nix -> machines/briefkasten/smarthome/mqtt-webui/default.nix
|
0
R
machines/lollo/smarthome/mqtt-webui/extra-css/extra.css -> machines/briefkasten/smarthome/mqtt-webui/extra-css/extra.css
|
0
R
machines/lollo/smarthome/mqtt-webui/extra-css/manifest.json -> machines/briefkasten/smarthome/mqtt-webui/extra-css/manifest.json
|
0
R
machines/lollo/smarthome/sdm2mqtt.nix -> machines/briefkasten/smarthome/sdm2mqtt.nix
|
0
A
machines/briefkasten/smarthome/telegraf.nix
|
44
++++++++++++++++++++++++++++++++++++++++++++
A
machines/briefkasten/smarthome/zigbee2mqtt.nix
|
88
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M
machines/lollo/configuration.nix
|
1
-
D
machines/lollo/smarthome/influxdb2.nix
|
127
-------------------------------------------------------------------------------
D
machines/lollo/smarthome/mosquitto.nix
|
50
--------------------------------------------------
D
machines/lollo/smarthome/telegraf.nix
|
44
--------------------------------------------
D
machines/lollo/smarthome/zigbee2mqtt.nix
|
88
-------------------------------------------------------------------------------
M
machines/trabbi/grafana/default.nix
|
24
+++++++++++++++++++++---
A
secrets/briefkasten/influx/backup_env.age
|
13
+++++++++++++
A
secrets/briefkasten/influx/grafana_token_mqttData.age
|
15
+++++++++++++++
A
secrets/briefkasten/influx/grafana_token_solaxData.age
|
14
++++++++++++++
A
secrets/briefkasten/influx/master_token.age
|
14
++++++++++++++
A
secrets/briefkasten/influx/telegraf_token_mqttData.age
|
14
++++++++++++++
A
secrets/briefkasten/influx/telegraf_token_solaxData.age
|
13
+++++++++++++
A
secrets/briefkasten/mosquitto/passwd-leah.age
|
10
++++++++++
A
secrets/briefkasten/restic/influxdb.age
|
11
+++++++++++
A
secrets/briefkasten/telegraf/secrets.env.age
|
17
+++++++++++++++++
A
secrets/briefkasten/zigbee2mqtt/secrets.age
|
12
++++++++++++
D
secrets/lollo/influx/backup_env.age
|
12
------------
D
secrets/lollo/influx/grafana_token.age
|
15
---------------
D
secrets/lollo/influx/master_token.age
|
13
-------------
D
secrets/lollo/influx/telegraf_token.age
|
14
--------------
D
secrets/lollo/mosquitto/passwd-leah.age
|
11
-----------
D
secrets/lollo/restic/influxdb.age
|
13
-------------
D
secrets/lollo/telegraf_env.age
|
17
-----------------
D
secrets/lollo/zigbee2mqtt/secrets.age
|
13
-------------
M
secrets/secrets.nix
|
18
++++++++++--------
diff --git a/machines/briefkasten/configuration.nix b/machines/briefkasten/configuration.nix
@@ -20,6 +20,8 @@
     # fedi server
     ./gotosocial.nix
 
+    ./smarthome
+
     ./scanner-sftp.nix
 
     ./websites
diff --git a/machines/lollo/smarthome/default.nix b/machines/briefkasten/smarthome/default.nix
diff --git a/machines/lollo/smarthome/departures2mqtt.nix b/machines/briefkasten/smarthome/departures2mqtt.nix
diff --git a/machines/lollo/smarthome/homebridge.nix b/machines/briefkasten/smarthome/homebridge.nix
diff --git a/machines/briefkasten/smarthome/influxdb2.nix b/machines/briefkasten/smarthome/influxdb2.nix
@@ -0,0 +1,127 @@
+{ config, pkgs, lib, ... }:
+
+{
+
+  age.secrets.restic-influxdb.file   = ./. + "/../../../secrets/${config.networking.hostName}/restic/influxdb.age";
+  age.secrets.influx-backup-env.file = ./. + "/../../../secrets/${config.networking.hostName}/influx/backup_env.age";
+
+  dns.zones."ctu.cx".subdomains."influx.home".CNAME = lib.mkIf config.networking.usePBBUplink [ "${config.networking.fqdn}." ];
+
+  systemd.services.restic-backup-influxdb.serviceConfig.EnvironmentFile = config.age.secrets.influx-backup-env.path;
+
+  restic-backups.influxdb = {
+    user          = "influxdb2";
+    passwordFile  = config.age.secrets.restic-influxdb.path;
+    influxBuckets = [ "mqttData" ];
+  };
+
+  systemd.services.influxdb2 = {
+    serviceConfig.ExecStartPost = "${pkgs.bash}/bin/bash -c 'until ${pkgs.netcat}/bin/nc -z 127.0.0.1 8086; do sleep 0.2; done'";
+    onFailure                   = [ "email-notify@%i.service" ];
+  };
+
+  services.influxdb2.enable = true;
+
+  services.nginx = {
+    enable = true;
+    virtualHosts."influx.home.ctu.cx" = {
+      enableACME = lib.mkIf config.networking.usePBBUplink true;
+      forceSSL   = lib.mkIf config.networking.usePBBUplink true;
+      kTLS       = lib.mkIf config.networking.usePBBUplink true;
+      locations."/".proxyPass   = "http://127.0.0.1:8086/";
+    };
+  };
+
+  systemd.services.power-history = {
+    startAt = "0/2:00:00";
+    path = with pkgs; [ curl jq mosquitto ];
+
+    serviceConfig = {
+      NoNewPrivileges         = true;
+      PrivateTmp              = true;
+
+      ProtectSystem           = "strict";
+      ProtectKernelLogs       = true;
+      ProtectKernelModules    = true;
+      ProtectKernelTunables   = true;
+      ProtectControlGroups    = true;
+      ProtectHome             = true;
+
+      RestrictNamespaces      = true;
+      RestrictRealtime        = true;
+
+      DevicePolicy            = "closed";
+      LockPersonality         = true;
+    };
+
+    script = ''
+      QUERY=$(cat <<-END
+      import "timezone"
+      import "date"
+      import "math"
+
+      option location = {zone: "Europe/Berlin", offset: 0h}
+      option header = false
+
+      date_start = date.truncate(t: date.sub(from: now(), d: 3y), unit: 1d)
+      date_stop = date.truncate(t: now(), unit: 1d)
+
+      data =
+          from(bucket: "mqttData")
+              |> range(start: date_start, stop: date_stop)
+              |> filter(fn: (r) => r.topic == "sdm2mqtt/leah" and r._field == "import")
+              |> drop(columns: ["_field", "_measurement", "topic", "host"])
+
+      //daily aggregation
+      data
+        // Windows and aggregates the data
+        |> range(start: -30d, stop: now())
+        |> aggregateWindow(every: duration(v: 1d), fn: max, createEmpty: false, timeSrc: "_start")
+        |> difference()
+        |> drop(columns: ["_start", "_stop"])
+        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
+        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.month(t: r._time))+"-"+string(v: date.monthDay(t: r._time))}))
+        |> yield(name: "d")
+
+      //weekly aggregation
+      data
+        // Windows and aggregates the data
+        |> aggregateWindow(every: duration(v: 1w), fn: max, createEmpty: false, offset: -3d, timeSrc: "_start")
+        |> difference()
+        |> drop(columns: ["_start", "_stop"])
+        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
+        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.week(t: r._time))}))
+        |> yield(name: "w")
+
+      //monthly aggregation
+      data
+        // Windows and aggregates the data
+        |> aggregateWindow(every: duration(v: 1mo), fn: max, createEmpty: false, timeSrc: "_start")
+        |> difference()
+        |> drop(columns: ["_start", "_stop"])
+        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
+        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.month(t: r._time))}))
+        |> yield(name: "m")
+
+      //yearly aggregation
+      data
+        // Windows and aggregates the data
+        |> aggregateWindow(every: duration(v: 1y), fn: max, createEmpty: false, timeSrc: "_start")
+        |> difference()
+        |> drop(columns: ["_start", "_stop"])
+        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
+        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))}))
+        |> yield(name: "y")
+
+      END
+      )
+
+      REQUEST_BODY=`echo '{"dialect": { "header": false}}' | jq --arg q "''${QUERY}" '.query=$q'`
+      RESPONSE=`curl -X POST 'https://influx.home.ctu.cx/api/v2/query?org=leah' -sS -H 'Accept:application/csv' -H 'Authorization: Token ZrTCG9n8ow-KC_x_HhwJD3VwWS208051WczuIa-3i2M3qmZETdth_XIi5FUTEVKmMXlQ015ujWLRZLjBNbINxQ==' -H 'Content-type:application/json' -d "''${REQUEST_BODY}"`
+      MESSAGE=`echo "''${RESPONSE}" | tr -s '\r' '\n' | jq --slurp --raw-input -c 'split("\n") | map(select(length > 0)) | .[1:] | map(split(",")) | map([.[1],.[3],.[4]])'`
+
+      mosquitto_pub -h '127.0.0.1' -r -t 'sdm2mqtt/leah/history' -m "''${MESSAGE}"
+    '';
+  };
+
+}
diff --git a/machines/lollo/smarthome/mbusd.nix b/machines/briefkasten/smarthome/mbusd.nix
diff --git a/machines/briefkasten/smarthome/mosquitto.nix b/machines/briefkasten/smarthome/mosquitto.nix
@@ -0,0 +1,53 @@
+{ inputs, config, pkgs, ... }:
+
+{
+
+  age.secrets = {
+    mosquitto-passwd-leah = {
+      file  = ./. + "/../../../secrets/${config.networking.hostName}/mosquitto/passwd-leah.age";
+      owner = "mosquitto";
+    };
+
+    mosquitto-passwd-nrw = {
+      file  = ./. + "/../../../secrets/${config.networking.hostName}/mosquitto/passwd-nrw.age";
+      owner = "mosquitto";
+    };
+  };
+
+  services = {
+    mosquitto = {
+      enable      = true;
+      persistence = false;
+      settings = {
+        max_keepalive = 60;
+      };
+      listeners = [
+
+        {
+          port = 1883;
+          omitPasswordAuth = true;
+          users = {};
+          settings = {
+            allow_anonymous = true;
+          };
+          acl = [ "topic readwrite #" "pattern readwrite #" ];
+        }
+
+        {
+          address = "127.0.0.1";
+          port    = 9005;
+          users = {
+            leah.passwordFile = config.age.secrets.mosquitto-passwd-leah.path;
+            nrw.passwordFile  = config.age.secrets.mosquitto-passwd-nrw.path;
+          };
+          settings = {
+            protocol = "websockets";
+          };
+          acl = [ "topic readwrite #" "pattern readwrite #" ];
+        }
+
+      ];
+    };
+  };
+
+}+
\ No newline at end of file
diff --git a/machines/lollo/smarthome/mqtt-webui/config.nix b/machines/briefkasten/smarthome/mqtt-webui/config.nix
diff --git a/machines/lollo/smarthome/mqtt-webui/default.nix b/machines/briefkasten/smarthome/mqtt-webui/default.nix
diff --git a/machines/lollo/smarthome/mqtt-webui/extra-css/extra.css b/machines/briefkasten/smarthome/mqtt-webui/extra-css/extra.css
diff --git a/machines/lollo/smarthome/mqtt-webui/extra-css/manifest.json b/machines/briefkasten/smarthome/mqtt-webui/extra-css/manifest.json
diff --git a/machines/lollo/smarthome/sdm2mqtt.nix b/machines/briefkasten/smarthome/sdm2mqtt.nix
diff --git a/machines/briefkasten/smarthome/telegraf.nix b/machines/briefkasten/smarthome/telegraf.nix
@@ -0,0 +1,43 @@
+{ inputs, config, ... }:
+
+{
+
+  age.secrets.telegraf-env = {
+    file  = ./. + "/../../../secrets/${config.networking.hostName}/telegraf/secrets.env.age";
+    owner = "telegraf";
+  };
+
+  services.telegraf = {
+    enable = true;
+    environmentFiles = [ config.age.secrets.telegraf-env.path ];
+    extraConfig = {
+      inputs = {
+        mqtt_consumer = {
+          servers     = [ "tcp://127.0.0.1:1883" ];
+          topics      = [
+            "sdm2mqtt/leah"
+            "lacrosse2mqtt/+"
+            "zigbee2mqtt/tuya_sensor_fridge"
+            "zigbee2mqtt/tuya_sensor_bathroom"
+            "zigbee2mqtt/tuya_sensor_l"
+            "zigbee2mqtt/tuya_sensor_l2"
+          ];
+          data_format = "json";
+          fielddrop   = [ "newBatt" "weakBatt" ];
+        };
+      };
+      outputs = {
+        influxdb_v2 = [
+          {
+            urls         = [ "https://influx.home.ctu.cx" ];
+            organization = "leah";
+            bucket       = "mqttData";
+            token        = "\${INFLUX_TOKEN_MQTTDATA}";
+            tagdrop.topic = [ "solax2mqtt" ];
+          }
+        ];
+      };
+    };
+  };
+
+}+
\ No newline at end of file
diff --git a/machines/briefkasten/smarthome/zigbee2mqtt.nix b/machines/briefkasten/smarthome/zigbee2mqtt.nix
@@ -0,0 +1,88 @@
+{ inputs, config, pkgs, ... }:
+
+{
+
+  age.secrets = {
+    "zigbee2mqtt-secrets.yaml" = {
+      file  = ./. + "/../../../secrets/${config.networking.hostName}/zigbee2mqtt/secrets.age";
+      owner = "zigbee2mqtt";
+    };
+  };
+
+  systemd.services.zigbee2mqtt = {
+    requires  = [ "mosquitto.service" ];
+    after     = [ "mosquitto.service" ];
+    onFailure = [ "email-notify@%i.service" ];
+  };
+
+  services = {
+    udev.extraRules = ''
+      SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{serial}=="00_12_4B_00_25_9B_C1_FC", SYMLINK+="zigbee0"
+      ATTR{idVendor}=="0451", ATTR{idProduct}=="16a8", ENV{ID_MM_DEVICE_IGNORE}="1"
+      SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee0"
+    '';
+
+    zigbee2mqtt = {
+      enable   = true;
+      package  = pkgs.zigbee2mqtt;
+      settings = {
+        homeassistant = false;
+        permit_join   = false;
+
+        mqtt = {
+          base_topic = "zigbee2mqtt";
+          server     = "mqtt://127.0.0.1";
+        };
+
+        serial = {
+          port        = "/dev/zigbee0";
+          disable_led = true;
+        };
+
+        frontend = {
+          port = 8422;
+          host = config.networking.secondaryIP4;
+        };
+
+        advanced = {
+          log_level   = "info";
+          log_output  = [ "console" ];
+          network_key = "!${config.age.secrets."zigbee2mqtt-secrets.yaml".path} network_key";
+        };
+
+        device_options.retain = true;
+        devices = {
+          "0x84fd27fffeaaa597".friendly_name = "ikea_lamp_i";
+          "0x842e14fffe57daae".friendly_name = "ikea_lamp_i_rgb";
+          "0x84fd27fffe6b9ddd".friendly_name = "ikea_lamp_l";
+          "0x94deb8fffe52e639".friendly_name = "ikea_lamp_l_rgb";
+          "0x84fd27fffe44369e".friendly_name = "ikea_lamp_kitchen";
+          "0x84fd27fffe3a0b93".friendly_name = "ikea_lamp_bathroom";
+          "0x84fd27fffea515fc".friendly_name = "ikea_lamp_hallway";
+
+          "0x5c0272fffec9006c".friendly_name = "ikea_remote_i_door";
+          "0x0c4314fffe194ca3".friendly_name = "ikea_remote_i_desk";
+          "0x804b50fffe42a74e".friendly_name = "ikea_remote_l_door";
+          "0x842e14fffe977bfa".friendly_name = "ikea_remote_l_bed";
+          "0x5c0272fffeca585a".friendly_name = "ikea_remote_kitchen";
+          "0x842e14fffe1ab485".friendly_name = "ikea_remote_bathroom";
+          "0x804b50fffe7df0be".friendly_name = "ikea_remote_hallway_entrancedoor";
+          "0x0c4314fffe194a18".friendly_name = "ikea_remote_hallway";
+
+          "0xcc86ecfffe8bf621".friendly_name = "ikea_control_outlet_i_desk_r";
+          "0x588e81fffebcdc1e".friendly_name = "ikea_control_outlet_i_desk_l";
+
+          "0x847127fffecd89b6".friendly_name = "ikea_motionsensor";
+
+          "0xa4c138da0f6d23de".friendly_name = "tuya_led_stripe_desk";
+
+          "0xa4c1389d5f391891".friendly_name = "tuya_sensor_fridge";
+          "0xa4c13809f76bcdc2".friendly_name = "tuya_sensor_bathroom";
+          "0xa4c13882b76fa1ac".friendly_name = "tuya_sensor_l";
+          "0xa4c138ebeae2efd2".friendly_name = "tuya_sensor_l2";
+        };
+
+      };
+    };
+  };
+}
diff --git a/machines/lollo/configuration.nix b/machines/lollo/configuration.nix
@@ -15,7 +15,6 @@
     ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/restic-server.nix
 
-    ./smarthome
     ./solar-nrw
     ./websites
   ];
diff --git a/machines/lollo/smarthome/influxdb2.nix b/machines/lollo/smarthome/influxdb2.nix
@@ -1,127 +0,0 @@
-{ config, pkgs, lib, ... }:
-
-{
-
-  age.secrets.restic-influxdb.file   = ../../../secrets/lollo/restic/influxdb.age;
-  age.secrets.influx-backup-env.file = ../../../secrets/lollo/influx/backup_env.age;
-
-  dns.zones."ctu.cx".subdomains."influx.home".CNAME = lib.mkIf config.networking.usePBBUplink [ "${config.networking.fqdn}." ];
-
-  systemd.services.restic-backup-influxdb.serviceConfig.EnvironmentFile = config.age.secrets.influx-backup-env.path;
-
-  restic-backups.influxdb = {
-    user          = "influxdb2";
-    passwordFile  = config.age.secrets.restic-influxdb.path;
-    influxBuckets = [ "mqttData" ];
-  };
-
-  systemd.services.influxdb2 = {
-    serviceConfig.ExecStartPost = "${pkgs.bash}/bin/bash -c 'until ${pkgs.netcat}/bin/nc -z 127.0.0.1 8086; do sleep 0.2; done'";
-    onFailure                   = [ "email-notify@%i.service" ];
-  };
-
-  services.influxdb2.enable = true;
-
-  services.nginx = {
-    enable = true;
-    virtualHosts."influx.home.ctu.cx" = {
-      enableACME = lib.mkIf config.networking.usePBBUplink true;
-      forceSSL   = lib.mkIf config.networking.usePBBUplink true;
-      kTLS       = lib.mkIf config.networking.usePBBUplink true;
-      locations."/".proxyPass   = "http://127.0.0.1:8086/";
-    };
-  };
-
-  systemd.services.power-history = {
-    startAt = "0/2:00:00";
-    path = with pkgs; [ curl jq mosquitto ];
-
-    serviceConfig = {
-      NoNewPrivileges         = true;
-      PrivateTmp              = true;
-
-      ProtectSystem           = "strict";
-      ProtectKernelLogs       = true;
-      ProtectKernelModules    = true;
-      ProtectKernelTunables   = true;
-      ProtectControlGroups    = true;
-      ProtectHome             = true;
-
-      RestrictNamespaces      = true;
-      RestrictRealtime        = true;
-
-      DevicePolicy            = "closed";
-      LockPersonality         = true;
-    };
-
-    script = ''
-      QUERY=$(cat <<-END
-      import "timezone"
-      import "date"
-      import "math"
-
-      option location = {zone: "Europe/Berlin", offset: 0h}
-      option header = false
-
-      date_start = date.truncate(t: date.sub(from: now(), d: 3y), unit: 1d)
-      date_stop = date.truncate(t: now(), unit: 1d)
-
-      data =
-          from(bucket: "mqttData")
-              |> range(start: date_start, stop: date_stop)
-              |> filter(fn: (r) => r.topic == "sdm2mqtt/leah" and r._field == "import")
-              |> drop(columns: ["_field", "_measurement", "topic", "host"])
-
-      //daily aggregation
-      data
-        // Windows and aggregates the data
-        |> range(start: -30d, stop: now())
-        |> aggregateWindow(every: duration(v: 1d), fn: max, createEmpty: false, timeSrc: "_start")
-        |> difference()
-        |> drop(columns: ["_start", "_stop"])
-        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
-        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.month(t: r._time))+"-"+string(v: date.monthDay(t: r._time))}))
-        |> yield(name: "d")
-
-      //weekly aggregation
-      data
-        // Windows and aggregates the data
-        |> aggregateWindow(every: duration(v: 1w), fn: max, createEmpty: false, offset: -3d, timeSrc: "_start")
-        |> difference()
-        |> drop(columns: ["_start", "_stop"])
-        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
-        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.week(t: r._time))}))
-        |> yield(name: "w")
-
-      //monthly aggregation
-      data
-        // Windows and aggregates the data
-        |> aggregateWindow(every: duration(v: 1mo), fn: max, createEmpty: false, timeSrc: "_start")
-        |> difference()
-        |> drop(columns: ["_start", "_stop"])
-        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
-        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))+"-"+string(v: date.month(t: r._time))}))
-        |> yield(name: "m")
-
-      //yearly aggregation
-      data
-        // Windows and aggregates the data
-        |> aggregateWindow(every: duration(v: 1y), fn: max, createEmpty: false, timeSrc: "_start")
-        |> difference()
-        |> drop(columns: ["_start", "_stop"])
-        |> map(fn: (r) => ({r with _value: (math.round(x: r._value * 100.0) / 100.0)}))
-        |> map(fn: (r) => ({r with _time: string(v: date.year(t: r._time))}))
-        |> yield(name: "y")
-
-      END
-      )
-
-      REQUEST_BODY=`echo '{"dialect": { "header": false}}' | jq --arg q "''${QUERY}" '.query=$q'`
-      RESPONSE=`curl -X POST 'https://influx.home.ctu.cx/api/v2/query?org=leah' -sS -H 'Accept:application/csv' -H 'Authorization: Token ZrTCG9n8ow-KC_x_HhwJD3VwWS208051WczuIa-3i2M3qmZETdth_XIi5FUTEVKmMXlQ015ujWLRZLjBNbINxQ==' -H 'Content-type:application/json' -d "''${REQUEST_BODY}"`
-      MESSAGE=`echo "''${RESPONSE}" | tr -s '\r' '\n' | jq --slurp --raw-input -c 'split("\n") | map(select(length > 0)) | .[1:] | map(split(",")) | map([.[1],.[3],.[4]])'`
-
-      mosquitto_pub -h '127.0.0.1' -r -t 'sdm2mqtt/leah/history' -m "''${MESSAGE}"
-    '';
-  };
-
-}
diff --git a/machines/lollo/smarthome/mosquitto.nix b/machines/lollo/smarthome/mosquitto.nix
@@ -1,49 +0,0 @@
-{ inputs, config, pkgs, ... }:
-
-{
-
-  age.secrets = {
-    mosquitto-passwd-leah = {
-      file  = ../../../secrets/lollo/mosquitto/passwd-leah.age;
-      owner = "mosquitto";
-    };
-
-    mosquitto-passwd-nrw = {
-      file  = ../../../secrets/lollo/mosquitto/passwd-nrw.age;
-      owner = "mosquitto";
-    };
-  };
-
-  services = {
-    mosquitto = {
-      enable      = true;
-      persistence = false;
-      settings = {
-        max_keepalive = 60;
-      };
-      listeners = [
-        {
-          port = 1883;
-          omitPasswordAuth = true;
-          users = {};
-          settings = {
-            allow_anonymous = true;
-          };
-          acl = [ "topic readwrite #" "pattern readwrite #" ];
-        }
-        {
-          port = 9005;
-          users = {
-            leah.passwordFile = config.age.secrets.mosquitto-passwd-leah.path;
-            nrw.passwordFile  = config.age.secrets.mosquitto-passwd-nrw.path;
-          };
-          settings = {
-            protocol = "websockets";
-          };
-          acl = [ "topic readwrite #" "pattern readwrite #" ];
-        }
-      ];
-    };
-  };
-
-}-
\ No newline at end of file
diff --git a/machines/lollo/smarthome/telegraf.nix b/machines/lollo/smarthome/telegraf.nix
@@ -1,43 +0,0 @@
-{ inputs, config, ... }:
-
-{
-
-  age.secrets.telegraf-env = {
-    file  = ../../../secrets/lollo/telegraf_env.age;
-    owner = "telegraf";
-  };
-
-  services.telegraf = {
-    enable = true;
-    environmentFiles = [ config.age.secrets.telegraf-env.path ];
-    extraConfig = {
-      inputs = {
-        mqtt_consumer = {
-          servers     = [ "tcp://127.0.0.1:1883" ];
-          topics      = [
-            "sdm2mqtt/leah"
-            "lacrosse2mqtt/+"
-            "zigbee2mqtt/tuya_sensor_fridge"
-            "zigbee2mqtt/tuya_sensor_bathroom"
-            "zigbee2mqtt/tuya_sensor_l"
-            "zigbee2mqtt/tuya_sensor_l2"
-          ];
-          data_format = "json";
-          fielddrop   = [ "newBatt" "weakBatt" ];
-        };
-      };
-      outputs = {
-        influxdb_v2 = [
-          {
-            urls         = [ "https://influx.home.ctu.cx" ];
-            organization = "leah";
-            bucket       = "mqttData";
-            token        = "\${INFLUX_TOKEN_MQTTDATA}";
-            tagdrop.topic = [ "solax2mqtt" ];
-          }
-        ];
-      };
-    };
-  };
-
-}-
\ No newline at end of file
diff --git a/machines/lollo/smarthome/zigbee2mqtt.nix b/machines/lollo/smarthome/zigbee2mqtt.nix
@@ -1,88 +0,0 @@
-{ inputs, config, pkgs, ... }:
-
-{
-
-  age.secrets = {
-    "zigbee2mqtt-secrets.yaml" = {
-      file  = ../../../secrets/lollo/zigbee2mqtt/secrets.age;
-      owner = "zigbee2mqtt";
-    };
-  };
-
-  systemd.services.zigbee2mqtt = {
-    requires  = [ "mosquitto.service" ];
-    after     = [ "mosquitto.service" ];
-    onFailure = [ "email-notify@%i.service" ];
-  };
-
-  services = {
-    udev.extraRules = ''
-      SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{serial}=="00_12_4B_00_25_9B_C1_FC", SYMLINK+="zigbee0"
-      ATTR{idVendor}=="0451", ATTR{idProduct}=="16a8", ENV{ID_MM_DEVICE_IGNORE}="1"
-      SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee0"
-    '';
-
-    zigbee2mqtt = {
-      enable   = true;
-      package  = pkgs.zigbee2mqtt;
-      settings = {
-        homeassistant = false;
-        permit_join   = false;
-
-        mqtt = {
-          base_topic = "zigbee2mqtt";
-          server     = "mqtt://127.0.0.1";
-        };
-
-        serial = {
-          port        = "/dev/zigbee0";
-          disable_led = true;
-        };
-
-        frontend = {
-          port = 8422;
-          host = "10.0.0.42";
-        };
-
-        advanced = {
-          log_level   = "info";
-          log_output  = [ "console" ];
-          network_key = "!${config.age.secrets."zigbee2mqtt-secrets.yaml".path} network_key";
-        };
-
-        device_options.retain = true;
-        devices = {
-          "0x84fd27fffeaaa597".friendly_name = "ikea_lamp_i";
-          "0x842e14fffe57daae".friendly_name = "ikea_lamp_i_rgb";
-          "0x84fd27fffe6b9ddd".friendly_name = "ikea_lamp_l";
-          "0x94deb8fffe52e639".friendly_name = "ikea_lamp_l_rgb";
-          "0x84fd27fffe44369e".friendly_name = "ikea_lamp_kitchen";
-          "0x84fd27fffe3a0b93".friendly_name = "ikea_lamp_bathroom";
-          "0x84fd27fffea515fc".friendly_name = "ikea_lamp_hallway";
-
-          "0x5c0272fffec9006c".friendly_name = "ikea_remote_i_door";
-          "0x0c4314fffe194ca3".friendly_name = "ikea_remote_i_desk";
-          "0x804b50fffe42a74e".friendly_name = "ikea_remote_l_door";
-          "0x842e14fffe977bfa".friendly_name = "ikea_remote_l_bed";
-          "0x5c0272fffeca585a".friendly_name = "ikea_remote_kitchen";
-          "0x842e14fffe1ab485".friendly_name = "ikea_remote_bathroom";
-          "0x804b50fffe7df0be".friendly_name = "ikea_remote_hallway_entrancedoor";
-          "0x0c4314fffe194a18".friendly_name = "ikea_remote_hallway";
-
-          "0xcc86ecfffe8bf621".friendly_name = "ikea_control_outlet_i_desk_r";
-          "0x588e81fffebcdc1e".friendly_name = "ikea_control_outlet_i_desk_l";
-
-          "0x847127fffecd89b6".friendly_name = "ikea_motionsensor";
-
-          "0xa4c138da0f6d23de".friendly_name = "tuya_led_stripe_desk";
-
-          "0xa4c1389d5f391891".friendly_name = "tuya_sensor_fridge";
-          "0xa4c13809f76bcdc2".friendly_name = "tuya_sensor_bathroom";
-          "0xa4c13882b76fa1ac".friendly_name = "tuya_sensor_l";
-          "0xa4c138ebeae2efd2".friendly_name = "tuya_sensor_l2";
-        };
-
-      };
-    };
-  };
-}
diff --git a/machines/trabbi/grafana/default.nix b/machines/trabbi/grafana/default.nix
@@ -2,8 +2,13 @@
 
 {
 
-  age.secrets.grafana-influx-token = {
-    file  = ../../../secrets/lollo/influx/grafana_token.age;
+  age.secrets.grafana-influx-token-mqttData = {
+    file  = ../../../secrets/briefkasten/influx/grafana_token_mqttData.age;
+    owner = "grafana";
+  };
+
+  age.secrets.grafana-influx-token-solaxData = {
+    file  = ../../../secrets/briefkasten/influx/grafana_token_solaxData.age;
     owner = "grafana";
   };
 

@@ -47,7 +52,20 @@
             jsonData.version       = "Flux";
             jsonData.organization  = "leah";
             jsonData.defaultBucket = "mqttData";
-            secureJsonData.token   = "$__file{${config.age.secrets.grafana-influx-token.path}}";
+            secureJsonData.token   = "$__file{${config.age.secrets.grafana-influx-token-mqttData.path}}";
+          }
+
+          {
+            name                   = "InfluxDB (solaxData)";
+            type                   = "influxdb";
+            url                    = "https://influx.home.ctu.cx";
+            orgId                  = 1;
+            database               = "mqttData";
+            editable               = false;
+            jsonData.version       = "Flux";
+            jsonData.organization  = "leah";
+            jsonData.defaultBucket = "mqttData";
+            secureJsonData.token   = "$__file{${config.age.secrets.grafana-influx-token-solaxData.path}}";
           }
 
         ];
diff --git a/secrets/briefkasten/influx/backup_env.age b/secrets/briefkasten/influx/backup_env.age
@@ -0,0 +1,13 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJOEJ1NDl4TCs0RWJZTEY2
+dzY3K3VxbTRrZ2g2UTF4K3RnVzVFTU9Ba2pjCjVUQWdkaTlaWmhjeUdqUmwxMkZn
+R3lpTjlXbEpFZ2NpZktETmlBSXczM2sKLT4gc3NoLWVkMjU1MTkgNGhLQ013IDBt
+MUUzRjVMNzJER2NyN1VNbFpkY004SGVxUkt0S0I4Zld4cGxLdm1ZSHcKSHJzZzdx
+eUhxWTU3dVpOTnRSelYyU0htb2JQUWxBVWFSZUxtcnN2L2xidwotPiB5S1RkLy1n
+cmVhc2UKeklNZVlOeFFKZmYxU0gvRjFrOW5kUm9FRlVkcVhPbEF0MG1oSXU3emdH
+ZnVOUlEKLS0tIGxNYVdRbGdGUFlCYi8xcFF6cnpteXdHclpoaVJYSUVUMXJsM0xU
+Q2h6SlkKCyiXOqyGwomcFdrCDOVDtHI6cvTAJfz3Qm+HgmyHzA9mPVUwzVi4TFfo
++FO7JmQjdJ9REwFjjU43j3aH5JPAXzZEf18UA+fs56B59EbWJsdP2pjaRVwNSPLu
+YmH+4xGgf2JXPFkY8SQvC2BinLPJ4gAvfJDQ366WXWV0QVkTK0wTA+7CQIikLuC0
+0XQM3+xjXIN32SGtmw==
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/influx/grafana_token_mqttData.age b/secrets/briefkasten/influx/grafana_token_mqttData.age
@@ -0,0 +1,15 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoMXNrZTBYdlBwN3ZCcytj
+MjI2UllETnNPTTdmT1dUT3I2VVVNNkpoQkFrCjVtRWp3cDliQXo3Y1lKbmpyczVq
+VGRBai9hbG4rN1hyYVp0UVIzbWZ0UHcKLT4gc3NoLWVkMjU1MTkgNGhLQ013IFM3
+SUk0VXhWTlBDR2dnQ00yM2lmREZoM1NkeGQrR1RJOWJjTDNaTlNGQjAKd0FXVUFG
+NHU0Y1JsbU11akxRWlc1Z1dGbG1wK2NGSXVheXJHdno1Z1UzRQotPiBzc2gtZWQy
+NTUxOSBWMHVVcncgTHUvbnVIRTFtbi9zaFZoZzBNcW80V29zRE5hWlVrSmIyS1Zw
+Z0xhZ0lqawpzazVMVHRmY2NER0N3L0hwdzdRVHN2b0NLQUM2UmI1WmJtdmtQRTYx
+Z3dvCi0+IHlnMDYtZ3JlYXNlIFwgVGRiWUlqX2sgNmAKZHAraitFQ0FDalFCQVFi
+Tk9QWlV3WnBxcTVFUnVTcHVQekFsVmhqNVZ4aXl4WlZRU2NsNFMraEoyYy9BMWJy
+dAo5bHNRUDU3SzlnSmlBeXcKLS0tIDU4SHZXNFMxRTJ6bk9ESnNZZkJNMFV2VmRK
+eHZhb2pMK1MyYjh6ZU5oT28Kz/NNH2AttZ3qi6gk1FXj/b2FO7YKlU8F7n3uMUTd
+Wx68nHGoRw00f07oxA6hfjd0AbZo5UcbxffFTrDGA6UhedH97zrMB0lrZRVf7ZWr
+ZGbeJXGEb3FPdQpoyxhmkpBhdfKRJr5rY+3iDDxl9YBAXItumilVzNMF
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/influx/grafana_token_solaxData.age b/secrets/briefkasten/influx/grafana_token_solaxData.age
@@ -0,0 +1,14 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzVGZyblRSc3RFWWlIaWdY
+eURNS3NCczdBV05qVjhPc0h3bXF1UW81cEZvCk9zVGl2WnQ5ZEE4T0toaUZBUFhz
+MzZ2MWRwMzVkeTRxUS80NXppRU1IZm8KLT4gc3NoLWVkMjU1MTkgNGhLQ013IGNy
+cS90WFY4WHpJVlFKTXlzcmFoeS9MdWh3VmZHVXR2aUpvN0YwWVZjMDAKR0lyQk03
+MmlwZi9xRmhjZ2Z1cS96Qk1jUkNxUm81eGtSY25CMFMvdVE0WQotPiBzc2gtZWQy
+NTUxOSBWMHVVcncgcWNtQjlLRDVLZ083N0JsbnRNL1RmSFY3VXNsTzNYU0pnQU1S
+eUk3ajNRdwoycUF0cWYwc0RsZllWaHZVbENCK2xqd3hGUzdqcmEyRzIvaHVPajds
+a3BZCi0+IGRKNWZcX0VqLWdyZWFzZQo4dEZsam5BCi0tLSBBY0dNVlBKQjRyK1k0
+dzJiKzBSeFptd3NmR3dFbEI4b3pDckJsVGZKbHpZCiG9gNEP3oljTwHLqU2iw2Wu
+kaId9vFOpmZQ3AvpLYvx9hXfEFHuWTmvVYfTSrmxbhSzwB5mQYuwvQWbPTIJt6Vf
+zkoHrMVj1gWGkXeKuwgDWwQ6sneZnInCR/D+WlAl7Hw+XSUPykpf9HrhUA0lBPtZ
+sT1Fa1vk1Q==
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/influx/master_token.age b/secrets/briefkasten/influx/master_token.age
@@ -0,0 +1,14 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZMmlOSENaSzFXblZtWVd5
+S1ZOdFlmcFZHaEtBQVJqTG5PVDFPREUzTWlzClUzYXFmbVlCVytaUTV3UDJGZk5D
+b0NFVGpZcERMZGZjZnlhcDd0MDgyYW8KLT4gc3NoLWVkMjU1MTkgNGhLQ013IFB2
+RnNYTXdRbEFDWG4rR1NHS3VpQUZMTGZlY3p6cEVKeHB0aDd0QUtMVW8KanhUdVRh
+dDJXQzlqR3JFNk51WFozWVN2WUp1clpBS3MwMWNCQnlqSE1oUQotPiA6NExJIy1n
+cmVhc2UgaGNtJ0IvPCoKTGJHcld2aWJhMFhPajFITlFBbkhwNStuMW5NMkhHZU9O
+VzhRdVkvZzRkUGw2cktvcGVPdC81WmVCeUxHOFdTLwpITW93QzBoOEJwaVF6SWdL
+K0RXQzVsVUZhV1ZLaTBaRTIrTG4zWk9Cck1yS0ZVd0MyNkFodWVYZ1ZQMjZ5dXpy
+CgotLS0gL0ZXdGtWd2RrL3I5emVtbE1BU1pCNndCV0JxVEtCUFFsNCtsT3YyOU84
+awprohyNNN8i318Rw1BenEFw06SHs19FrZpotFsOPpLBDb+evzQVL4tEZj8yIpim
+nkVtMAQtRa+U2njBX5a77CBVs0D0JZjFtK6aKgQ+Pjna4e+oZNiJUVM8uA+/uUjQ
+VRrVfFrsP5kVw7il1mX8HC/+mv0+1SwND6M=
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/influx/telegraf_token_mqttData.age b/secrets/briefkasten/influx/telegraf_token_mqttData.age
@@ -0,0 +1,14 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA4dGwxRExzcSs2YnNHUXpS
+OElzK3AzTmJGT2pFaWZheTZ5MDlCTXhMUm4wCmhYY0dFVURMMCtDN2srSkwxNmd2
+YWlYWEdEWUdTcG44d1FhV1RVSUcrRjAKLT4gc3NoLWVkMjU1MTkgNGhLQ013IFZH
+N3FVcHR5UWJQTGdkNXNRd082RURmTEdYaXk5aUhJRTR5bTFrNFBxQ0EKUDVheHpR
+d2gwY2ZiVjVlbk15aXBpK2Nzb2FyUW83U1pOQ1RiMmgwSFVaWQotPiAqcjM8LWdy
+ZWFzZSBPV1cKMU9qTVkvTHRjZms5bmtHbEdCOHpaS2dlb3lxcDFMWCtYNUttcWxq
+ZHNtMlgydW00cjQ3QkU4KzBqOWp4TUNxYgpNbWtGa21LRjZ3QnFTWlhHMm1LRHhC
+WHZub3ErL2lZNG1FcEJyN24yOTJRU1JjRER0OVVRZlFPVkRmVkQyeVUKLS0tIEZV
+bXloMFpZUnFnbXhWM1owNlRnRFovbkt0aXdPSUtwUVdkZE5wVTBqTVkKSind+pvx
+EIG07/qL4YSeytqHi/uXet+Lrje7AyY4m8/X/LqX4EEDAMBx7rewOt+z30wDEGEt
+e2/5M0PymeIIIWpch4zHsHj2g5I84LSskwmgcPwl8WbYlQUs7sDuah+VcVQriero
+rgwnwI+Z7EqlowYAZu0vaib6
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/influx/telegraf_token_solaxData.age b/secrets/briefkasten/influx/telegraf_token_solaxData.age
@@ -0,0 +1,13 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxQlVKOEdjK2VWOVdpMERT
+RnFRSVNMVXU0WFVlMVBKTmhYYnUyS3pJMGdrCmo0QlNUK1RNeldPUHlCZ0tTYksw
+VVVibDFYcFlnaFI2cWcxVnFVY0d4UUUKLT4gc3NoLWVkMjU1MTkgNGhLQ013IG5H
+U0RSaXVUUXBFZjZJZkhuR08xMEQ1LzN6TDVYSkFoYW13WUJqd3Q2d3MKUlR2Q1pU
+b2hBemRiQWFVdElUbWxrdTRJZHAySHJ1ZGVLbXFFT2xseUoyYwotPiBVcjdJLG8t
+Z3JlYXNlIGcKSkRid1ZuNnc5dTZhMXg3MklEVnZUZXI3Ykc0U3ljdkVIdWpuSW1U
+V2ZhaXJlNThwL3gzNUhqcHlMbmptd0tWSApUdHBmSXZ6QTllSEdSMUEyalBBeEgw
+S2xWOHNRZXp0cG55eFpOaUUrNnVSYQotLS0gcEIrZWlqeDlUOXhPR0xTWUhwTFFF
+ZlJrWW1TallLODRVSDhKNUVDaVNMbwp6/hNv+meoYuaW2/4Xs9ZGQbMNe/v6KHi+
+RYC1L3LEE2ZoEcVSHpFAoRsrGEnPXeZ129tpaJ4fxX+m6giqTCkrKIEJhLdMRm18
+WJSRWrTq3nDRctR0zwINiqG9xr+ERlBhMqLJSqGMPBm22L0FP976dPQ72uB43do=
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/mosquitto/passwd-leah.age b/secrets/briefkasten/mosquitto/passwd-leah.age
@@ -0,0 +1,10 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqdmM0aDVURUp3aHhxVzhy
+c2JCcHczTElwbzl1OXA1SkxDNk5mU0lvNlJjCmRrUGlDR2krUXdXSTQrNnNjM2No
+dStqNkQ3bEN2cWY1RkE5MFlLd0UzV0kKLT4gc3NoLWVkMjU1MTkgNGhLQ013IENh
+dkRrWkRUem1nTUd2QjdnWEJNWStqNmJSMytKb0FncWZkbUg5alZSemsKVWhoN1lW
+ZStrZkw5UmVtcHl1azBVRlcvSGZ2QUhhYUFZRDRRVkNOa3hObwotPiBNa0YtZ3Jl
+YXNlCkR3d3M5bFMrcWVaTHAzR3RqSWF3OTgzaWV0MjdKUHJvbGpPR0NXT21yVWta
+Q0c1cwotLS0gVkllaFdWbjRTc2NrcXg1dk1zNUhMcUNBSWdINERhZWk0MUdJRkJ0
+UCsxYwqNkck4xnezo4KuFrL7JhzD6pgKlvCi/tLFAEPTZ7jtGyiokbutyBnOcw==
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/restic/influxdb.age b/secrets/briefkasten/restic/influxdb.age
@@ -0,0 +1,11 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6MS94TyswdzlVZmtvTWRW
+NGJpQ3E4eE0wNS81QzR2RnJ2SnFHaG5sRVgwCm42SXlta2oxK3VGRElpZjEzK0o4
+RlBmVnc2eC8xenVYTXJRRDZmVUhKemMKLT4gc3NoLWVkMjU1MTkgNGhLQ013IG1n
+UVJiNTVNSS9maFUzZHZwaWpsNHlNWjhTaU9BOGZRWVh2L2UrTWxReVEKM1lPSGNq
+SGV2eVlqWUZxcDU2S1A1M0Q3aytLMFdyTHZDV3dyQXFiSVN4MAotPiBbQT8tZ3Jl
+YXNlCmF1UDFkcGJHdTA1QkpGMkpkRmw3T1cxVQotLS0gNmhuVWcyZXJhbzhYdHFJ
+c0ZJQThndGVKbjFKUzhPOWNGOHFzK2xHK09aNArUCNBGlrRn6bO9K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ReRvAPsv2c6uaFDfDeScXOxycoG70fKbFusgrK15BQBQhs
+sSMw2RTQJAcAHkczrYbh9/eb7GLwGRdtg7/OzRUyiQA4ZsH2iJCCphaB9GSU5cHb
+/BqmvSOEVA1458LbN/LiOTtLWHyz
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/briefkasten/zigbee2mqtt/secrets.age b/secrets/briefkasten/zigbee2mqtt/secrets.age
@@ -0,0 +1,12 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSArNUVOV0IvNGJGdTZwcDRk
+M0E1NmtKNm9yNDl1MmNUMDZhVG0zWmhuUTNrCk5xdStxL1hMNFhCQXErLy9CNzha
+TGpZZnVjb1NmbWVwRlY1ZTNUYjJiUjQKLT4gc3NoLWVkMjU1MTkgNGhLQ013IElJ
+d2pJOUxQcjhHM05XWno3c3loV2ZBK1RpYlVhL3JEb1J2YmpDRXBWVTgKazJtZ3lV
+aUt2N0J1ZEwzb3Z3YUJQaGhnYmZjQTdRNGduM3F3UjdVbHY4cwotPiBvUXR8WVUq
+LWdyZWFzZSBiLVMwIHtJKml3CjdyTklmS3E1QXVvZWtmWTF5WUZYNWpyUmdGajl4
+MFpVWlJIUm0vRUEKLS0tIHgyRXh0VVRtTDkrOGs1NzBnbS9KbHpRNGU1REt5Yi94
+SERNdDRKa2tNMlUKCjwpNPDZmE8OSUNaMWJ5suDpHrEgi2Qe+jJttw9pZ2kXAByY
+ScGJ/BnYZty7U/rHSIi8yb+SZF9uf9/YtQPHH9bwuTvn3fMKy4fJHuFk8L6NhJtw
+ldzxStPH0DWlctiun3Xlft7gIbRw0H/SsQNaJjk33qNo
+-----END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/influx/backup_env.age b/secrets/lollo/influx/backup_env.age
@@ -1,12 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5bW5Ebkp6WnJHa3o5SHV2
-NFl3ZU9rVG5uK2IvSjNwTnV3cUJvN01zK0FVClV5U3FybEhJSytUb2VpS0Vjcmhu
-UmNkTlJmTi80YTkwWDg0NE11Z0xVeFUKLT4gc3NoLWVkMjU1MTkgMXJjY0t3IEZn
-ODY5V0hBcVR3ZGc1Rm00SUx1YjJhTDg2OTZZay9LV0ZuVVVxMlByMHMKeDBxZXBo
-Y1RJYzAybGF5dXRQS3AvckljNHp1Q3pibXE2NkhObWZRZnEwbwotPiAvfGx5IlIt
-Z3JlYXNlIFNpfiBpCjFuaG9KMnlpOTdEawotLS0gQzQxY2pVZlRadE42bnIrQnJo
-TGp4dnlwZEZtRFdpN2V5K1ZoK0tidDdROArZItZqiYioXjNMuzrcXl3VGulI4Leo
-eTBs8bAIamo2L8bfO0u5OeN8hgCtNu6DkodWoXkV0lwPmv3RWuRzxoIJew+uF5Hh
-1efXiktkBHFhhXTvN+4rqZOZO3X+uK8F/LTvTT/V7+pb59YuMrq3S07iWjailOQL
-N/FXkj/5yJ+RmQiZpXyLmGjmhq0kv2DwVkL0516vvGKe
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/influx/grafana_token.age b/secrets/lollo/influx/grafana_token.age
@@ -1,15 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvelhSNXhUYjdpOUJDb1N3
-VVRLZ0p2a0k0ZXJNRUZ6MlBiczUrYnlRVkM0CmZkd0lqSExFay9RK29zNW00b1dH
-amExdWJSL0RQdmZpOFdaTHZHSSt0YU0KLT4gc3NoLWVkMjU1MTkgMXJjY0t3IDc3
-L0wxc0ZGZndOaGtxeEFyOWoyY2NGR3FsMmpWa1gvK1lsaUJSL3R4RW8Kem55Z0xB
-alRpVGs4VmpMRlkyOGxTcDFSMkJGZlpzZGxXbHZpQnFNNjh6YwotPiBzc2gtZWQy
-NTUxOSBWMHVVcncgZFIvWUhha08zNHdnSnZRVy90MHJtUmJIam04N1pyQkR3R01K
-YVEvQlpBUQpmNHh6bm5PaGlDc2JNejY2TENsUGxUKy91d0tKMFR6OTNicG5aSmpz
-UXQ4Ci0+IC0tZ3JlYXNlIDlSfjFuWkIxIHovaiAreiAsd1hFRCo9cgo5NFB5b3py
-d0pXRzgwMFB4SkdrTnhNc1VGckw0c3ZpNys0RHBrQ1pjN1pubQotLS0gNkR6UjZW
-TmgrQWJLYVBnbHZzSnJzZVhnVTRZQ0xhQUhWSG9wWDV5Z2hqUQqIa5me+gv1MKwA
-iIxsKTrz9fe/i8qXwtRlxvr0rzGPr5hqLzd9UiRroRmhq7gg+swgr2JxGdhDneHT
-AWcMIjYKCiytP5tsrhVWC9bBLgEakvphCeza9xnz0/68QKy5MkTVT/guqi6lneHL
-Rjbb5XhWZ0POQc26+I8=
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/influx/master_token.age b/secrets/lollo/influx/master_token.age
@@ -1,13 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0N1VhMk4rbkprRGM2ZUJ2
-V0VBNXd4dnBVVG50bmRidllrTVFES3N2M0hFCmxuQVNqRGljY25BaGJnQjd5WW5s
-a3oyTmFPbDl5ZlFscGwzYTk0ZCtEekUKLT4gc3NoLWVkMjU1MTkgMXJjY0t3IEJD
-ZTFabDAxUXpRVGVhZSsyTEdTVTZpODE0aFgvQ3VibU1iZ1lVRE9OUkUKWmppKzVU
-U2lpU1VIVitaNG5VRHhacGhNek5JOWtURHhEU3JDMWIwVlI4ZwotPiBqLCVVLWdy
-ZWFzZQpubHFPTzVheVYzbGlxYzFpM2p3NGpOK25uL052R2VRY2svNXNYdjhDUmFJ
-ZGRlQnQyNEw0ems5eHRQdU1DUVZqCjlMcDJtT3ZGTm1QV1hPcUdFTW1yREwwVEls
-SkpvTjRQVndwNDJ0L2EKLS0tIFFaZThJTGRQSVZKQVRpQ2I5enZVWFBocGZ6QVhT
-VFBhcDhzcENhTnc5SHMKp2BQVGGY0gMwMeHg4Unh3po8Y3ZSYsm606Gtsb0LZX0O
-q4bjigHrDd/crilzK4bo0e3vvCoHuBMlk+sNpQiNXWQVKmrooW1EO3701w/v00l+
-xyLWN3VV+JKlKiywJTawSOtVVUdgUv7u7BOzCgSwME5MMylU6IUZ
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/influx/telegraf_token.age b/secrets/lollo/influx/telegraf_token.age
@@ -1,14 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBQelUwdmNXclp3MXVFai9w
-bGhvY2NYUm1SYmo4VUtvQlBKT2xEZ2FoaUZVClZSenY2ZGV4bG1DRnJIQ1RxTVpL
-VFJHdVYxLzdVQU1iUzd1SFNONHdqdnMKLT4gc3NoLWVkMjU1MTkgMXJjY0t3IDlL
-NE1vUXpaQlF1V2x4QUkwSTJaTW12ZmxsdGFPejVvVjA0cDdTUkZJeXMKbXhBejFw
-SHNuWXhFMUR3MERJd09CTU1iMU1BRjFudXhTSnV0SmVIWldqMAotPiB2N2hXXC1n
-cmVhc2UgIlggVgpCUzlJaFFnTjhUN1NaQ1l3WkRWS2RJbjRtcWJDdU9nRWVwcE5m
-RGRxY281eDZrV2RrOVRZazFOdGM2eVI3REVDCnRTRW5jVWEwa2toOHdBeU9DSVJi
-ZU9oam94SEptMXVIbEp5MTRNS0h1c1pnMHJZeFlWOU5uZmcKLS0tIDJ2OVM3QjZ5
-dC85MGtRUFVkbUlEWU95VlE1V0xHaWJHZ0xCR0tuYkE2NXcKBRw46vCIROVCkuyv
-jHt1ki+aEepd6eKHtFgHwrJlZtZ0bEfd+Nh6ejjYDxeFoCGIJvCfmH/zMB7rOlh0
-Iw48df0jV7xt5hqfrNNZzmjdaOazWZm0KDMvrOpQwyBLSZ5XYuEea3sV2vU6qjYn
-QGUWsOWgOVGZTXln
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/mosquitto/passwd-leah.age b/secrets/lollo/mosquitto/passwd-leah.age
@@ -1,11 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBEVDZjdnMvUXNHdVRrQ2Fk
-MnMyZjdXQUtGYUMyWCttUk9BNlY4Y3ErRkNRCi96aHZQdUtZZ2ZVMUNnNUlZRkhk
-NTdmb2x1SXp0c0lLQjI2WGUwZGdoOG8KLT4gc3NoLWVkMjU1MTkgMXJjY0t3IFlP
-aU9zWUNXaWx1aDhlL0w4eFEyK0dJdzZpZVkzcTc3bGdiNGxuWEtiMmMKNVVkeXlo
-KzlkeW96bDJvOGUvbjB1TDJWU1pkNzQ1blNnL2tHS2s0ZTAwawotPiB5KE5rWS1n
-cmVhc2UgZUJYCjBYcXNiUFRzb1NhOUtjdFkwdWJSNDNjeHdjd2IzUGFiM2xOMU16
-VFRkWXE4TXltVk55QUgwQkcwaXgwZlhpRksKcHI4MzBBZ3BvWTh4T2hRaWQ0Ywot
-LS0gR0RWMXlGVm84QzR5OW4zTnFZZ1Zwa0IvWFVFRFgrUGZJWHhDOFN1RVRmTQp4
-koulQxNAC0y3GTSHMI1uKb8Z5+KhEpYYpdCsWhsClm9mDeKKhNgB5g==
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/lollo/restic/influxdb.age b/secrets/lollo/restic/influxdb.age
@@ -1,13 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSByRjVrdGdkazRMTVYrenkr
-emlQZ0ZLNUoyMjZQdlI2YWZyMjdtQXlyRkdBCjFNaW5idUFEM2VLdklsSC9aSGxx
-c3piT05BWjNpTDNnNThxMWdISGFBT28KLT4gc3NoLWVkMjU1MTkgMXJjY0t3IHNk
-S2dXSjRaRituWUdUVEo2ZVpaTWJrT1dHaS9sV0hC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1o2RkQxYTJ3elNudVRxdldUN2g0WUpJL3R6RFhtZUoxUUNwcnNJCsQ6
-PfOtkXGPquheLjML6UL1m4Q1d3DRRnPPeEubUmaDfFQOdHJTRwGU8w5OLpfSrIkO
-6X0RS/Dn28wIXfYgy9KsITbKLh7wnRQnCMwJ07q50knYgUlZ54tV5QRrcDTl6swY
-6vRiLUeSUkmmyA9iGl53VKCxLQ==
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
@@ -29,24 +29,25 @@ in {
   "briefkasten/syncthing/key.age".publicKeys                  = [ leah briefkasten ];
   "briefkasten/syncthing/cert.age".publicKeys                 = [ leah briefkasten ];
 
+  "briefkasten/influx/grafana_token_mqttData.age".publicKeys   = [ leah briefkasten trabbi];
+  "briefkasten/influx/grafana_token_solaxData.age".publicKeys  = [ leah briefkasten trabbi];
+  "briefkasten/influx/telegraf_token_mqttData.age".publicKeys  = [ leah briefkasten ];
+  "briefkasten/influx/telegraf_token_solaxData.age".publicKeys = [ leah briefkasten ];
+  "briefkasten/influx/master_token.age".publicKeys             = [ leah briefkasten ];
+  "briefkasten/influx/backup_env.age".publicKeys               = [ leah briefkasten ];
 
-  "lollo/mosquitto/passwd-leah.age".publicKeys                = [ leah lollo ];
   "lollo/mosquitto/passwd-nrw.age".publicKeys                 = [ leah lollo ];
+  "briefkasten/mosquitto/passwd-leah.age".publicKeys          = [ leah briefkasten ];
 
-  "lollo/zigbee2mqtt/secrets.age".publicKeys                  = [ leah lollo ];
-  "lollo/telegraf_env.age".publicKeys                         = [ leah lollo ];
+  "briefkasten/zigbee2mqtt/secrets.age".publicKeys            = [ leah briefkasten ];
 
+  "briefkasten/telegraf/secrets.env.age".publicKeys           = [ leah briefkasten ];
 
-  "lollo/influx/grafana_token.age".publicKeys                 = [ leah lollo trabbi];
-  "lollo/influx/telegraf_token.age".publicKeys                = [ leah lollo ];
-  "lollo/influx/master_token.age".publicKeys                  = [ leah lollo ];
-  "lollo/influx/backup_env.age".publicKeys                    = [ leah lollo ];
 
   "lollo/restic-server-htpasswd.age".publicKeys               = [ leah lollo ];
 
   "lollo/restic/vnstat.age".publicKeys                        = [ leah lollo ];
   "lollo/restic/oeffisearch.age".publicKeys                   = [ leah lollo ];
-  "lollo/restic/influxdb.age".publicKeys                      = [ leah lollo ];
   "briefkasten/radicale-users.age".publicKeys                 = [ leah briefkasten ];
   "briefkasten/gotosocial-env.age".publicKeys                 = [ leah briefkasten ];
 

@@ -55,6 +56,7 @@ in {
 
   "briefkasten/restic/radicale.age".publicKeys                      = [ leah briefkasten ];
   "briefkasten/restic/gotosocial.age".publicKeys                    = [ leah briefkasten ];
+  "briefkasten/restic/influxdb.age".publicKeys                      = [ leah briefkasten ];
   "briefkasten/restic/ctucx-things.age".publicKeys                  = [ leah briefkasten ];
 
   "lollo/solar-nrw/vpn-secrets.age".publicKeys                = [ leah lollo ];