Turning heating off when a window opens is the easy part. Recovery is less obvious: restoring the old setpoint may override a schedule change, while applying the schedule may cancel a newer manual adjustment.
I would treat the pause as its own state, with a reason and a timestamp. On exit, check whether the window is still closed, whether a manual change happened during the pause, and what the current schedule requests. For one room, log those three values and the final setpoint during a short open-close test, a brief re-open, and a schedule boundary. That should make an unintended restart visible before using the rule across the house.
How do you prioritize window-open pauses, schedules, and manual holds in your setup?
This isn’t really a problem in the Aqara Home app, because you can set up the automation so that it doesn’t change the temperature, but still stops and restarts the heating process.
For example, like this:
a) WHEN: Opened for over 1min → Turn off
b) WHEN: Close → Turn on
When opening and closing the windows, you should avoid performing actions such as “Open to manual mode specified value X”. Unless that’s exactly what you want, of course.
That’s a useful distinction: an off/on action can leave the setpoint alone instead of writing a fixed temperature. I’d still test what ‘on’ resumes for that thermostat after a schedule change or a manual adjustment during the window-open pause; that is the edge case I was trying to catch.