[Custom component] Smart Autotune Thermostat

I thing we can solve this issue by dynamically recalibrating the minimum_setpoint of system while in use.

Yes value 5 is the most aggressive PID tuning. You probably need the value 2, in order to achieve a smooth heat pump operation.

Hi, first of all thanks for the integration! I have two questions:

  1. Is it possible to start the calibration manually?

2. I am using the OTGW in stand-alone mode because my boiler (Remeha Avanta Ace 35c) doesn’t support setpoint override. During the SAT configuration I configured my indoor and outdoor sensors so that I can use the OTGW as a thermostat for my living room.
In two other rooms I have a Tuya thermostatic radiator valve to control the temperature. How do I configure multi-room? I can configure the two Tuya thermostats for the rooms, but I can’t select my (SAT) main thermostat.

I am using SAT version 2.3.2-beta and have configured a serial connection to the OTGW (because the ethernet module doesn’t support MQTT).

EDIT: I think I have solved my second question. I have underfloor heating in my living room. I was already using a smart plug to turn the pump for the underfloor heating on and off. So I created a new climate in my configuration.yaml

climate:
  - platform: generic_thermostat
    name: Living_room
    heater: switch.pump_underfloor_heating
    target_sensor: sensor.temp_sensor_living_room

I configured this climate as the main climate in the SAT config.
The pump now also switches on and off automatically based on the temperature, so I can turn off my automation.

I only see a lot of Control Setpoint synchronisation (?) errors in my logbook:

Hi, I think you should try the develop SAT version. We made a lot of changes in the component since 2.3.2 version. You need to delete your existing integration in Settings → Devices → SAT → 3 dots → Delete. Then redownload from HACS the develop version and restart HA. All the needed settings are in the config flow, even overshoot_protection calibration. Then you need to go to Settings → Devices → SAT → Configure → General in order to select your heating curve coefficient and Max Boiler Temperature. Give it a shot and if you have any questions I can happily discuss them.

P.S The synchro sensors exist so we know that the commands received by the boiler, it is a fail-safe mechanism.

I am not sure, if i can use this thermostat with my setting:
I have an old gas heating with an esp. I can turn it on/off and i could change a value for needed warmth between 1% and 100%.
If i want to unplanned heat up a cold room i use this slider, with 100% it needs 1,5 x as much gas as with 1% (3 gas counter ticks rather than 2 in the same time).
There are 2 temperature sensors on de pipes out of the boiler for flow and return.
Currently my automation looks at the room temperatures and valve values to decide if heating needs to be switched on/off. No automation regarding warmth need.
There is a button (1-6) on the boiler to change the flow temperature, which i manually adapt to the outside temperature (i dont use values fewer then 2 - leads to much burner on/off)
Mostly i use values from 2-3 leading to flow temperatures from around 40°C to 55°C.

Do you think, this would work with SAT, @sergeantd83?


spikes >60°C = heating up warm water.

Hi @vajdum, this component currently works with an OpenTherm Gateway. You need to check your boiler if supports this protocol. Moreover, we developed a PID ON/OFF thermostat variant. You can find it during initial configuration. It is not fully battle tested yet, but if you want you can give it a try.

Thought, i can find out without installing, if its able to use water temperature sensors.
Do i need dev Version 7e4c320 or V1.0.0?

No, SAT uses various OpenTherm sensors in order to control the boiler.
If you want to try the ON/OFF version you need to install the latest develop version.

Does SAT use temperature sensors in climate entities?
My TRVs have set temperature only, no current temp, but i can create generic thermostats adding temperature + humidity per room.
Is the humidity i can add during setup for inside or outside?

Does SAT use temperature sensors in climate entities?

Yes because we calculate the error of all rooms.

My TRVs have set temperature only, no current temp, but i can create generic thermostats adding temperature + humidity per room.

Yes, this is a good practice.

Is the humidity i can add during setup for inside or outside?

Yes you can add your main room humidity sensor in the sensors card ( Inside / Outside Temperature sensors and Humidity sensor ) during config flow.

Hi! Thank you for sharing this project and wanted to confirm that it works with a Logic Ideal Heat 24 Boiler with OTGW from Nodo shop, board version 2.0 and this firmware. Your integration keeps the temperature spot on on the target. This is amazing. I’ve tried a few different approaches. They are all better than a basic ON/OFF thermostat but this is the best yet.

Thanks for your detailed feedback. We added your boiler to the Boiler compatibility list. If you have any further questions, please don’t hesitate to ask.

Thank you, I have a few questions :slight_smile:

Could you please advise what will happen if I increase or decrease the following:

  1. Heating Curve Coefficient - the higher the number the greater effect the outside temperature change has on the heating setpoint?
  2. Automatic Gains Value - the higher the number the more aggressive the heating setpoint is?

I use the inbuilt weather temperature via template to the get outside temperature

{{ state_attr('weather.forecast_home', 'temperature') | float }}
  1. The outside temperature can stay the same for over an hour, is such value considered stale?

  2. What does the “Thermal Comfort” do when checked?

  3. During the initial configuration, I run the calibration (MQTT) but it only run for a few seconds, so perhaps it didn’t run correctly? Do I need to try again, or will the integration learn over time anyway?

  1. Overshoot protection option during the initial configuration. My boiler, 24 KW max output and 14+ radiators, is probably overkill for the rather well insulated house. Minimum setpoint is 30 C, and at lower temperatures, it can cycle more than desired. Is this the scenario where checking overshoot protection might help to reduce the cycles?

Many thanks

  1. Heating Curve Coefficient - the higher the number the greater effect the outside temperature change has on the heating setpoint?

If your controller already overshoots then you need to slowly reduce the heating curve coefficient until it hovers around the setpoint.

  1. Automatic Gains Value - the higher the number the more aggressive the heating setpoint is?

This is the aggressiveness of the PID controller. For radiators installations it is better to use a 4 or 5 value.

  1. The outside temperature can stay the same for over an hour, is such value considered stale?

No, the only issue you may experience is, if the temperature in your area drops rapidly, the inbuilt weather sensor may not follow as fast as a local temperature sensor. But it will work without issues for the Control Setpoint calculation.

  1. What does the “Thermal Comfort” do when checked?

SAT uses also the humidity sensor, that you already added during the initial configuration, in order to calculate a “corrected” actual room temperature based on inside temperature sensor and humidity sensor.

  1. During the initial configuration, I run the calibration (MQTT) but it only run for a few seconds, so perhaps it didn’t run correctly? Do I need to try again, or will the integration learn over time anyway?

I do see a lot of cycling in the provided graph. The overshoot protection calculation looks like didn’t work for you. If you know the boiler flow water temperature that your system rests when at 0% modulation then you should delete current instance and re-add the integration. Then in the Calibrate System card choose the option Manually enter the overshoot protection value. A second method to solve this issue, which is currently in beta is to gp to SAT → Configure → Advanced → Enable Dynamic Minimum Setpoint (Experimental) option. If you will try this feature and works, please share your experience. :slight_smile:

  1. Overshoot protection option during the initial configuration. My boiler, 24 KW max output and 14+ radiators, is probably overkill for the rather well insulated house. Minimum setpoint is 30 C, and at lower temperatures, it can cycle more than desired. Is this the scenario where checking overshoot protection might help to reduce the cycles?

Did SAT calculated the minimum setpoint to 30? It looks it has been miscalculated. I think #5 recommendations will solve this issue.

George

Thank you George,

Here’s a snapshot of the last 6 hours with the dynamic minimum setpoint feature on. Still quite a lot of cycling. The minimum output of my boiler is 4.8 kW, and with the current temperature of about 10 C, the estimated house heat loss is around 1/2 kW, so most of the time, the boiler is oversized. Is the dynamic minimum setpoint feature meant to help with that?

Regards

I need some more infos.

  • Do you run the latest develop version?
  • I need some specific graphs.
    a) sensor.otgw2_control_setpoint vs sensor.otgw2_boiler_flow_water_temperature
    b) Thermostat graph ( Setpoint vs Room temperature vs hvac_action )
    c) sensor.otgw2_relative_modulation_level vs sensor.otgw_max_rel_modulation_level_setting

Probably this behavior is caused by the low minimum_setpoint. We have a third method to calculate the minimum_setpoint but at the moment is a manual procedure.

dev version 7e4c320

a) last three hours

b) last 8 hours

c) last 3 hours

Note that I run calibration again at about 3pm and the control setpoint was set to 32.7 and the calibration run for about 4 minutes. Then I checked the dynamic option on again.

Please let me know if you need more graphs

Manual method to calculate the minimum_setpoint value:

  1. Set Maximum Setpoint to 45 ( SAT → Configure → General → Maximum Setpoint )
  2. Set your thermostat setpoint to 25.
  3. Monitor your relative modulation level until stabilizes to a specific value and record this value.
    Note: Your relative modulation must be above 0%. If relative modulation is still 0% use higher value in step #1.
  4. Use this formula: (( 100 - recorded relative modulation ( #3 step ) ) / 100) * 45 ) and record the result.
  5. Delete your current SAT instance and re-add SAT. Then in the Calibrate System card choose the option Manually enter the overshoot protection value and enter the #4 step recorded value.

Your system probably will overshoot during this manual calibration procedure but it is a crucial procedure.

It looks like something is working! I followed the procedure and the last few cycles seem to be almost perfect? The value I got for relative modulation was 1.08 when it got stable at setpoint 45. I’m not sure though if it is what you would consider desirable.

I kept adjusting the settings throughout the day, and you can see the graphs change.

  1. Earlier in the day I start with coefficient 1, then increased it, but increasing it seem to have slightly worsened the cycling.
  2. Then about 1245, I increased the target room temperature by 0.5 C, and reduced the coefficient down to 0.5, which seem to increased the cycle time.
  3. Then, about 13:50, I reduced the coefficient down to 0.1, which seem to increase the cycle even more.

  1. The boiler is a condensing boiler, so would you say there are now signs that the boiler is achieving the condensing state?
  2. I have briefly tried the dynamic minimum setpoint at about 9:30, but cycles were really short. Perhaps I can give it a go, with the latest coefficient setting.

Is there anything else you would want to see improved?



climate.otgw2
===========
hvac_modes:
  - "off"
  - heat
min_temp: 7
max_temp: 35
target_temp_step: 0.1
preset_modes:
  - none
  - activity
  - away
  - home
  - sleep
  - comfort
current_temperature: 20.8
temperature: 21
current_humidity: 76
hvac_action: heating
preset_mode: comfort
error: 0.17
integral: 0
derivative: -2.257
proportional: 7.714
history_size: 51
collected_errors: 17
integral_enabled: false
pre_custom_temperature: 20.400000000000002
pre_activity_temperature: null
derivative_enabled: true
derivative_raw: 0
current_kp: 45.375
current_ki: 0.000372
current_kd: 81950
rooms: {}
setpoint: 44
summer_simmer_index: 25.4
summer_simmer_perception: Comfortable
warming_up_data:
  error: 0.36
  started: 1703162711
warming_up_derivative: 0.32
valves_open: true
heating_curve: 27.5
minimum_setpoint: 44
requested_setpoint: 33
adjusted_minimum_setpoint: 36.7
outside_temperature: 10.6
optimal_coefficient: -0.3
coefficient_derivative: -2.7
relative_modulation_value: 0
relative_modulation_state: "off"
relative_modulation_enabled: false
pulse_width_modulation_enabled: true
pulse_width_modulation_state: "on"
pulse_width_modulation_duty_cycle:
  - 310
  - 589
friendly_name: OTGW2
supported_features: 17

Many thanks

Your boiler is condensing and the efficiency of your system is pretty high ( about 107 -109% ) since your return water temperatures are 27 - 29 °C. As you noticed your SAT works as an ON/OFF thermostat but it is not cycling. This feature is called low-load control. This is the most modern technology about handling oversized boilers. Since the lowest output of your boiler ( when relative modulation is 0% ) is 44 °C boiler flow water temperature, when we ask for a Control Setpoint of 33°C it will be never achieved and your boiler will start cycling. That’s why we change the algorithm to low-load control. SAT sends the MM=0 command and then handles only the 4.8 kW output instead of the 24 kW of the max capacity in order to regulate efficiently. We control the ON/OFF times based on the calculated control Setpoint while monitoring the boiler flow water temperature. But your boiler has a small issue. From the relative modulation I can see that it doesn’t respect the 0% Max Modulation command. Some boiler manufacturers don’t respect OpenTherm protocol specifications unfortunately. Your boiler seems to be one of them… We do have some ideas about how to solve this issue and we will implement it in next updates.
Apart from the heating curve coefficient you
can also control the aggressiveness of the PID with the automatic gains value. Maybe a value of 3 or 4 is more suitable for your system.

Edit: You can also see that SAT not only regulates efficiently the room temperature but is able to create a massive radiators ΔT even in low boiler flow temperatures.

Could you please advise what do you consider one cycle to be? Is it not the duration of the flame being on?

From the relative modulation I can see that it doesn’t respect the 0% Max Modulation command.

I noticed that the Max CH setpoint command e.g. SH=55 is not always respected by the boiler but sending GW=R followed immediately by e.g. SH=55, helps. Maybe it’s the same with Max Modulation?

Apart from the heating curve coefficient you
can also control the aggressiveness of the PID with the automatic gains value .

The SAT works well in terms of keeping to the target temperature and making the boiler work more efficiently. However, I still seem to struggle to get the perfect cycle consistently. :warning: In my previous post, lowering the coefficient to 0.1 only worked temporarily, then cycles were short again after a while. What would perfect cycle look like when looking at the relative modulation and boiler temperature look like?

You can also see that SAT not only regulates efficiently the room temperature but is able to create a massive radiators ΔT even in low boiler flow temperatures

Yes, I can see that improvement but as above, it’s still tricky to get all cycles to be as perfectly as possible every time and over long time. I’m testing various settings and will report back.

With the dynamic minimum experimental feature, it seems to work but on many occasions, the cycle is too short because of the minimum requested setpoint, I think?

This is all very interesting and I’m learning a lot, thank you :slight_smile: