I have this in my ESPHome config:
climate:
- platform: thermostat
name: "Thermostat"
id: my_thermostat
min_idle_time: 5s
min_heating_off_time: 5s
min_heating_run_time: 5s
max_heating_run_time: 30min
min_fanning_off_time: 5s
min_fanning_run_time: 5s
supplemental_heating_delta: 5
sensor: temperature
visual:
temperature_step: 1
min_temperature: 10
max_temperature: 35
heat_action:
- switch.turn_off: boost
supplemental_heating_action:
- switch.turn_on: boost
idle_action:
- logger.log: "Turn off"
- uart.write: [0xF1,0xF1,0x02,0x10,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x7E]
fan_only_action:
- logger.log: "Fan mode"
- uart.write: [0xF1,0xF1,0x02,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x16,0x7E]
heat_mode:
- logger.log: "Turn on, half power, with swing!"
- uart.write: [0xF1,0xF1,0x02,0x10,0x01,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x7E]
off_mode:
- logger.log: "Turn off"
- uart.write: [0xF1,0xF1,0x02,0x10,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x7E]
target_temperature_change_action:
then:
- logger.log:
format: "Change target to %f"
args: ["id(my_thermostat).target_temperature"]
- uart.write: !lambda |-
auto target = id(my_thermostat).target_temperature;
std::vector<uint8_t> data = {0xF1, 0xF1, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, static_cast<uint8_t>(target), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, static_cast<uint8_t>(target + 20), 0x7E};
return data;