Skip to content

heating_channel_linear

Nicolas Liaudat edited this page May 16, 2024 · 1 revision

The linear calculation in heating_channel_linear.yaml.

It take the (target temperature)- (real temperature) and map it from 0=full closed to 1=full open

linear_plot

"round(((((id(${ch1_thermostat_name}_thermostat).target_temperature_high + id(${ch1_thermostat_name}_thermostat).target_temperature_low)/2 - id(${ch1_thermostat_name}_thermostat).current_temperature)+1)/2)/0.1)*0.1;"

             #################
            # Formula explanation : 
            #################
            # // get info from climate sensors
            # float current_temp = id(${ch1_thermostat_name}_thermostat).current_temperature;
            # float target_temp_low = id(${ch1_thermostat_name}_thermostat).target_temperature_low;
            # float target_temp_high = id(${ch1_thermostat_name}_thermostat).target_temperature_high ;
            # float diff_temp = (target_temp_high + target_temp_low)/2 - current_temp;
            #               
            # //arduino map function :  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; in_min=-1;in_max=1;out_min=0;out_max=1
            # //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(${ch1_thermostat_name}_thermostat).target_temperature_high + id(${ch1_thermostat_name}_thermostat).target_temperature_low)/2 - id(${ch1_thermostat_name}_thermostat).current_temperature)+1)/2)/0.1)*0.1;
Clone this wiki locally