]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
Force bypass valve open before timed pump switch-on at 10am
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 13 May 2024 09:56:33 +0000 (10:56 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 13 May 2024 09:56:33 +0000 (10:56 +0100)
No point doing this at 6:59 now, as the pump doesn't come on
unconditionally at 7am any more.

pool.yaml

index 8a4f8c2c36753c7a36b754000ea0ce6f94f41142..1557a38078d4d9eef550eb6c423b786d4465db8b 100644 (file)
--- a/pool.yaml
+++ b/pool.yaml
@@ -245,7 +245,7 @@ time:
                 # Turn them off and on again.
                 script.execute: bounce_1w_power
 
-        # Turn pool pump on at 7am and off at 7pm
+        # Ensure the pool pump is on by 10am and off by 7pm
       - seconds: 0
         minutes: 0
         hours: 10,19
@@ -254,25 +254,31 @@ time:
             id: pump_default
             force: true
 
-        # Before turning the pump on in the morning, both 'solar in'
-        # both 'solar in' and 'solar out' sensors will be reading the
-        # ambient temperature, as no water is flowing. So open the
-        # bypass valve (pump directly back to pool) and set the
-        # control_valve_last_change time so that the temperature logic
-        # in the control_valve script won't close it again for at
-        # least five minutes. By which time the 'solar in' sensor
-        # should be giving *water* temperature, so we won't close the
-        # valve until the roof genuinely is warmer than the
+        # Before turning the pump on in the morning, both 'solar in' and
+        # 'solar out' sensors will be reading their respective ambient
+        # temperatures, as no water is flowing. So open the bypass valve
+        # (pump directly back to pool) and set the control_valve_last_change
+        # time so that the temperature logic in the control_valve script
+        # won't close it again for at least five minutes. By which time the
+        # 'solar in' sensor should be giving *water* temperature, so we
+        # won't close the valve until the roof genuinely is warmer than the
         # water. This means we don't use the pool water to heat up the
-        # rubber and plastic sitting on the roof; let the *sun* do
-        # that first!
+        # rubber and plastic sitting on the roof; let the *sun* do that
+        # first!
+        #
+        # This was most important when the pump was just coming on at 7am
+        # unconditionally. Now it doesn't come on until the roof gets to
+        # 20°C and only turns on unconditionally (for filtering purposes) at
+        # 10am. So do it at 09:59 *if* the pump isn't already running.
       - seconds: 0
         minutes: 59
-        hours: 6
+        hours: 9
         then:
           lambda: |-
-             id(control_valve_last_change) = ::time(NULL);
-             id(valve_output).turn_off();
+             if (!id(pool_pump).state) {
+                     id(control_valve_last_change) = ::time(NULL);
+                     id(valve_output).turn_off();
+             }
 
     on_time_sync:
       then: