Smart Regulation of Window Ventilation (or perhaps heat, ac) component/automation?

Hello, lets say I want to keep room temperature on 22 - 22,5 °C. Base on that I want somehow keep the window opened by window opener to that degree so the temperature will stand in that range.

O believe this though can be applicable to any “place conditioner” like heating or air conditioner.

Now I have the automation that if the temperature drow below certain point it will keep windows opened fully till the temp drops to certain point and I don’t like it. I believe there is smarter way.