Controlling climate AND humidity at the same time

Hi everybody,

I found here information about the fact that the thermostat platform can be used to keep not only the temperature but also humidity in a given range:

Note

  • While this platform uses the term temperature everywhere, it can also be used to regulate other values. For example, controlling humidity is also possible with this platform.

Now I would like to set temperature AND humidity values to be reached at the same time (mostly like the “AND” condition within HA…). In this case: temp needs to be above 40°C AND humidity below 30% (for a 3D-Printer Filament Dryer):

sensor:
  - platform: htu21d
    i2c_id: klima
    temperature:
      name: "Temperatur"
    humidity:
      name: "Luftfeuchtigkeit"
    update_interval: 60s

### [...]

climate:
  - platform: thermostat
    name: "Filadryer 2 Temperature Controller"
    sensor: klima
    min_heating_off_time: 120s
    min_heating_run_time: 120s
    min_idle_time: 30s
    heat_action:
      - switch.turn_on: heizung
    idle_action:
      - switch.turn_off: heizung
    default_preset: PLA
    preset:
      - name: PLA
        default_target_temperature_low: 40 °C
        default_target_humidity_high: 30 %
    preset:
      - name: PETG
        default_target_temperature_low: 60 °C
        default_target_humidity_high: 30 %

Is this possible at all? Or is there another way (outside HA) in ESPhome to set this? Any other platform or code?

Thank you!

Kay

Since you are using two sensors you likely need 2 “thermostats”…

sensor:
  - platform: htu21d
    i2c_id: klima
    temperature:
      name: "Temperatur"
      id: klima_temp
    humidity:
      name: "Luftfeuchtigkeit"
      id: klima_hum
    update_interval: 60s

### [...]

climate:
  - platform: bang_bang
    name: "Filament Temperature Control"
    sensor: klima_temp
    default_target_temperature_low: 40
    default_target_temperature_high: ?  #set to max value for PLA
    heat_action:
      - switch.turn_on: heizung
    idle_action:
      - switch.turn_off: heizung
    away_config:
      default_target_temperature_low: 60
      default_target_temperature_high:  ? #set to max value for PETG

  - platform: bang_bang
    name: "Filament Humidity Control"
    sensor: klima_hum
    default_target_temperature_low: ? #set to min humidity value for PLA
    default_target_temperature_high: 30
    cool_action:
      - switch.turn_on: heizung
    idle_action:
      - switch.turn_off: heizung
    away_config:
      default_target_temperature_low: ? #set to min value for PETG
      default_target_temperature_high: 30

Thank you very much @Didgeridrew !

I used your approach but with the thermostat instead of bang_bang climate-platform because It allows me to use more than to “preset-sets” and name them individually. Now, although it seems to work and appears correctly in the ESPs webfrontend and HA, I have several problems remaining to solve (you can find the code below):

  • Why do humidity values appear in °C instead of % ? That isn’t that important but irritating…
  • I can’t find any command to turn the climate controller off by default / on boot. It always starts heating upon reboot. Is there any way to set it off by default?
  • Most important: although I used two different climate instances referring to two different sensors like you mentioned in your post, the Temp-Preset-Values seem to be “overwritten” by the Dry-Preset-Values as you can see in the screenshot (everywhere 30 instead of 45 and 50 as coded)

Any ideas?

Kay

sensor:
  - platform: htu21d
    i2c_id: klima
    temperature:
      name: "Temperatur"
      id: klima_temp
    humidity:
      name: "Luftfeuchtigkeit"
      id: klima_hum
    update_interval: 60s

######

climate:
  - platform: thermostat
    name: "Filadryer 2 Thermostat"
    icon: mdi:thermometer-auto
    sensor: klima_temp
    min_heating_off_time: 120s
    min_heating_run_time: 120s
    min_idle_time: 30s
    heat_action:
      - switch.turn_on: heizung
    idle_action:
      - switch.turn_off: heizung
    preset:
      - name: "PLA Temp"
        default_target_temperature_low: 45 °C
        mode: HEAT
      - name: "PETG Temp"
        default_target_temperature_low: 45 °C
        mode: HEAT
      - name: "ABS Temp"
        default_target_temperature_low: 50 °C
        mode: HEAT
  - platform: thermostat
    name: "Filadryer 2 Hygrostat"
    icon: mdi:air-humidifier
    sensor: klima_hum
    min_cooling_off_time: 120s
    min_cooling_run_time: 120s
    min_idle_time: 30s
    dry_action:
      - switch.turn_on: heizung
    cool_action:
      - switch.turn_on: heizung
    idle_action:
      - switch.turn_off: heizung
    preset:
      - name: "PLA Hum"
        default_target_temperature_high: 30 °C
        mode: DRY
      - name: "PETG Hum"
        default_target_temperature_high: 30 °C
        mode: DRY
      - name: "ABS Hum"
        default_target_temperature_high: 30 °C
        mode: DRY

I’m working on a similar project – were you ever able to resolve your issues above?