- lt = st.get_sensor("temp/loft")
- lt_high = st.hysteresis('lt_high', lt, 29, 30)
- lt_mid = st.hysteresis('lt_mid', lt, 24, 25)
- if lt_high > 0:
+ lt = st.get_sensor_avg("temp/loft")
+ out = st.get_sensor_avg('air/outside-intake')
+
+ if False and st.hour in range(21, 24) or st.hour in range(6, 10):
+ fs = 0
+ elif 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, 14, 15) < 0:
+ if st.min in range(10, 15):
+ fs = 2
+ else:
+ fs = 0
+ elif ac_is_on() > 0: