]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
Open bypass valve when turning pump on even when the roof is warm
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 15 May 2024 10:13:39 +0000 (11:13 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 15 May 2024 10:13:39 +0000 (11:13 +0100)
It *still* might be colder than the water temperature, and there's no
harm in letting it keep warming up for another minute.

Also stop writing the valve state to flash each time it changes.

pool.yaml

index 0d2ed722063d3b35318e8124d91d7b3b2af22b22..81802ddc44bc527b8e27bec4ad0786dc98effb36 100644 (file)
--- a/pool.yaml
+++ b/pool.yaml
@@ -181,8 +181,9 @@ script:
 
             // Turn pump off if it's warm enough, between 7am and 10am (when it comes on anyway).
             if (t.hour > 7 && t.hour < 10 && outtemp >= 20.0 && !id(pool_pump).state) {
-                    ESP_LOGD("control_value", "Roof temperature over 20°C. Turning pump on.");
+                    ESP_LOGD("control_value", "Roof temperature over 20°C. Turning pump ON and valve OFF.");
                     id(pool_pump).turn_on();
+                    id(valve_output).turn_off();
             }
             return;
         }
@@ -744,7 +745,7 @@ switch:  #### To switch on and off the communication with the BLE device ####
     id: valve_output
     name: "Valve switch"
     pin: GPIO14
-    restore_mode: RESTORE_DEFAULT_OFF
+    restore_mode: ALWAYS_OFF
     on_turn_on:
       then:
         - light.turn_on: green_led