ESPHome Climate PID temperature presets

Hi, I just bought a DIYLESS OpenTherm thermostat and I flashed it with ESPHome.
I got everything working and then I found out there is an option in Home assistant to select climate presets like home, away, comfort, eco etc.
I want to add it to my thermostat but I’m unable to find a way to configure the presets.
The presets with configurable temperatures seems so usefull.

Can someone help me with this?

This is my climate pid config in ESPHome:

climate:
  - platform: pid
    id: ch_climate
    name: "Heating Climate"
    heat_output: t_set
    default_target_temperature: 20°C
    sensor: thermostat_temp
    visual:
      min_temperature: 4°C
      max_temperature: 35°C
      temperature_step:
        target_temperature: 0.5°C
        current_temperature: 0.1°C
    control_parameters: 
      kp: 4.585496559670449
      ki: 0.0003293586854220727
      kd: 15.960394874514796
      derivative_averaging_samples: 10  # smooth the derivative value over 10 samples
      starting_integral_term: 0.0
    deadband_parameters:
      threshold_high: 0.5°C
      threshold_low: -0.5°C
      kp_multiplier: 0.5
      ki_multiplier: 0.5 
      kd_multiplier: 1.0
      deadband_output_averaging_samples: 5   # average the output over 5 samples within the deadband

Here is an example of the kind of presets that I’m looking to implement.

Here is my thermostat entry in esphome.

climate:
  - platform: thermostat
    name: "${friendly_name} CH Thermostat"
    id: heating_thermostat
    sensor: house_temperature
    min_heating_off_time: 300s
    min_heating_run_time: 300s
    min_idle_time: 30s
    heat_overrun: 0
    heat_action:
      - switch.turn_on: heat
    idle_action:
      - switch.turn_off: heat
    default_preset: Home
    on_boot_restore_from: default_preset
    preset:
      - name: Away
        default_target_temperature_low: 10 °C
        mode: HEAT
      - name: Home
        default_target_temperature_low: 18 °C
        mode: HEAT 
      - name: Comfort
        default_target_temperature_low: 20 °C
        mode: HEAT

Hopefully this points you in the right direction.

Thanks for the response, that is what I’m looking for but I think it doesn’t work with the Climate PID api.

I am getting the following errors when I add the preset part:

INFO ESPHome 2024.12.4
INFO Reading configuration /config/esphome/esphome-web-fff95c.yaml...
Failed config

climate.pid: [source /config/esphome/esphome-web-fff95c.yaml:121]
  platform: pid
  id: pid_kamer_stijn
  name: Kamer Stijn
  sensor: temperature_kamer_stijn
  humidity_sensor: humidity_kamer_stijn
  default_target_temperature: 21°C
  heat_output: heater_output_stijn
  visual: 
    min_temperature: 4
    max_temperature: 35
    temperature_step: 
      target_temperature: 0.5
      current_temperature: 0.1
  control_parameters: 
    kp: 0.23873
    ki: 0.00018
    kd: 8.85876
    min_integral: -10.0
    max_integral: 10.0
    starting_integral_term: 0.0
    output_averaging_samples: 15
    derivative_averaging_samples: 20
  deadband_parameters: 
    threshold_low: -0.5
    threshold_high: 0.5
    kp_multiplier: 1.0
    ki_multiplier: 1.0
    kd_multiplier: 1.0
    deadband_output_averaging_samples: 10
  
  [default_preset] is an invalid option for [climate.pid]. Please check the indentation.
  default_preset: Home
  
  [on_boot_restore_from] is an invalid option for [climate.pid]. Please check the indentation.
  on_boot_restore_from: default_preset
  
  [preset] is an invalid option for [climate.pid]. Please check the indentation.
  preset: 
    - name: Away
      default_target_temperature_low: 10 °C

Ahh sorry, didn’t spot it was the PID and it seems presets are not an option.

Any reason you need to use the PID and not the standard thermostat?

Mostly because I have the option to modulate the boiler temperature.
It also makes the temperature more stable if it is tuned right