There's a couple of things.
ClockTimer3 sets mem1 to mem3 but I can't see where you set mem3
The lines
mem1#state>=mem2 and
mem2#state<=mem1
seem to be the same thing
If mem1 greater than or equal to mem2 is essentially the same as if mem2 less that or equal to mem2
You're writing to mems a lot which will wear the memory out. Ideally you would only write to mems infrequently. In your case I would set the mems once (as a coarse control) and use vars for the fine tuning but use HA to reinstate the vars on a reboot of the
ESP.
You also seem to be publishing stuff which Tasmota will already be sending (change in output state is sent automatically) mems should be changing infrequently
Are you having an issue considering a DS28B20 to the ESP32?