It is possible to extend the alarm system with additional door or window contacts. We can use a battery powered ESP12 module for this task. The module is usually in deep sleep and only wakes up if the conatct is closed. In this case it connects to WLAN and requests the trigger URL to the ESP32-CAM alarm module. After that it goes directry to deep sleep again.
Here is the plan for the external components and connection:
The software for the ESP12 is here.
Just change the WLAN credentials:
// WLAN credentials
const char* ssid = "ssid";
const char* password = "password";
And set the IP address for the ESP32-CAM module and the sensor name as parameter s:
http.begin("http://192.168.0.51:90/alarm_trigger?s=Sensorname"); // Change IP to ESP32-CAM alarm system IP
That's all. The sensor name is shown in the alarm e-mail.
For programming the device, you need again the USB-To-Serial adapter. Connect it to RX/TX and GND. Close the Flash switch and press RST. Then upload the sketch. As module you have to set "Generic ESP8266 Device" in the Arduino IDE.
To reduce the required space you can remove the USB-Serial adapter, the Flash switch and RST button after sucessfull programming.