As switching on night-reduction with offset -3 I got a 5 min compressor shutdown...
To avoid this I put a 10 min smoothing function into your flow...
Maybe you have a better idea for the right place...
My implementation only works for the switch and global.var: NightReductionWaterTemp.state and only for the reduction of the setpoint temperature...

Greetings Rue
Attention: This idea didn't work!!!