From fedd3afd384ef0a663df4e702d80888d067675b3 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 17 Oct 2024 21:11:06 +0100 Subject: [PATCH] Ramp up flow temp slowly --- heishamon.yaml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/heishamon.yaml b/heishamon.yaml index ac24a70..78a10fd 100644 --- a/heishamon.yaml +++ b/heishamon.yaml @@ -106,9 +106,9 @@ mqtt: svalue1 = x["svalue1"].as(); id(tell_domo_svalue)->execute(908, std::to_string(svalue1/2)); 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); + id(target_flow_temp) = 30.0 + (svalue1 / 8.0); + ESP_LOGI("Evohome", "Boiler set to %d/%d, target flow temp set to %f °C", nvalue, svalue1, id(target_flow_temp)); + id(adjust_flow_temp).execute(); } break; } @@ -432,10 +432,27 @@ text_sensor: # miso_pin: GPIO13 globals: - - id: flow_temp + - id: target_flow_temp type: float restore_value: no +# Don't make the flow temp jump up too quickly. Only let it get 2°C higher than the +# actual flow temp, to avoid firing up both heat pumps if the heat demand from the +# house isn't smooth enough. +script: + - id: adjust_flow_temp + mode: restart + then: + - lambda: |- + float set_next = id(target_flow_temp); + if (!set_next || !id(auto_flow_temp).state) + return; + float cur_flow_temp = id(hp_feed_temp).state; + if (set_next > cur_flow_temp + 2.0) + set_next = cur_flow_temp + 2.0; + ESP_LOGI("Evohome", "Flow temp set to %f °C (want %f °C)", set_next, id(target_flow_temp)); + id(ecodan_instance).set_flow_target_temperature(set_next, esphome::ecodan::SetZone::ZONE_1); + # relay switch: - platform: template @@ -445,11 +462,7 @@ switch: 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); - } + - script.execute: adjust_flow_temp - platform: gpio pin: GPIO5 @@ -482,3 +495,10 @@ ecodan: id: ecodan_instance uart_id: uart_ecodan proxy_uart_id: uart_proxy + +interval: + - interval: 30s + then: + - lambda: |- + if (id(target_flow_temp) && id(auto_flow_temp).state) + id(adjust_flow_temp).execute(); -- 2.49.0