Real-time Smart Home Energy Management with IBM watsonx.ai Integration
Dashboard | Devices |
---|---|
![]() |
![]() |
Analytics | AI Optimization |
---|---|
![]() |
![]() |
Smart Energy Optimizer is an intelligent home energy management system that leverages IBM watsonx.ai to provide real-time energy monitoring, AI-powered predictions, and smart optimization recommendations. Built for the IBM TechXchange Hackathon 2025.
- ๐ค Real IBM watsonx.ai Integration - Granite-3-8b-instruct model for energy predictions
- ๐ฑ Native iOS App - Beautiful SwiftUI interface with glassmorphism design
- โก Real-time Monitoring - Live energy consumption tracking with WebSocket updates
- ๐ฎ AI Predictions - 24-hour energy forecasts with peak/off-peak analysis
- ๐ฏ Smart Recommendations - AI-powered optimization suggestions
- ๐ Device Control - Remote control of smart home devices
- ๐ Live Analytics - Real-time charts and energy flow visualization
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ iOS App โ โ Backend API โ โ IBM watsonx.ai โ
โ (SwiftUI) โโโโโบโ (Node.js) โโโโโบโ (Granite Model) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โโโโโโโโโโผโโโโโโโโโ โ
โ โ Device Simulator โ โ
โ โ (Real-time) โ โ
โ โโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโ WebSocket Real-time โโโโโโโโโโโโโโ
- Node.js 18+
- Xcode 15+ (for iOS development)
- IBM Cloud account with watsonx.ai access
-
Clone the repository
git clone https://github.com/Amith71965/smart-energy-optimizer.git cd smart-energy-optimizer
-
Install backend dependencies
cd backend npm install
-
Configure IBM watsonx.ai
cp .env.example .env # Edit .env with your IBM Cloud credentials: # WATSONX_API_KEY=your_api_key # WATSONX_PROJECT_ID=your_project_id # WATSONX_URL=https://us-south.ml.cloud.ibm.com
-
Start the backend server
npm start # Server runs on http://localhost:3000
-
Start device simulators (in new terminal)
cd simulators npm install npm start
-
Open Xcode project
cd ios-app open ios-app.xcodeproj
-
Configure network settings
- Ensure
Info.plist
allows localhost connections - Backend URL:
http://localhost:3000
- WebSocket URL:
ws://localhost:3000
- Ensure
-
Build and run
- Select iPhone simulator
- Press โ+R to build and run
- Real-time energy usage ring (kW display)
- Current cost tracking
- Device status grid with live updates
- Live energy flow chart
- Today's summary with efficiency scoring
- HVAC temperature control (60-85ยฐF)
- Lighting brightness control (0-100%)
- Appliance on/off toggle
- Real-time power consumption display
- 24-hour energy predictions
- Peak/off-peak period identification
- Cost optimization recommendations
- Efficiency trend analysis
- WebSocket live updates (30-second intervals)
- Smooth animations and transitions
- Haptic feedback for interactions
- Auto-reconnection handling
- Monitor Agent - Real-time energy pattern analysis
- Prediction Agent - 24-hour consumption forecasting
- Optimization Agent - Smart recommendation generation
- Model:
ibm/granite-3-8b-instruct
- Authentication: IBM Cloud IAM with auto-refresh
- Response Time: < 2 seconds average
- Fallback: Graceful degradation with statistical models
- Energy consumption prediction with 70% confidence
- Peak hour identification (7-9 AM, 6-9 PM)
- Cost optimization recommendations
- Device usage pattern analysis
GET /health
- System health and AI statusGET /api/devices
- Device list and statusGET /api/energy/current
- Real-time energy readingsGET /api/energy/summary
- Dashboard summary data
GET /api/predictions
- 24-hour AI forecastsGET /api/optimization/recommendations
- AI suggestions
POST /api/devices/:id/control
- Device control actions
ws://localhost:3000
- Real-time data streaming
- Glassmorphism design with ultra-thin materials
- Dark text on light backgrounds for accessibility
- Smooth animations with spring physics
- Haptic feedback for user interactions
- โ Real IBM watsonx.ai integration
- โ 3 specialized AI agents working in concert
- โ Real-time WebSocket data streaming
- โ Professional iOS app with native performance
- โ Granite-3-8b-instruct model integration
- โ SwiftUI with modern iOS development patterns
- โ RESTful API design with proper error handling
- โ Real-time data visualization
- โ Intuitive energy management interface
- โ Actionable AI recommendations
- โ Real-time feedback and control
- โ Professional design and animations
- Backend Response Time: < 100ms for most endpoints
- AI Processing Time: < 2 seconds for predictions
- Data Update Frequency: Every 30 seconds
- WebSocket Latency: < 50ms
- iOS App: 60fps smooth animations
- Node.js with Express.js
- WebSocket for real-time communication
- IBM watsonx.ai SDK
- Device simulation with realistic patterns
- SwiftUI 5.0 with @Observable pattern
- Combine framework for reactive programming
- Network framework for connection monitoring
- Native iOS performance optimization
- IBM watsonx.ai platform
- Granite-3-8b-instruct model
- Statistical fallback algorithms
- Real-time data processing
MIT License - Built for IBM TechXchange Hackathon 2025
Amit Kumar Yadav K Aryan Yadav Srikar
- IBM TechXchange Hackathon 2025 Participant
- Smart Energy Optimization with watsonx.ai