Thermostat with condition to activate heating/cooling

Hello,

I started with my first couple of ESPHome devices just few weeks ago and realy like the ease of use.
I had some nodemcu’s controlling my heating valve before and migrated them to ESPHome. Now I want to add some temperature sensors and use the thermostat climate platform.
So I have 2 ESP’s (one with sensor, the other with valve controll). Where do I put the thermostat platform? Does it make any difference?
Also my heating is capable of heating and cooling. So in both cases I need to activate the same valve, but my system has different inlet temps. I can read this inlet temp in HA.
Is there a way to only activate cool_action if inlet_temp < 20 and heat_action if inlet_temp > 24?

Thanks in advance,
4nduril

With multiple sensors and valve control spread out over different devices that feed into HA, I would probably use the Generic Thermostat integration in Home Assistant rather than implementing it on one of the ESP devices.

well does that integration supports both heating and cooling?

This one does, and you get PID as a bonus :wink:

That looks great. As both my heater and my cooler are identical I might add an automation to set mode to heating when supplytemp is greater than 24 and to cooling if supplytemp is below 22…
I there a way to only enable heat or cool but not heat/cool?
Well I probably need some time to dig through all these options for PID…

yes, read the manual :wink:

PID is optional, and it has a learning path. If used, can give very nice results. But you can skip it for now.

@BebeMischa Are you using this smart thermostat yourself? Cause I can not get it to work. When I configure it as ON/OFF device it just cycles ON/OFF multiple times a second and when set to PID it newer switches on the heating valve…

  - platform: smart_thermostat
    name: "Thermostat Arbeitszimmer"
    target_sensor: sensor.temperatur_arbeitszimmer
    min_temp: 18
    max_temp: 28
    precision: 0.5
    heater:
      - entity_id: switch.heizungsventil_arbeitszimmer
        pid_params: 10, 0.005, 0
        pwm_period: "00:05:00"
        pid_sample_period: "00:00:05"
    cooler: switch.heizungsventil_arbeitszimmer

I do not use the PID. Still had no time to get that working, as I know, that getting the right values for it to run well needs some trial and error discovery by observation.

I use the on/off mode for a climate box (fermentation processes) and that works like a charm.

Here are my settings:

# Thermostaten
climate:
  - platform: smart_thermostat
    name: Rotkast
    target_sensor: sensor.aeotec_humitemp_rotkast_air_temperature
    min_temp: 8
    max_temp: 42
    precision: 0.1
    heater:
      - entity_id: switch.sonoff_1001041627
        # pid_params: 100, 0.01, 0
        # pid_sample_period: "00:06:00"
        # pwm_period: "00:03:00"
    cooler:
      - entity_id: switch.sonoff_100103c57c
        # pid_params: 100, 0.01, 0
        # pid_sample_period: "00:06:00"
        # pwm_period: "00:03:00"
    heat_cool_hot_tolerance: 0
    heat_cool_cold_tolerance: 0
    sensor_stale_duration:
      minutes: 10

And here is my today’s graph:

Thanks for your reply. I might have narrowed down the problem. It seems it does not only want to start the heating device, but also disable the cooler. As they are both the same in my case this leads to that ON/OFF loop, even when only in heating mode.

What kind of device are you trying to manage? (principle, manufacturer, type, describe as much you can, please)

Do you mean my heating devices? Those are simple mosfets connected to an ESP. Those mosfets directly controll the valve of my underfloor heating circuit. So there is no additional logic included except ESPHome.

I need to understand, how are you switching between heat and cool, on the device it self. I do not see it, I have no picture.

There is no way for ESPHome to influence heating/cooling. The switch only controls the valve. I read the temperature sensor of my heating system and want to set all thermostats to heating if supply temp is above 24 (and to cooling is supply temp is below 22).
So if mode is set to heating I only want the thermostat to care about heating and not cooling and vice versa.