]> mj.ucw.cz Git - home-hw.git/commitdiff
Auto: Better logic for loft fan
authorMartin Mares <mj@ucw.cz>
Sun, 17 Jul 2022 10:18:50 +0000 (12:18 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 17 Jul 2022 10:18:50 +0000 (12:18 +0200)
auto/burrow-auto

index d4ac3811829e0748adfbd6cd008cba8e096bf29c..dbcd822e1fea00d35b25dc27c5c834c96f365064 100755 (executable)
@@ -133,23 +133,24 @@ st = State()
 def auto_loft_fan():
     global st
     lt = st.get_sensor_avg("temp/loft")
-    out = st.get_sensor_avg('air/inside-intake')
+    out = st.get_sensor_avg('air/outside-intake')
 
     if lt is None or out is None:
         fs = 0
     elif st.hysteresis('lf_out_cold', out, 5, 6) < 0:
         fs = 0
-    elif st.hysteresis('lf_out_cool', out, 6, 15) < 0:
+    elif st.hysteresis('lf_out_cool', out, 14, 15) < 0:
         if st.min in range(10, 15):
             fs = 2
         else:
             fs = 0
     elif ac_is_on() > 0:
         fs = 3
-    elif st.hysteresis('lf_loft_hot', lt, out - 1, out + 1) > 0:
-        fs = 3
-    else:
-        fs = 0
+    elif st.hysteresis('lf_loft_hot', lt, 23, 24) > 0:
+        if st.hysteresis('lf_loft_hotter_than_out', lt, out - 1, out + 1) > 0:
+            fs = 3
+        else:
+            fs = 1
 
     st.set("loft/fan", fs)
 
@@ -219,7 +220,7 @@ def auto_aircon():
     tii = st.get_sensor_avg('air/inside-intake')
     tie = st.get_sensor_avg('air/inside-exhaust')
     house_hot = st.hysteresis('ac_house_hot', tii, 23.5, 24)
-    outside_hot = st.hysteresis('ac_outside_hot', tie, 20, 21)
+    outside_hot = st.hysteresis('ac_outside_hot', tie, 24, 25)
     ac_on = ac_is_on()
 
     if house_hot > 0 and outside_hot > 0: