From 80e26067e64d854bbd31af1085ffc5ea7c814c26 Mon Sep 17 00:00:00 2001 From: Nicolas Liaudat Date: Thu, 16 May 2024 19:27:15 +0200 Subject: [PATCH] Add files via upload --- changelog.md | 8 ++ config.yaml | 255 ++++++++++++++++++------------------ heating_channel_linear.yaml | 28 ++-- heating_channel_tanh.yaml | 32 +++-- inputs.yaml | 12 +- 5 files changed, 179 insertions(+), 156 deletions(-) diff --git a/changelog.md b/changelog.md index 0d81796..e7bc4a3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,12 @@ # change log +## v113: +* add boost factor in inputs.yaml (can be used in hassio for forecast weather temperature boosts) +## v112: +* set the thermostat to single point only (dual point takes the mean of target_temperature_high and target_temperature_low and the hystereris is not taken into calculation) +## v111: +* heating_channel_PID.yaml: +add autotune button + sensors +delete interval check (useless) ## v110: * add heating_channel_remote_controlled.yaml template ## v109: diff --git a/config.yaml b/config.yaml index deb9da2..3866fe7 100644 --- a/config.yaml +++ b/config.yaml @@ -9,7 +9,7 @@ substitutions: name: floor-heating-controller friendly_name: "Floor heating" - revision: "1.110" + revision: "1.113" #board and compilation board: nodemcu-32s @@ -30,12 +30,12 @@ substitutions: # version: 3 # log: false -# Enable Home Assistant API +# Enable HOME Assistant API api: reboot_timeout: 30min -############## Channels definition (packages as template : https://esphome.io/guides/configuration-types.html#packages-as-templates) +############## Channels definition (packages as template : https://espHOME.io/guides/configuration-types.html#packages-as-templates) packages: ##### Sample PID config @@ -45,7 +45,7 @@ packages: # channel_number: 1 # id: wc #bad # frendly_name: wc #bad - # temperature_sensor: corridor_temperature_sensor #ATC_51C199_Temperature + # temperature_sensor: corridor_temperature_sensor # default_target_temperature: "21 °C" # pid_kp: "0.06" # pid_ki: "0.00011" @@ -53,7 +53,6 @@ packages: # visual_min_temperature: "10 °C" # visual_max_temperature: "30 °C" # visual_temperature_step: "0.1 °C" - # check_interval: "15min" # bemf_trigger_initial_value: "0.105" ### do not change : # bemf_sensor_adc: BEMF_1_2_sensor_ADC @@ -69,17 +68,17 @@ packages: # id: storage # frendly_name: storage # temperature_sensor: reduit_temperature_sensor - # default_preset: home - # preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - # preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + # default_preset: HOME + # preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + # preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY # preset_1_target_temperature_low: "19 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability # preset_1_target_temperature_high: "20 °C" - # preset_2_name: away - # preset_2_mode: HEAT_COOL + # preset_2_name: AWAY + # preset_2_mode: HEAT # preset_2_target_temperature_low: "18 °C" # preset_2_target_temperature_high: "19 °C" - # preset_3_name: boost - # preset_3_mode: HEAT_COOL + # preset_3_name: BOOST + # preset_3_mode: HEAT # preset_3_target_temperature_low: "23 °C" # preset_3_target_temperature_high: "24 °C" # visual_min_temperature: "10 °C" @@ -101,17 +100,17 @@ packages: # id: wc # frendly_name: wc # temperature_sensor: corridor_temperature_sensor #must match one sensor defined in sensor_temperature.yaml - # default_preset: home - # preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - # preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + # default_preset: HOME + # preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + # preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY # preset_1_target_temperature_low: "19 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability # preset_1_target_temperature_high: "20 °C" - # preset_2_name: away - # preset_2_mode: HEAT_COOL + # preset_2_name: AWAY + # preset_2_mode: HEAT # preset_2_target_temperature_low: "18 °C" # preset_2_target_temperature_high: "19 °C" - # preset_3_name: boost - # preset_3_mode: HEAT_COOL + # preset_3_name: BOOST + # preset_3_mode: HEAT # preset_3_target_temperature_low: "23 °C" # preset_3_target_temperature_high: "24 °C" # visual_min_temperature: "10 °C" @@ -134,17 +133,17 @@ packages: # id: wc # frendly_name: wc # temperature_sensor: corridor_temperature_sensor #must match one sensor defined in sensor_temperature.yaml - # default_preset: home - # preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - # preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + # default_preset: HOME + # preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + # preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY # preset_1_target_temperature_low: "19 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability # preset_1_target_temperature_high: "20 °C" - # preset_2_name: away - # preset_2_mode: HEAT_COOL + # preset_2_name: AWAY + # preset_2_mode: HEAT # preset_2_target_temperature_low: "18 °C" # preset_2_target_temperature_high: "19 °C" - # preset_3_name: boost - # preset_3_mode: HEAT_COOL + # preset_3_name: BOOST + # preset_3_mode: HEAT # preset_3_target_temperature_low: "23 °C" # preset_3_target_temperature_high: "24 °C" # visual_min_temperature: "10 °C" @@ -167,19 +166,19 @@ packages: id: wc frendly_name: wc temperature_sensor: corridor_temperature_sensor #must match one sensor defined in sensor_temperature.yaml - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - preset_1_target_temperature_low: "19 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "20 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY + preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -201,19 +200,19 @@ packages: id: storage frendly_name: storage temperature_sensor: reduit_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - preset_1_target_temperature_low: "19 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "20 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY + preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -229,25 +228,25 @@ packages: channel_3: !include - file: heating_channel_tanh.yaml + file: heating_channel_linear.yaml vars: channel_number: 3 id: living frendly_name: living temperature_sensor: living_room_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "23 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -268,19 +267,19 @@ packages: id: dining frendly_name: dining temperature_sensor: living_room_temperature_sensor #indoor_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "23 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -293,7 +292,7 @@ packages: sn74hc595_IA_pin: 6 sn74hc595_IB_pin: 7 - + channel_5: !include file: heating_channel_tanh.yaml vars: @@ -301,19 +300,26 @@ packages: id: kitchen frendly_name: kitchen temperature_sensor: living_room_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + # default_target_temperature: "21 °C" + # pid_kp: "0.06" + # pid_ki: "0.00011" + # pid_kd: "4.0" + # visual_min_temperature: "10 °C" + # visual_max_temperature: "30 °C" + # visual_temperature_step: "0.1 °C" + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "23 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -325,6 +331,7 @@ packages: bemf_linked_with_channel: 6 sn74hc595_IA_pin: 8 sn74hc595_IB_pin: 9 + channel_6: !include @@ -334,19 +341,19 @@ packages: id: office frendly_name: office temperature_sensor: office_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - preset_1_target_temperature_low: "20 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "21 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY + preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -367,19 +374,19 @@ packages: id: bedroom frendly_name: bedroom temperature_sensor: bedroom_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - preset_1_target_temperature_low: "16 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "18 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "16 °C" - preset_2_target_temperature_high: "18 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY + preset_1_target_temperature_low: "21 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability + # preset_1_target_temperature_high: "20 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "19 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "24 °C" + # preset_3_target_temperature_high: "24 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -400,19 +407,19 @@ packages: id: bathroom frendly_name: bathroom temperature_sensor: bathroom_temperature_sensor - default_preset: home - preset_1_name: home #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - preset_1_mode: HEAT_COOL #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY + default_preset: HOME + preset_1_name: HOME #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY + preset_1_mode: HEAT #OFF, AUTO, HEAT, COOL, HEAT, FAN_ONLY, DRY preset_1_target_temperature_low: "22 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability - preset_1_target_temperature_high: "24 °C" - preset_2_name: away - preset_2_mode: HEAT_COOL - preset_2_target_temperature_low: "18 °C" - preset_2_target_temperature_high: "19 °C" - preset_3_name: boost - preset_3_mode: HEAT_COOL - preset_3_target_temperature_low: "23 °C" - preset_3_target_temperature_high: "25 °C" + # preset_1_target_temperature_high: "24 °C" + preset_2_name: AWAY + preset_2_mode: HEAT + preset_2_target_temperature_low: "20 °C" + # preset_2_target_temperature_high: "19 °C" + preset_3_name: BOOST + preset_3_mode: HEAT + preset_3_target_temperature_low: "24 °C" + # preset_3_target_temperature_high: "25 °C" visual_min_temperature: "10 °C" visual_max_temperature: "30 °C" visual_temperature_step: "0.1 °C" @@ -430,17 +437,13 @@ packages: wifi: !include wifi.yaml board: !include board.yaml time: !include time.yaml - #climate: !include climate.yaml - #script_termostat_check: !include script_termostat_check.yaml script_calibrate_valves: !include script_calibrate_valves.yaml - #switch_gpio: !include switch_gpio.yaml switch_others: !include switch_others.yaml inputs: !include inputs.yaml - #covers: !include covers.yaml - #sensor_bemf: !include sensor_bemf.yaml #back electromotive force (back EMF) sensor_adc: !include sensor_adc.yaml sensor_temperature: !include sensor_temperature.yaml sensor_others: !include sensor_others.yaml + diff --git a/heating_channel_linear.yaml b/heating_channel_linear.yaml index e2aa475..7e15683 100644 --- a/heating_channel_linear.yaml +++ b/heating_channel_linear.yaml @@ -12,25 +12,25 @@ climate: preset: #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - name: ${preset_1_name} default_target_temperature_low: ${preset_1_target_temperature_low} - default_target_temperature_high: ${preset_1_target_temperature_high} + # default_target_temperature_high: ${preset_1_target_temperature_high} mode: ${preset_1_mode} #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - name: ${preset_2_name} default_target_temperature_low: ${preset_2_target_temperature_low} - default_target_temperature_high: ${preset_2_target_temperature_high} + # default_target_temperature_high: ${preset_2_target_temperature_high} mode: ${preset_2_mode} - name: ${preset_3_name} default_target_temperature_low: ${preset_3_target_temperature_low} - default_target_temperature_high: ${preset_3_target_temperature_high} + # default_target_temperature_high: ${preset_3_target_temperature_high} mode: ${preset_3_mode} - min_cooling_off_time: 300s - min_cooling_run_time: 300s + # min_cooling_off_time: 300s + # min_cooling_run_time: 300s min_heating_off_time: 300s min_heating_run_time: 300s min_idle_time: 30s heat_action: - lambda: 'return;' # do nothing cause action is triggered by time interval - cool_action: - - lambda: 'return;' + # cool_action: + # - lambda: 'return;' idle_action: - lambda: 'return;' visual: @@ -104,10 +104,11 @@ script: return; } // get info from climate - //float current_temp = id(${id}_thermostat).current_temperature; - //float target_temp_low = id(${id}_thermostat).target_temperature_low; + float current_temp = id(${id}_thermostat).current_temperature; + float target_temp_low = id(${id}_thermostat).target_temperature_low; //float target_temp_high = id(${id}_thermostat).target_temperature_high ; //float diff_temp = (target_temp_high + target_temp_low)/2 - current_temp; + float diff_temp = target_temp_low - current_temp; // get info from cover //float current_position = id(CH${channel_number}_cover).position; @@ -116,12 +117,15 @@ script: //simplified => f(x) = (x+1)/2 //rounded at 0.1 => f(x) = round(((x+1)/2)/0.1)*0.1 //float target_position = round(((diff_temp+1)/2)/0.1)*0.1; - float target_position = round(((((id(${id}_thermostat).target_temperature_high + id(${id}_thermostat).target_temperature_low)/2 - id(${id}_thermostat).current_temperature)+1)/2)/0.1)*0.1; + //float target_position = round(((((id(${id}_thermostat).target_temperature_high + id(${id}_thermostat).target_temperature_low)/2 - id(${id}_thermostat).current_temperature)+1)/2)/0.1)*0.1; + float target_position = round(((diff_temp+1)/2)/0.1)*0.1; + + target_position = target_position * (id(heating_controller_boost_factor).state)/100; //normalize if (target_position >1) { target_position = 1;} if (target_position <0) { target_position = 0;} - + //call movement if target_position change consequently if (abs(id(CH${channel_number}_cover).position - target_position) > id(min_movement).state/100) { auto call = id(CH${channel_number}_cover).make_call(); @@ -129,7 +133,7 @@ script: call.perform(); ESP_LOGD("main", "Adjustment done for CH${channel_number} set to position %.2f%%", target_position); } else { - ESP_LOGD("main", "No adjustment done for CH${channel_number} cause min movement (%.2f%%) is not reached", id(min_movement).state); + ESP_LOGD("main", "No adjustment done for CH${channel_number} to target position %.2f%% cause min movement (%.2f%%) is not reached", target_position, id(min_movement).state); } ### back electromotive force (back EMF) diff --git a/heating_channel_tanh.yaml b/heating_channel_tanh.yaml index 61c4e69..856d6c3 100644 --- a/heating_channel_tanh.yaml +++ b/heating_channel_tanh.yaml @@ -12,25 +12,25 @@ climate: preset: #ECO, AWAY, BOOST, COMFORT, HOME, SLEEP, ACTIVITY - name: ${preset_1_name} default_target_temperature_low: ${preset_1_target_temperature_low} - default_target_temperature_high: ${preset_1_target_temperature_high} + # default_target_temperature_high: ${preset_1_target_temperature_high} mode: ${preset_1_mode} #OFF, AUTO, HEAT, COOL, HEAT_COOL, FAN_ONLY, DRY - name: ${preset_2_name} default_target_temperature_low: ${preset_2_target_temperature_low} - default_target_temperature_high: ${preset_2_target_temperature_high} + # default_target_temperature_high: ${preset_2_target_temperature_high} mode: ${preset_2_mode} - name: ${preset_3_name} default_target_temperature_low: ${preset_3_target_temperature_low} - default_target_temperature_high: ${preset_3_target_temperature_high} + # default_target_temperature_high: ${preset_3_target_temperature_high} mode: ${preset_3_mode} - min_cooling_off_time: 300s - min_cooling_run_time: 300s + # min_cooling_off_time: 300s + # min_cooling_run_time: 300s min_heating_off_time: 300s min_heating_run_time: 300s min_idle_time: 30s heat_action: - lambda: 'return;' # do nothing cause action is triggered by time interval - cool_action: - - lambda: 'return;' + # cool_action: + # - lambda: 'return;' idle_action: - lambda: 'return;' visual: @@ -106,8 +106,9 @@ script: // get info from climate float current_temp = id(${id}_thermostat).current_temperature; float target_temp_low = id(${id}_thermostat).target_temperature_low; - float target_temp_high = id(${id}_thermostat).target_temperature_high ; - float diff_temp = (target_temp_high + target_temp_low)/2 - current_temp; + //float target_temp_high = id(${id}_thermostat).target_temperature_high ; + //float diff_temp = (target_temp_high + target_temp_low)/2 - current_temp; + float diff_temp = target_temp_low - current_temp; // get info from cover //float current_position = id(CH${channel_number}_cover).position; @@ -119,19 +120,16 @@ script: // Calculate valve position using non-linear mapping function float target_position = A_heating * tanh(B_heating * diff_temp + C_heating); - - // Normalize the valve position to range [0, 1] using a sigmoid-like transformation - // float target_position = 0.5 * (tanh(0.1 * target_position) + 1.0); - + // Clip normalized valve position to ensure it's within [0, 1] - target_position = fmax(0.0, fmin(1.0, target_position)); + //target_position = fmax(0.0, fmin(1.0, target_position)); - //float target_position = round(target_position/0.1)*0.1; + target_position = target_position * (id(heating_controller_boost_factor).state)/100; //normalize if (target_position >1) { target_position = 1;} if (target_position <0) { target_position = 0;} - + //call movement if target_position change consequently if (abs(id(CH${channel_number}_cover).position - target_position) > id(min_movement).state/100) { auto call = id(CH${channel_number}_cover).make_call(); @@ -139,7 +137,7 @@ script: call.perform(); ESP_LOGD("main", "Adjustment done for CH${channel_number} set to position %.2f%%", target_position); } else { - ESP_LOGD("main", "No adjustment done for CH${channel_number} cause min movement (%.2f%%) is not reached", id(min_movement).state); + ESP_LOGD("main", "No adjustment done for CH${channel_number} to target position %.2f%% cause min movement (%.2f%%) is not reached", target_position, id(min_movement).state); } ### back electromotive force (back EMF) diff --git a/inputs.yaml b/inputs.yaml index 7fc9868..6b54868 100644 --- a/inputs.yaml +++ b/inputs.yaml @@ -9,4 +9,14 @@ number: step: 1 restore_value: true initial_value: 5 - id: min_movement \ No newline at end of file + id: min_movement + + - platform: template + name: "Heating boost factor %" + optimistic: true + min_value: 10 + max_value: 1000 + step: 1 + restore_value: false + initial_value: 100 ## 100 makes no changes as (target_position * heating_controller_boost_factor/100) + id: heating_controller_boost_factor \ No newline at end of file