Esphome two thermostats interlock

Hello everyone!
I have two thermostats on one Esp controlling ONE relay.

I need to make an automation so that when I switch one thermostat to “Heat” from “OFF”, the second one should immediately switch to “OFF” from “Heat” and vice versa.

It seems that I should use lambda, but I do not know C++.

Any help will be appreciated!
Thank you!

What is the use case?

Do you think I can help if that’s all I know??
Describe what you exactly have (hardware, wiring and yaml) and what you really want to accomplish.

I dont understand why you have 2 thermostats one for heat and 1 for cool when just 1 thermostat is perfectly capable of doing what you need.

What device or hardware is the second thermostat switching to Off?

You only meantioned one relay so are you switching some other relay or is this 1 relay where COM/NC is Heat and COM/NO is cool? I wouldn’t personally recommend doing that but your setup is a mystery and so is 2 thermostats.

Here is short example to catch climate mode changes and perform action on it.

  - platform: XXX
    id: cl1
      - lambda: |-
          if (x.get_mode() == CLIMATE_MODE_OFF) {

  - platform: XXX
    id: cl2

Tune for Your needs.

Or you could just link to the documentation where many basic examples like this can be found…

1 Like