How jhony-saba/smart-home-system works
This is an ESP32-based smart-home prototype with a web interface for monitoring sensors and controlling household devices. The main workflow is user login, room or device selection (or a natural-language command), server-side validation and safety checks, command dispatch to the ESP32, and persistence of device state in MySQL. Sensor readings also feed tank-safety behavior and notification thresholds. The README documents broader energy-efficiency and safety goals; source excerpts show only some of those paths, so uncertain wiring is omitted.
Main entry points: connection.php Database connection · sendData.php Device command sender · Tank.php Tank and pump safety · phpFolder Room device APIs
Components 20
Web interface
- Home interface
htmlFolder - Room controls
JsFolder - Login screen
htmlFolder/Login.html
Application services
- Login service
phpFolder/Login.php - Session gate
phpFolder/Main.php - Room device APIs
phpFolder - Door authorization
phpFolder/MainDoor.php - Tank and pump safety
phpFolder/Tank.php - Text command handler
phpFolder/sendCommand.php - Profile management
phpFolder/profile.php - Sensor notifications
phpFolder/notification.php - Sensor endpoint
phpFolder/sensor.php
Device and sensing
- ESP32 firmware
cpp/send/src/main.cpp - Home sensors
- Home actuators
Persistence and transport
- Device command sender
connection/sendData.php - Database connection
phpFolder/connection.php - MySQL store
- Sensor data receiver
connection/sendData.php
Other components
- Resident
Connections 26
- Resident → Login screen: opens
README.md - Login screen → Login service: submits credentials
- Login service → Database connection: connects through
phpFolder/Login.php - Database connection → MySQL store: opens connection
phpFolder/connection.php - Resident → Home interface: uses
README.md - Home interface → Room controls: uses controls
- Room controls → Room device APIs: requests device actions
- Room device APIs → Database connection: queries and updates
phpFolder/Bedroom.php - Room device APIs → Device command sender: sends commands
phpFolder/Bedroom.php - Door authorization → Database connection: checks access and state
phpFolder/MainDoor.php - Door authorization → Device command sender: dispatches door command
phpFolder/MainDoor.php - Tank and pump safety → Database connection: reads and updates pump
phpFolder/Tank.php - Tank and pump safety → Device command sender: forces pump off
phpFolder/Tank.php - Text command handler → Database connection: reads and updates devices
phpFolder/sendCommand.php - Text command handler → Device command sender: dispatches command
phpFolder/sendCommand.php - Profile management → Database connection: manages user records
phpFolder/profile.php - Session gate → Home interface: serves after session check
phpFolder/Main.php - Session gate → Login screen: redirects when unauthenticated
phpFolder/Main.php - Sensor notifications → Database connection: reads sensor values
phpFolder/notification.php - Sensor endpoint → Database connection: uses database
phpFolder/sensor.php - Device command sender → ESP32 firmware: HTTP command
- ESP32 firmware → Home actuators: controls
README.md - Home sensors → Sensor data receiver: sends readings
README.md - Sensor data receiver → MySQL store: stores readings
- Tank and pump safety → Home sensors: checks tank safety
- Sensor notifications → Resident: provides alerts
README.md