Increase room temperature as fast as possible, but without overheating

felic:
The problem with that code is that once the temperature is reached and the valve is closed, the radiator of the heating is still extremely hot causing the room temperature to increase even further.

Do you have any tips how this could be done properly? It doesn't need to be perfect and I would prefer not to spend hours on benchmarking my heating.

This is basically like you driving a car or bike. You understand the behaviour of a car or bike. So if you need to change the car or bike to a new direction 90 degrees, you need to know in advance when to ease-off on the steering. That is, you normally don't make the steering angle go back to zero all of a sudden. You normally begin to ease the steering back to zero before you get to the 90 degrees heading direction.

For a room, that is able to store heat, and for a heater that is able to heat the room - you need information about the behaviour of this system. Like... how quickly this room gets cold (or cools down) when heat is not applied...... what rate of cooling? And what rate does the temperature increase when you apply heater power.

I agree with others that...... without some cooling system (to go with the heating system), it can be tricky to get the room temperature to behave in the way you want. The only thing you can do right now is to get some idea of how your room temperature behaves for some average outside temperature. And then you can do some tests to find out how long to apply heater power for....and when to cut the heater power. And then just hope that the room eventually reaches some kind of final temperature without 'overshooting' the mark too much.

The thing is... if conditions change, such as the outside temperature changes a lot, or people fill the room a lot etc, then your system changes. And things change depending on when you start applying heater power....and how much heater power....and for how long.

Your problem will probably not be easy to address unless you have cooling power as well.