Door and window sensors