RPI code to monitor window state via magnetic sensors