Skip to content

Commit

Permalink
V114
Browse files Browse the repository at this point in the history
* change two points target to one point only : climate target_temperature_low to target_temperature
* CLIMATE_MODE_OFF now set valve position to 0 instead of stay in last position (for linear and tanh modes)
  • Loading branch information
nliaudat authored Jun 3, 2024
1 parent c694db6 commit bba286a
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 116 deletions.
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# change log
## v114:
* change two points target to one point only : climate target_temperature_low to target_temperature
* CLIMATE_MODE_OFF now set valve position to 0 instead of stay in last position (for linear and tanh modes)
* back to webserver v2 as v3 is unusable
## 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)
* set the thermostat to single point only (dual point takes the mean of target_temperature_low_high and target_temperature_low and the hystereris is not taken into calculation)
## v111:
* heating_channel_PID.yaml:
add autotune button + sensors
Expand Down
88 changes: 45 additions & 43 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ substitutions:
onboot_valve_calibration_delay: "1min"


# web_server:
# port: 80
# version: 3
# log: false
web_server:
port: 80
#version: 3
log: true
local: false #true in case of no internet

# Enable HOME Assistant API
api:
Expand All @@ -46,7 +47,7 @@ packages:
# id: wc #bad
# frendly_name: wc #bad
# temperature_sensor: corridor_temperature_sensor
# default_target_temperature: "21 °C"
# default_target_temperature_low: "21 °C"
# pid_kp: "0.06"
# pid_ki: "0.00011"
# pid_kd: "4.0"
Expand All @@ -72,15 +73,15 @@ packages:
# 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_1_target_temperature_low_high: "20 °C"
# preset_2_name: AWAY
# preset_2_mode: HEAT
# preset_2_target_temperature_low: "18 °C"
# preset_2_target_temperature_high: "19 °C"
# preset_2_target_temperature_low_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_low_high: "24 °C"
# visual_min_temperature: "10 °C"
# visual_max_temperature: "30 °C"
# visual_temperature_step: "0.1 °C"
Expand All @@ -104,15 +105,15 @@ packages:
# 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_1_target_temperature_low_high: "20 °C"
# preset_2_name: AWAY
# preset_2_mode: HEAT
# preset_2_target_temperature_low: "18 °C"
# preset_2_target_temperature_high: "19 °C"
# preset_2_target_temperature_low_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_low_high: "24 °C"
# visual_min_temperature: "10 °C"
# visual_max_temperature: "30 °C"
# visual_temperature_step: "0.1 °C"
Expand All @@ -137,15 +138,15 @@ packages:
# 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_1_target_temperature_low_high: "20 °C"
# preset_2_name: AWAY
# preset_2_mode: HEAT
# preset_2_target_temperature_low: "18 °C"
# preset_2_target_temperature_high: "19 °C"
# preset_2_target_temperature_low_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_low_high: "24 °C"
# visual_min_temperature: "10 °C"
# visual_max_temperature: "30 °C"
# visual_temperature_step: "0.1 °C"
Expand All @@ -170,15 +171,16 @@ packages:
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_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_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -204,15 +206,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -228,7 +230,7 @@ packages:


channel_3: !include
file: heating_channel_linear.yaml
file: heating_channel_tanh.yaml
vars:
channel_number: 3
id: living
Expand All @@ -238,15 +240,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -271,15 +273,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -300,7 +302,7 @@ packages:
id: kitchen
frendly_name: kitchen
temperature_sensor: living_room_temperature_sensor
# default_target_temperature: "21 °C"
# default_target_temperature_low: "21 °C"
# pid_kp: "0.06"
# pid_ki: "0.00011"
# pid_kd: "4.0"
Expand All @@ -311,15 +313,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -345,15 +347,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -377,16 +379,16 @@ packages:
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_1_target_temperature_low: "18 °C" #ASHRAE studies recommend 21°C with a band of 2°C which result in 90% occupant acceptability
# preset_1_target_temperature_low_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_2_target_temperature_low: "18 °C"
# preset_2_target_temperature_low_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_low: "19 °C"
# preset_3_target_temperature_low_high: "24 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand All @@ -411,15 +413,15 @@ packages:
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_1_target_temperature_low_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_2_target_temperature_low_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"
# preset_3_target_temperature_low_high: "25 °C"
visual_min_temperature: "10 °C"
visual_max_temperature: "30 °C"
visual_temperature_step: "0.1 °C"
Expand Down
34 changes: 25 additions & 9 deletions heating_channel_linear.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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_low_high: ${preset_1_target_temperature_low_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_low_high: ${preset_2_target_temperature_low_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_low_high: ${preset_3_target_temperature_low_high}
mode: ${preset_3_mode}
# min_cooling_off_time: 300s
# min_cooling_run_time: 300s
Expand Down Expand Up @@ -96,7 +96,22 @@ script:
- id: TH${channel_number}_check
then:
- lambda: |-
if (id(${id}_thermostat).mode == CLIMATE_MODE_OFF) {return;}
if (id(${id}_thermostat).mode == CLIMATE_MODE_OFF) {
if (id(CH${channel_number}_cover).position > 0) {
auto call = id(CH${channel_number}_cover).make_call();
call.set_position(0);
call.perform();
ESP_LOGD("main", "Adjustment done for CH${channel_number} set to position 0 as CH${channel_number} is OFF ");
}
else{
ESP_LOGD("main", "CH${channel_number} is OFF and at 0 position");
}
return;
}
if (id(${id}_thermostat).preset == CLIMATE_PRESET_SLEEP ) {
ESP_LOGD("main", "CH${channel_number} is sleeping - no position change ");
return;
}
ESP_LOGD("main", "TH${channel_number}_check triggered");
// check if any others actuator is running. If yes, stop action and return.
if (id(CH${bemf_linked_with_channel}_cover).current_operation != COVER_OPERATION_IDLE) {
Expand All @@ -105,10 +120,11 @@ 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 target_temp = id(${id}_thermostat).target_temperature_low;
//float target_temp_low = id(${id}_thermostat).target_temperature_low_low;
//float target_temp_high = id(${id}_thermostat).target_temperature_low_high ;
//float diff_temp = (target_temp_high + target_temp_low)/2 - current_temp;
float diff_temp = target_temp_low - current_temp;
float diff_temp = target_temp - current_temp;
// get info from cover
//float current_position = id(CH${channel_number}_cover).position;
Expand All @@ -117,7 +133,7 @@ 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_low_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;
Expand All @@ -131,7 +147,7 @@ script:
auto call = id(CH${channel_number}_cover).make_call();
call.set_position(target_position);
call.perform();
ESP_LOGD("main", "Adjustment done for CH${channel_number} set to position %.2f%%", target_position);
ESP_LOGD("main", "Adjustment done for CH${channel_number} set to position %.2f%% (boost=%.2f%%)", target_position, id(heating_controller_boost_factor).state);
} else {
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);
}
Expand Down
Loading

0 comments on commit bba286a

Please sign in to comment.