Optimize electric old heater consumption

Hello everyone,
I use esphome with sonoff mini R2 on old electric heater to create a climate entity and monitor my room temperature.
In my country, electricity is cheaper during the night but I generally don’t turn on heaters at night so much.
So my goal is optimize electricity consumption while guaranteeing an acceptable temperature at key moments during the day.
Which approach would you suggest?