How-To: Replacing Ecobee Smart Thermostat with ESPHome Climate Control

After my second Ecobee died in the middle of a heat wave a few weeks out of warrantee, I decided to replace it with an ESPHome Climate Controller.

  1. Quad relay ESP32 module

https://www.aliexpress.com/item/2255799905174014.html

This one takes 24VAC supply directly (R and C wires – my own furnace supplies 28VAC and it is fine). Be sure to specify you want a “test board” so you can reflash it. The header pin assignment (and tons of other info) can be found here.

Note: You need external power to re-program it. Powering using the 3.3V header on the debug port is not sufficient.

  1. Temperature Sensor

I’m reusing the interior temperature sensor I already have

https://www.aliexpress.com/item/3256804542206729.html

  1. ESPHome Climate Configuration

Being located in the US, I use Fahrenheit instead of Celsius (I know, I know, I’m Canadian and hate it too). There is a problem in that temperature sensors are reported in C but ESPHome does not convert them into F even if you specify the measurement unit as such. Thus a conversion lambda is necessary. Specifying F everywhere else works fine.

sensor:
  - platform: homeassistant
    id: temperature_sensor
    name: "Temperature Sensor From Home Assistant"
    entity_id: sensor.th_inside_temperature
    unit_of_measurement: °C
    filters:
      - lambda: return (x - 32.0) * 5.0/9.0;

switch:
  - platform: gpio
    pin: GPIO16
    id: G
    name: "Fan"
  - platform: gpio
    pin: GPIO02
    id: W1
    name: "Low Heat"
  - platform: gpio
    pin: GPIO32
    id: W2
    name: "High Heat"
  - platform: gpio
    pin: GPIO12
    id: Y
    name: "Cool"

# Dual-point Climate Controller
# See https://www.techsolutions.support.com/how-to/how-to-set-a-threshold-on-an-ecobee-thermostat-12429
# for sensible values
climate:
  - platform: thermostat
    name: "Thermostat Climate Controller"
    sensor: temperature_sensor
    cool_deadband: 2 °F
    cool_overrun: 2 °F
    heat_deadband: 2 °F
    heat_overrun: 2 °F
    min_cooling_off_time: 300s
    min_cooling_run_time: 300s
    min_heating_off_time: 300s
    min_heating_run_time: 300s
    min_fanning_off_time: 30s
    min_fanning_run_time: 30s
    min_idle_time: 300s
    set_point_minimum_differential: 3 °F
    cool_action:
      - switch.turn_on: Y
    heat_action:
      - switch.turn_on: W1
    max_heating_run_time: 300s
    supplemental_heating_delta: 5 °F
    supplemental_heating_action: 
      - switch.turn_on: W2
    idle_action:
      - switch.turn_off: G
      - switch.turn_off: W1
      - switch.turn_off: W2
      - switch.turn_off: Y
    fan_only_action: 
      - switch.turn_on: G
    fan_with_cooling: True
    fan_with_heating: True
    default_preset: Home
    on_boot_restore_from: memory
    preset:
      - name: Home
        default_target_temperature_low: 68 °F
        default_target_temperature_high: 78 °F
        mode: HEAT_COOL
      - name: Comfort
        default_target_temperature_low: 70 °F
        default_target_temperature_high: 74 °F
        mode: HEAT_COOL
      - name: Sleep
        default_target_temperature_low: 65 °F
        default_target_temperature_high: 70 °F
        mode: HEAT_COOL
      - name: Away
        default_target_temperature_low: 50 °F
        default_target_temperature_high: 85 °F
        mode: HEAT_COOL
      - name: OverCool
        default_target_temperature_low: 60 °F
        default_target_temperature_high: 65 °F
        mode: COOL
  1. Wiring

The common terminal of all relays is wired to R and the G/W1/W2/Y wires are connected to the Normally-Open (NO) terminal of the corresponding relay. This got mounted on the wall in the mechanical room (turn off power to the furnace when doing the actual wiring!). I added a cut off switch in case it needs to be taken out of service.

  1. Created a climate control panel on my wall console, along with schedules and “It’s hot!”, “It’s cold!”, and “We’re away” helpers that are used as conditions in the schedules.

The gorgeous temperature forecast is courtesy of the Clock Weather Card.

Automation (there are two more like it) making sure only one climate mode is turned on:

alias: When Climate Set to Summer
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.it_s_hot_outside
    to: "on"
condition: []
action:
  - service: input_boolean.turn_off
    metadata: {}
    data: {}
    target:
      entity_id:
        - input_boolean.it_s_cold_outside
        - input_boolean.we_re_on_vacation
  - service: climate.set_temperature
    metadata: {}
    data:
      temperature: 50
    target:
      entity_id:
        - climate.master_bathroom
        - climate.main_bathroom
  - service: climate.set_temperature
    metadata: {}
    data:
      target_temp_high: 76
      hvac_mode: cool
      target_temp_low: 65
    target:
      entity_id: climate.house_thermostat_thermostat_climate_controller
mode: single
  1. Installed a dumb thermostat as a back up

Should HA go off-line or my ESP board die, I can shut it off and simply turn on my dumb thermostat. It also nicely covers the hole in the wall.

The only issue I’m running into is that turning the “G” relay on turns on the A/C, not just the fan. Same as if I turn on the “Y” relay. Setting the “FAN” switch to “ON” on the dumb thermostat does not bring up the A/C, only the fan at low speed.

I’ve resolved the issue by disconnecting the green wire entirely but that means I cannot run in fan-only mode.

Looks like my Lennox controller isn’t behaving rationally… Any idea? What other monsters may be hiding?

Great project …

Were you able to figure out what is wrong with the FAN problem?

Someone suggested that the dumb thermostat is probably feeding the FAN signal back to the A/C signal.

I bought a 4-pole transfer switch so I can electrically isolate each thermostat but have yet to install it.

Thanks

Please update the post when you install it, and verify that it works (or not)

Just installed the 4-pole transfer switch: common goes to furnace, one side goes to wall thermostat, the other goes to the ESPHome board.

Works like a charm. The wall thermostat was indeed feeding back from the fan to the A/C. Now that it is isolated, I can turn on only the fan.