summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/sensors/hass.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-09-02 13:57:06 +0200
committermakefu <github@syntax-fehler.de>2019-09-02 13:57:06 +0200
commite4c836b9c4901f99fe870dae8c338dbe648494ac (patch)
tree926dbeffadcf1aab6dc69cfb84c5efa4d79ff941 /krebs/2configs/shack/glados/sensors/hass.nix
parent86592a723309d45dc09ff90872c0ee4aa7e52dc0 (diff)
shack/glados: init home-assistant config
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" ])