P168 features :
- Displays and use current temperature from specified Device/Value (can be a Dummy for example)
- Displays and maintains setpoint value
- on power down/up this plugin maintains and reloads RELAY and SETPOINT values from SPIFFS
- Supports 3 buttons, LEFT, RIGHT and MODE selection (MODE button cycles modes below,
LEFT/RIGHT increases-decreases setpoint OR timeout (Mode sensitive)
- one output relay need to be specified, currently only HIGH level active supported
- 3 mode is available:
- 0 or X: set relay permanently off no matter what
- 1 or A: set relay ON if current temperature below setpoint, and set OFF when
temperature+hysteresis reached - comparison made at setted Plugin interval (AUTO MODE)
- 2 or M: set relay ON for specified time in minutes (MANUAL ON MODE), after timeout, mode switch to "A"

on System#Boot do
event,loctemp
endon
on loctemp do
TaskValueSet,3,1,[homero#Temperature]
TaskValueSet,3,2,0
endon
on exttemp do
TaskValueSet,3,1,%eventvalue%
TaskValueSet,3,2,1
timerSet 1,180
endon
on Rules#Timer=1 do
event,loctemp
endon
on homero#Temperature do
if [glob#external]=0
TaskValueSet,3,1,[homero#Temperature]
endif
endon

The code above makes it possible to use it's own AM2320 settings as default or if nothing sends to it a remote update.
Remote temperature can be sent by the following URL:
http://THERMOSTAT_IPADDRESS/control?cmd=event,exttemp=21.5

Thanks! It could not have been created without ESPEasy! And of course without Plugin_036, which is the base of this one.
Believe it or not, the hardest thing in coding was to create and display a flame icon on the display... It took a while until i understood why the flame was mirrored and splitted half after conversion...

Thanks! It could not have been created without ESPEasy! And of course without Plugin_036, which is the base of this one.
Believe it or not, the hardest thing in coding was to create and display a flame icon on the display... It took a while until i understood why the flame was mirrored and splitted half after conversion...

I just want to use the 1x3 Matrix Array Key Membrane Switch Keypad 36x55mm (BTN-L,BTN-R,BTN-M)

How to I need to connect it and get readings for that?

I did

1 vcc
2 gnd
3. D2
4. D1
but do not get readings for it.
Thanks for Hints.

Sorry for the missing information, but as you see it has only four connection to three button... so VCC is not needed. It is a simple switching device, you can check with a multimeter, if you connect GND to the 1st pin, than the other 3 pin will go to GND when you press a button. This is the reason why Input-pullup is also necessary, with this setting the GPIO's will go back to HIGH if not pressed, and go to LOW if pressed. (if you left out pullup, than you will surely not see any changes - P168 plugin automatically use input_pullup for button pins)
And D1/D2 is the default I2C pins as you surely know.

Hello enesbcs,
Very nice project and clear explanations
I will start to build your project for my house
Can I ask 2 questions ? :
- Can we use as temperature sensing device also a BME 280 ?
- Can we integrate in your project a clock task to change the temp setpoint for high to low following day/night
Or is it easier to do this with Domoticz ?
Thanks in advance
Patou

It is very easy schedule temperature setting from Domoticz.
When I was planning my heating regulator, I imagined a similar sophisticated device with a display and buttons.
But the circumstances forced me to make the quick fix, that I have achieved with ESPeasy and Domoticz.
And now almost after two years of operation, I see that it is fully enough to control the heating in my house.
The regulation is performed by ESPEases itself by means of rules and setting of parameters and passing of results (display of temperatures, consumption report, planning, etc.) is ensured by Domoticz.
The display and buttons on the regulators do not miss me, even though I'm thinking about displaying some information - like outside temperatures on some of the visible regulators.

My old version with Wemos D1 and ESPeasy _dev13 ( very very slow responses ) you can see here:

You can use any temperature sensing device, that ESPEasy supports.
Local temperature sensing is a last resort for me, as i have temperature sensors in EVERY room, and Domoticz sends the actual temperature data to the thermostat. (motion sensors helps Domoticz to decide which room needs to be monitored) - This is why i am implemented "Temperature source" setting in my plugin, which can be even a Dummy, for remote management.

- Can we integrate in your project a clock task to change the temp setpoint for high to low following day/night
Or is it easier to do this with Domoticz ?

I am using LUA in Domoticz to change setpoint on the device based on the Number of people present, based on the specific room temperatures, where motion detected, and of course based on time. (easy if you knew LUA)
Storing the setpoints locally in the device SPIFFS can be done with some programming in Arduino. (not so easy)
Otherwise if you have to do some local setpoint, can be done by ESPEasy rules. (not so hard)

To enesbcs,
Thanks for your explanations. I made a test units and everything works
Also different setpoints related to time with Esp rules
To Kimot,
Thanks also for your informations, as I am only a beginner with Lua script can you send me some of yours so i can adapt them on my situation It will be easier for me than starting from scrach
Patou