summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/sensors/power.nix
diff options
context:
space:
mode:
authorJeschli <jeschli@gmail.com>2020-04-14 20:36:21 +0200
committerJeschli <jeschli@gmail.com>2020-04-14 20:36:21 +0200
commite5342b25c149f05db86983f3785ee395c156b435 (patch)
treee45270c08010c48c27a22643bd9a3a343b880eae /krebs/2configs/shack/glados/sensors/power.nix
parent290b6a542527a0a48c11fc2b00aee2b4d7f7df06 (diff)
parent843a537bd7fbedd8eb5fd61a1172dd8229440606 (diff)
Merge branch 'master' of https://cgit.lassul.us/stockholm
Diffstat (limited to 'krebs/2configs/shack/glados/sensors/power.nix')
-rw-r--r--krebs/2configs/shack/glados/sensors/power.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/krebs/2configs/shack/glados/sensors/power.nix b/krebs/2configs/shack/glados/sensors/power.nix
index 1aa250a19..b168f2beb 100644
--- a/krebs/2configs/shack/glados/sensors/power.nix
+++ b/krebs/2configs/shack/glados/sensors/power.nix
@@ -2,7 +2,6 @@ let
power_x = name: phase:
{ platform = "mqtt";
name = "${phase} ${name}";
- # device_class = "power";
state_topic = "/power/total/${phase}/${name}";
availability_topic = "/power/lwt";
payload_available = "Online";
@@ -11,17 +10,17 @@ let
power_consumed =
{ platform = "mqtt";
name = "Power Consumed";
- #device_class = "power";
+ device_class = "power";
state_topic = "/power/total/consumed";
availability_topic = "/power/lwt";
payload_available = "Online";
payload_not_available = "Offline";
};
power_volt = power_x "Voltage";
- power_watt = power_x "Power";
+ power_watt = (power_x "Power") ;
power_curr = power_x "Current";
in
(map power_volt [ "L1" "L2" "L3" ])
-++ (map power_watt [ "L1" "L2" "L3" ])
+++ (map (x: ((power_watt x) // { device_class = "power"; })) [ "L1" "L2" "L3" ])
++ (map power_curr [ "L1" "L2" "L3" ])
++ [ power_consumed ]