Turn on and off heat

It would be good to have a scene through which the heat can be turned on and off when the window is open or the temperature has reached the set level. For example, if the window in room 1 is closed and the temperature is lower than 22 degrees, then room 1 on. Now if I set the condition that the temperature in room 1 is lower than 22 degrees, I can no longer select the same device in action