Climate: Smart Thermostat with auto Heat/Cool mode, PID control and PWM

Supported domains and modes for heaters and coolers:

  • switch, input_boolean - Basic on/off like [generic_thermostat] or PWM mode.
  • climate - PID regulator.
  • number, input_number - PID regulator (additional switch is required).

Current features:

  • Support multiply heaters/coolers.
  • Supports heat_cool mode.
  • Supports away mode.
  • Supports invert logic of the heater/cooler.
  • Protection if target sensor does not report values for period of time (sensor_stale_duration).

Update 10.12.2022, component moved to the next location:

3 Likes

This is very interesting, I will take a look at it. I use a dualmodegeneric controller to indirectly control an Infinitude HVAC system, it has a lot of inertia, and does not have simple on-off behavior. I’ve considered writing something to use an electric room heater to try and balance the 4 degree F temperature swing I get, but if I can tune the PID on this to turn off the HVAC before it gets enough velocity to badly overshoot that’s possibly a reasonable solution. One problem I foresee is that the Integral term is likely to need to change as the outside temperature changes (i.e. the efficiency of the HVAC system changes). Do you have any advice on this?

1 Like

Currently there is only one way to change PID params: change config and reload smart thermostat.

Yes, very nice! That is just working as it should. Thanks :partying_face:

I am the creator of a Blueprint named Window open, climate off and I am using your thermostat for developing a new version of the blueprint. Therefore, I am kindly asking if you could add more havc modes to your thermostat. Those are based on manufacturer specific modes from e.g. Tado, Homematic, Yamaha etc.

  • fan_only
  • dry
  • automatic
  • manual
  • boost
  • away
  • night

That would be cool and is just a suggestion to make your awesome thermostat even cooler :wink:

Just installed your work to drive my self made fermentation climate box. And I love it! :wink:

1 Like

Hello,

The blueprint what’s you mentioned is still in progress?
Thank you

Hi, yes it is. Less active because of summertime I guess. Check out the last post. It has all the modifications in it.

1 Like

Can I add a same device for heating and cooling? AC

No. Heaters and coolers should be different devices.

Thank you.
Would be nice to use my AC for cooling and heating too.

I have multiple heating devices in my living room.
Tado thermostat and AC.

Can i use this to make a dual setpoint climate entity for a climate entity that doesn’t natively support it?

I currently have a climate entity that only supports Heat and Cool (not auto), I would like to to have dual setpoints. If so what woukd the config look like?

No, my thermostat has only single setpoint with tolerance.

Hi, i could not set initial hvac mode to heat_cool. There is no such state it says. Any suggestions? Thx
Viktor

initial_hvac_mode: "heat_cool"

Log:
Logger: homeassistant.config
Source: config.py:464
First occurred: 6:48:56 PM (1 occurrences)
Last logged: 6:48:56 PM

Invalid config for [climate.smart_thermostat]: value must be one of [‘cool’, ‘heat’, ‘off’] for dictionary value @ data[‘initial_hvac_mode’]. Got ‘heat_cool’. (See /config/zz_climate/climate_heater.yaml, line 0).

Hi,

I would post some more info about my config, the point is to use it with an ESBE mixing valve for primary floor heating water temperature fine adjusting based on forecast weather temp. (this part will be used after the manual thermostat adjustment go well with pid.

- platform: smart_thermostat  #https://github.com/jethome-ru/hassio-component-smart-thermostat
  name: floor_heating_water_thermostat
  target_sensor: sensor.28_00000d5e304b_temperature
  min_temp: 20
  max_temp: 36
  precision: 0.1
  heat_cool_cold_tolerance: '0.2'
  heat_cool_hot_tolerance: '0.2'
# initial_hvac_mode: "heat_cool"
# away_temp:
# target_temp:
# sensor_stale_duration:
  heater:
    - entity_id: input_boolean.floor_water_raise
      pid_params: 1.9, 0.9, 0
      pid_sample_period: "00:00:02"
      pwm_period: "00:00:01"
  cooler:
    - entity_id: input_boolean.floor_water_decrease
      pid_params: 1.9, 0.9, 0
      pid_sample_period: "00:00:02"
      pwm_period: "00:00:01"

I appreciate any suggestions about this as well.
The ESBE motorized valve have a 3-point control, runtime: 120s
heater switch would turn it to heat direction
cooler switch would turn it to cool direction
image
image

1 Like

Hi bebemischa,

I try to do the Same. But my skills in programming and homeassistant are obviously Not good enough to get this thing work. Can you help me and explain to me how you managed that?

Would appreciate your help a lot!

Best wishes,
Felix

Well, you would have to feed the discussion with something to begin with. What do you have already? What is your goal. We do not have a glass sphere around here :wink:

Hehe :wink: yes, First of all o wanted to know If you are around and willing to help… Despite where it will lead i want to thank you in advance for answering!!

I got a styrofoambox, a working dht22 on a nodemcu 8266 over esphome and a smart Switch which i thought can control a seed-heatingmat. I got it to work Yesterday over the generic thermostat integration yesterday. So it ist not bad at all.

I tried to configure the smart thermostat pid integration:

climate:

  • platform: smart_thermostat
    name: pid fermentationsbox
    target_sensor: sensor.fermentationsbox_temperatur
    min_temp: 29.9
    max_temp: 32
    precision: 0.1
    heater:
    • entity_id: climate.tuya_stecker_2
      pid_params: 1.3, 0.5, 0.2
    • entity_id: input_number.fermentationsbox_custom_ajustable_heater_regulator
      switch_entity_id: input_boolean.fermentationsbox_custom_ajustable_heater_regulator_switch
      pid_params: 1.3, 0.5, 0.2

If i Change the entity_id of the heater to switch.tuxa_stecker_2 i get a failure in the config. But as i thought this would bei necessary?

The next thing is, that i ask myself If this setup is able to achieve the accuracy a pid Controller offers…?

So i think that is all i have and all i tried so far. To my goal: would be nice to learn something and produce some Koji (the humidity thing needs to be installed to)…

Thanks a lot!

I’m afraid, I would not be of any help for you.

I do use this thermostat because of its cooling/heating capacity in one place, but I’ve given up on using it’s PID part. I simply did not have the time to learn myself the theory of PID.
So I only use ON/OFF method, and that is enough for what I need.

1 Like

hi smart Thermostat with auto Heat/Cool modes and PID control support.
it mention that I need to add : You can add this device by adding it to your ‘configuration.yaml’. See the documentation for more information.
I checked but I am not sure what I need to add and on which place. I don’t see anything popping up in the device list
kr
Hans

@Hacker-CB,

Can I use your thermostat to control AC unit (heat ON/OFF) to control room temperature ?
If yes, how do I go about getting the PID controller fine tuned

Thank you