From: David Woodhouse Date: Wed, 16 Oct 2024 20:49:34 +0000 (+0100) Subject: Make auto flow temp properly optional X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=983dca4d56cb56b3b9bd7d233b80a567e22b744c;p=users%2Fdwmw2%2Fesp32-pool.git Make auto flow temp properly optional --- diff --git a/heishamon.yaml b/heishamon.yaml index d3c18d0..ac24a70 100644 --- a/heishamon.yaml +++ b/heishamon.yaml @@ -104,10 +104,12 @@ mqtt: switch (idx) { case 87: /* Boiler */ { svalue1 = x["svalue1"].as(); - float flow_temp = 30.0 + (svalue1 / 8.0); - ESP_LOGI("Evohome", "Boiler set to %d/%d, flow temp NOT set to %f °C", nvalue, svalue1, flow_temp); id(tell_domo_svalue)->execute(908, std::to_string(svalue1/2)); - //id(ecodan_instance).set_flow_target_temperature(flow_temp, esphome::ecodan::SetZone::ZONE_1); + if (id(auto_flow_temp).state) { + id(flow_temp) = 30.0 + (svalue1 / 8.0); + ESP_LOGI("Evohome", "Boiler set to %d/%d, flow temp set to %f °C", nvalue, svalue1, id(flow_temp)); + id(ecodan_instance).set_flow_target_temperature(id(flow_temp), esphome::ecodan::SetZone::ZONE_1); + } break; } case 94: /* Lounge (N) Valve */ @@ -429,8 +431,26 @@ text_sensor: # clk_pin: GPIO12 # miso_pin: GPIO13 +globals: + - id: flow_temp + type: float + restore_value: no + # relay switch: + - platform: template + restore_mode: RESTORE_DEFAULT_ON + id: auto_flow_temp + name: "Auto flow temp" + optimistic: true + on_turn_on: + then: + - lambda: |- + if (id(flow_temp)) { + ESP_LOGI("Evohome", "Flow temp set to %f °C", id(flow_temp)); + id(ecodan_instance).set_flow_target_temperature(id(flow_temp), esphome::ecodan::SetZone::ZONE_1); + } + - platform: gpio pin: GPIO5 restore_mode: ALWAYS_ON