ESP32: from sensor to phone push in 20 lines
July 14, 2026 · 5 min read
The ESP32 costs a few euros and speaks Wi-Fi – the missing piece is usually “…and then it notifies my phone”. That piece is a single HTTPS POST. No MQTT broker, no Blynk account, no companion app to build.
The sketch
#include <WiFi.h>
#include <HTTPClient.h>
const char* WIFI_SSID = "your-wifi";
const char* WIFI_PASS = "your-pass";
const char* ENDPOINT = "https://api.webhooky.app/YOUR_KEY";
void notify(const String& title, const String& message) {
HTTPClient http;
http.begin(ENDPOINT);
http.addHeader("Content-Type", "application/json");
http.POST("{\"title\":\"" + title + "\",\"message\":\"" + message + "\"}");
http.end();
}
void setup() {
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) delay(250);
notify("🔌 ESP32 online", "Booted and connected");
}
void loop() { /* read sensors, call notify() on events */ }
The ESP32 Arduino core validates api.webhooky.app's certificate against its bundled roots in recent versions; on older cores, use WiFiClientSecure with the ISRG Root X1 certificate (or setInsecure() while prototyping – just not forever).
Battery projects: notify, then sleep
notify("📬 Mailbox", "The mailbox was opened");
esp_deep_sleep_start(); // wake on GPIO next time
A reed switch on the mailbox lid, deep sleep between events – months on a battery, and a push the moment the mail arrives.
Project ideas
- Doorbell / gate sensor – with
"sound": "doorbell_1"it even sounds right. - Water leak sensor under the washing machine –
error_1and Important on. - Soil moisture – “water the tomatoes” once a threshold is crossed.
- Freezer temperature – alarm before the ice cream melts.
Debounce your notifications
Sensors flap. Keep a lastSent timestamp and require a minimum gap (e.g. 5 minutes) per event type – your free 100 notifications (and your nerves) will thank you.
Get Webhooky
Free for your first 100 notifications – set up your endpoint in two minutes.