Nice solution! Wanted to throw this out there as well, you can hardware your contact sensor as well so you don’t have to feed it expensive batteries: