From: David Woodhouse <dwmw@amazon.co.uk> Date: Wed, 15 May 2024 10:13:39 +0000 (+0100) Subject: Open bypass valve when turning pump on even when the roof is warm X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a62d01aa79319423704ebc125fdfb78d5d7adba7;p=users%2Fdwmw2%2Fesp32-pool.git Open bypass valve when turning pump on even when the roof is warm 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. --- diff --git a/pool.yaml b/pool.yaml index 0d2ed72..81802dd 100644 --- 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