]> mj.ucw.cz Git - home-hw.git/commitdiff
Auto: Broadcast computed AC state
authorMartin Mares <mj@ucw.cz>
Sun, 2 Jul 2023 14:56:46 +0000 (16:56 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 2 Jul 2023 14:56:46 +0000 (16:56 +0200)
MQTT
auto/burrow-auto

diff --git a/MQTT b/MQTT
index 3847b224ead6e48fd714685d16e2dd7b3d51c494..1e152640006b08f19b1c70eafb2efb553fa6ba09 100644 (file)
--- a/MQTT
+++ b/MQTT
@@ -9,11 +9,14 @@ burrow/air/inside-intake
 burrow/air/mixed
 burrow/air/outside-exhaust
 burrow/air/outside-intake
+burrow/air/ac-on               0-1 (computed by burrow-auto)
 
 burrow/auto/air                        0-1 [control, default=1]
 burrow/auto/circ               0-1 [control, default=1]
 burrow/auto/loft-fan           0-1 [control, default=1]
 
+burrow/avg/*                   smoothed-out measurements produced by burrow-auto
+
 burrow/power/current/l1
 burrow/power/current/l2
 burrow/power/current/l3
index 297772ab6e283f5abcb3ee60c2177ef7b7392243..7aaca0f74da5a77011c14007872a5987e2d2ae47 100755 (executable)
@@ -238,6 +238,11 @@ def auto_air():
 
     debug("Air: house_warm={} house_hot={} ac_on={} outside_warmer={} mixed_warmer={}".format(house_warm, house_hot, ac_on, outside_warmer, mixed_warmer))
 
+    if ac_on != 0:
+        st.set("air/ac-on", "{} {}".format(1 if ac_on > 0 else 0, int(st.now)))
+    else:
+        st.set("air/ac-on", "")
+
 
 def auto_aircon():
     global st