How rusk0d/home-ping works
Home Ping is a home-environment monitoring system: ESP32 sensors publish readings and occupancy over MQTT; the backend ingests, stores and evaluates them, then serves REST data to Android and MQTT data to the read-only web dashboard. Android also manages notification preferences and location-based occupancy arming, while backend alerts reach phones through Firebase. Firmware sketch sources, contracts and some UI/runtime modules are not present in the supplied tree or excerpts, so their internal links are omitted or documented at the system boundary.
Main entry points: alerts.py Alerting and settings · store.py SQLite store · ingest.py MQTT ingestion · server.py Backend runtime
Components 25
Sensing and transport
- ESP32 sensor nodes
- MQTT broker
- Shared node library
firmware/libraries/HomePing/src/HomePing.h
Backend services
- Backend runtime
backend/server.py - MQTT ingestion
backend/ingest.py - Air analysis
backend/air.py - Node monitoring
backend/nodes.py - REST API
backend/api.py - SQLite store
backend/store.py - Runtime state
backend/state.py - Alerting and settings
backend/alerts.py - Server watchdog
backend/server_checks.py - Database backups
backend/backup_db.py
Android client
- Home dashboard
android/app/src/main/java/com/david/homeenv/HomeFragment.kt - History view
android/app/src/main/java/com/david/homeenv/HistoryActivity.kt - REST client
android/app/src/main/java/com/david/homeenv/Api.kt - Location arming
android/app/src/main/java/com/david/homeenv/HomeGeofence.kt - Retry worker
android/app/src/main/java/com/david/homeenv/ArmWorker.kt - Notification settings
android/app/src/main/java/com/david/homeenv/NotificationSettingsActivity.kt - Push handling
android/app/src/main/java/com/david/homeenv/MyFirebaseMessagingService.kt - Home-screen widget
android/app/src/main/java/com/david/homeenv/HomeEnvWidget.kt
Web dashboard
- Web dashboard
web/app.js
Other components
- Firebase messaging
- Phone user
- Web user
Connections 37
- ESP32 sensor nodes → MQTT broker: publishes readings
- Shared node library → ESP32 sensor nodes: supports node networking
- MQTT broker → MQTT ingestion: delivers messages
- Backend runtime → SQLite store: initializes and loads
backend/server.py - Backend runtime → MQTT ingestion: registers callbacks
backend/server.py - Backend runtime → Node monitoring: starts monitor
backend/server.py - Backend runtime → Air analysis: starts analysis
backend/server.py - Backend runtime → REST API: serves routes
backend/server.py - MQTT ingestion → SQLite store: stores readings
backend/ingest.py - MQTT ingestion → Alerting and settings: triggers alerts
backend/ingest.py - MQTT ingestion → Runtime state: updates state
backend/ingest.py - Air analysis → SQLite store: reads history
backend/air.py - Air analysis → Alerting and settings: triggers alerts
backend/air.py - Node monitoring → SQLite store: checks node records
backend/nodes.py - Node monitoring → Alerting and settings: reports node events
backend/nodes.py - REST API → SQLite store: reads and writes
backend/api.py - REST API → Alerting and settings: uses notification settings
backend/api.py - REST API → MQTT ingestion: uses history helpers
backend/api.py - Alerting and settings → SQLite store: persists alert state
backend/alerts.py - Alerting and settings → Runtime state: tracks cooldowns
backend/alerts.py - Alerting and settings → Firebase messaging: sends pushes
backend/alerts.py - Server watchdog → Alerting and settings: raises watchdog alerts
backend/server_checks.py - Server watchdog → SQLite store: checks stored state
backend/server_checks.py - Database backups → SQLite store: backs up database
- Phone user → Home dashboard: views readings
- Home dashboard → REST client: requests dashboard data
android/app/src/main/java/com/david/homeenv/HomeFragment.kt - History view → REST client: requests history
android/app/src/main/java/com/david/homeenv/HistoryActivity.kt - REST client → REST API: calls REST endpoints
- Notification settings → REST client: updates preferences
android/app/src/main/java/com/david/homeenv/NotificationSettingsActivity.kt - Notification settings → Location arming: configures auto-arm
android/app/src/main/java/com/david/homeenv/NotificationSettingsActivity.kt - Location arming → Retry worker: queues arm changes
android/app/src/main/java/com/david/homeenv/HomeGeofence.kt - Retry worker → Location arming: posts arm state
android/app/src/main/java/com/david/homeenv/ArmWorker.kt - Location arming → REST client: posts occupancy state
android/app/src/main/java/com/david/homeenv/HomeGeofence.kt - Firebase messaging → Push handling: delivers notifications
- Web user → Web dashboard: views sensor data
- Web dashboard → MQTT broker: subscribes over WebSockets
- Home dashboard → Home-screen widget: shares sensor display