Configuring ESPhome independent thermostat with rotary encoder to adjust target temperature

Hello fellow tinkerers,

I am having a hard time understanding lambdas and other complex functions.

After my SD card got corrupted and all of my HA ecosystem crashed for several days, I realised that I need to make my thermostat more autonomous, so I decided to move the thermostat functionality from my HA sever to my ESPhome node, so that in the event of server failure, the thermostat will retain at least some basic functionality.

My plan is to use a Lolin NodeMCU (ESP8266 based), a DH22 sensor to act as temperature sensor, a generic rotary encoder ( to adjust target temperature, and a single channel relay to control my gas heater.

The question is, how do I use the rotary encoder to adjust the thermostat climate controller’s (this one: target temperature?

Help appreciated! Thanks in advance!

Well for a start you can set a target temp with this

You could create your rotary encoder to have a min_value and max_value to match your temperature range, and an automation that triggers on the rotary encoder changing state, and making the target temp the same as the rotary sensor value.

Using Rotary Encoder to control HA Thermostat temp from ESPHome check my work here.
my post is a few down.