summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/sensors/hass.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack/glados/sensors/hass.nix')
-rw-r--r--krebs/2configs/shack/glados/sensors/hass.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/2configs/shack/glados/sensors/hass.nix b/krebs/2configs/shack/glados/sensors/hass.nix
new file mode 100644
index 000000000..634758701
--- /dev/null
+++ b/krebs/2configs/shack/glados/sensors/hass.nix
@@ -0,0 +1,22 @@
+let
+ esphome_temp = name:
+ { platform = "mqtt";
+ name = "${name} Temperature";
+ device_class = "temperature";
+ state_topic = "glados/${name}/sensor/temperature/state";
+ availability_topic = "glados/${name}/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ };
+ esphome_hum = name:
+ { platform = "mqtt";
+ device_class = "humidity";
+ name = "${name} Humidity";
+ state_topic = "glados/${name}/sensor/humidity/state";
+ availability_topic = "glados/${name}/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ };
+in
+ (map esphome_temp [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])
+ ++ (map esphome_hum [ "lounge" "werkstatt" "herrenklo" "dusche" "fablab" "whc" ])