Is possible change setInterval dynamically?

I think you’d need to delete the timer then declare it again with a different time period, but that’s very messy.

A better option might be to use a flag to indicate if the timed function should execute, then have anif statement at the beginning of your timed function to check the status of this flag variable. If it’s true then execute the rest of the code in that function. If not then the function returns.

Then, you set the flag variable to false when your fridge has reached it’s target.
You could use a timeout timer to set the flag back to true after a predefined time.

You might find the Auto/Manual discussion, and the section on Timeout timers in this tutorial useful…

Pete.