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.
// 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;
}
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