I have set up a generic thermostat to control rpi4’s temperature using an external 12V fan, controlled by a sonoff dual R3. As you can see, it turns off the fan without reaching the target temperature, which I deliberately left too low.
You don’t need a keep alive value for your switch. It is only required for heaters and A/C units that shut off if they don’t receive a signal from their remote for a while. Also when keep_alive is set the min_cycle_duration option will be ignored.