summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/lib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack/glados/lib/default.nix')
-rw-r--r--krebs/2configs/shack/glados/lib/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix
new file mode 100644
index 000000000..debe8e5c2
--- /dev/null
+++ b/krebs/2configs/shack/glados/lib/default.nix
@@ -0,0 +1,46 @@
+let
+ lib = import <nixpkgs/lib>;
+ prefix = "glados";
+in
+{
+ esphome =
+ {
+ temp = name:
+ {
+ platform = "mqtt";
+ name = "${name} Temperature";
+ device_class = "temperature";
+ state_topic = "${prefix}/${name}/sensor/temperature/state";
+ availability_topic = "${prefix}/${name}/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ };
+ hum = name:
+ {
+ platform = "mqtt";
+ device_class = "humidity";
+ name = "${name} Humidity";
+ state_topic = "${prefix}/${name}/sensor/humidity/state";
+ availability_topic = "${prefix}/${name}/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ };
+ };
+ tasmota =
+ {
+ plug = name: topic:
+ {
+ platform = "mqtt";
+ inherit name;
+ state_topic = "sonoff/stat/${topic}/POWER1";
+ command_topic = "sonoff/cmnd/${topic}/POWER1";
+ availability_topic = "sonoff/tele/${topic}/LWT";
+ payload_on= "ON";
+ payload_off= "OFF";
+ payload_available= "Online";
+ payload_not_available= "Offline";
+ retain = false;
+ qos = 1;
+ };
+ };
+}