I wanna share with you project that i have made to know if windows in my flat are open, close or tilt.
Two reed switchs are located on not moving part of the window. Upper reed switch is connected to Attiny85 interrupt pin. If state changes, Attiny85 will be awaken from deep sleep, will check state on interrupt pin and pin connected to lower reed switch.
Depending on state those two reed switches, Attiny will send signal that can be interpreted by Home assistant.
Below link to github with code.
https://github.com/maskaz/433_window_sensor