The forecast for tomorrow is a sunny 28°c (82°F) and the low that evening is 16°C (61°F), we’d open the windows.
The forecast is for rain and belbow the desired room temperature tomorrow, even if cold that evening, it doesn’t want to open up.
Using weather APIs it would make intelligent decisions on when to cool, and based on historical temperature data it would know how long to cool for, it takes and hour, or five to reach the same outside temperature. The lowest temperature isn’t around for hours, so it would learn the heating/ cooling profiles for the room. Lowest temperature at 3am, takes three hours for the temperature of the room to drop that amount. Then from 2am to 4am it should be on. It can happen that the outside temperature is cooler than the inside and that is still true all day, but that ignores the home insulation, so there might be a point it should stop if the rate of change (derivative) of the forecast temperature is greater than the closed room rate of change.
APIs and a few simpler algorithms, a window fan with shutters for rain and sunlight. Temperature and confrontation (end stop) sensors.