years ago I developed a ESP8266 based door/window sensor that runs on battery. The whole system is set up to last up to 2 years on one CR123A battery (yes unusual, but fitted perfectly for my needs).
I designed my own circuit and wrote the necessary SW. The Box is meant to be 3D printed. I made multiple versions depending on the place it is supposed to go (more or less space)
I promised to share the project here back then, but never got around to it.
If anyone is interested, you can find everything across 3 repos on github:
cool thing! have also created an own windowsensor, which is running since almost a year.. as battery I’m using a LiFePo AA Cell.
Unfortunately the ESP01 does not have an analog pin (in fact it has, but not broken out and just 0-1V), so low voltage alarm is not really possible without additional hw, or ESP modification.. ESP.getVcc() does the job..
I’ve included also an OR gateway to have only one device for multiple window sensors..
e.g. if you have a double window, imho it does not matter which one is open, but one/multiple is/are open..
of cause it would also be possible to just squeez multiple cables into the terminal..