Window open detection

Hi there, just wanted to ask you for a window detection algorithm based on temperature changes in the room instead of window contact sensor.

1/ There is a ON/OFF relay responsible for turning on/off actuators - it’s not important for this topic.

2/ Current algorithm :

Step 1: every 3 minutes check
Step 2: check if the temperature drop is not natural items.getItem('TempSensor1_CurrentTemp`).history.evolutionRate( <= -10
Step 3: save the date of opened window detection
Step 4: Turn off heating
Step 5: After 15 min clear the opened window date and go back to normal mode

it’s seems ok for me, just need to adjust the times and evolutionRate but… the window can be opened for more than 15 minutes and the evolutionRate of temperature will not be enought to trigger the rule for next 15 minutes.
Any ideas how to improve it without standard window contact sensors?

I think that’s the natural limitation of this approach. Once the room has got cold AND you’ve turned the heating off, this method will struggle to detect when the window is closed again.

I don’t think additional input like outside temperature helps here. At least, before a full day/night cycle.

You might use motion sensing to guess when someone might have closed the window,

A VOC sensor may be more suitable than a temperature sensor because of its faster response time. But even with a VOC sensor it might be difficult to detect the ‘window closed’ event if there are no VOC sources in the room.

green: VOC level
blue: door open/close