A comprehensive Flutter-based mobile application for controlling and monitoring ESP32-powered smart home devices. Features real-time video streaming, AI assistant with voice commands, security monitoring, and cross-platform support.
- AI Assistant: Voice commands with wake word detection ("Hey SmartHaus") powered by Porcupine and Google Gemini
- Live Video Streaming: WebSocket-based ESP32-CAM integration with frame capture
- Smart Door Control: Biometric authentication with 30-second auto-lock security feature
- Water Level Monitoring: Real-time tank monitoring with threshold alerts
- Relay Control System: Manage up to 8 smart devices with customizable names
- Security Logs: Comprehensive logging with device health monitoring
- Firebase Integration: Real-time database, authentication, cloud messaging, and cloud functions
- Responsive UI: Material Design 3 with dark/light mode persistence
- Background Wake Word: Foreground service for always-listening voice activation
- Cross-Device Compatibility: Optimized storage permissions for major Android manufacturers
| Layer | Technology |
|---|---|
| Frontend | Flutter 3.9+ / Dart |
| Backend | Firebase (Auth, RTDB, FCM, Functions) |
| Hardware | ESP32-CAM, Relay modules, Fingerprint sensor |
| AI/Voice | Google Gemini API, Porcupine Wake Word, Speech-to-Text |
| State | Provider pattern with ChangeNotifier |
lib/
main.dart # Application entry point and main UI
ai_chatbot_page.dart # AI assistant with voice commands
firebase_options.dart # Firebase configuration (excluded from repo)
websocket_stream_widget.dart # ESP32-CAM streaming component
services/
enhanced_permission_service.dart # Cross-device permission handling
manufacturer_storage_service.dart # Device-specific storage management
simple_notification_service.dart # Push notification service
functions/
src/index.ts # Firebase Cloud Functions for AI chatbot
assets/
wake_words/ # Porcupine wake word models
{
"devices": {
"esp32cam_001": {
"ip_address": "192.168.1.100",
"ws_port": 81
},
"fingerprint_door_001": {
"failed_attempts": 0,
"last_updated": "2025-12-22 16:07:03",
"last_seen": "2025-12-22 16:07:10",
"status": "active"
},
"water_level_001": {
"water_level": true,
"last_updated": "2025-12-22 03:14:50"
}
},
"smart_controls": {
"system_enabled": true,
"last_seen": "2025-12-22 16:07:10",
"relays": {
"door": { "isLocked": true, "state": false },
"1": { "name": "Living Room Light", "state": false }
}
}
}- Clone the repository
- Run
flutter pub get - Create
lib/firebase_options.dartfrom template - Add
android/app/google-services.jsonfrom Firebase Console - (Optional) Deploy cloud functions:
cd functions && npm install && firebase deploy --only functions - Run
flutter run
# Android Release APK
flutter build apk --release
# Split APKs by architecture (smaller file sizes)
flutter build apk --split-per-abi
# Using build script
./build_production.bat # Windows
./build_production.sh # Linux/macOS- AI chatbot with natural language control
- Wake word detection for hands-free activation
- Door auto-lock feature (30-second timer)
- Device health monitoring with last_seen timestamps
- Improved WebSocket lifecycle management
- Floating AI assistant button on dashboard
MIT


