Skip to content

Amith71965/smart-energy-optimizer

Repository files navigation

๐Ÿก Smart Energy Optimizer - IBM TechXchange Hackathon 2025

Real-time Smart Home Energy Management with IBM watsonx.ai Integration

Swift Node.js IBM watsonx.ai iOS

Dashboard Devices
Analytics AI Optimization

๐ŸŽฏ Project Overview

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.

๐ŸŒŸ Key Features

  • ๐Ÿค– 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

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   iOS App       โ”‚    โ”‚   Backend API    โ”‚    โ”‚ IBM watsonx.ai  โ”‚
โ”‚   (SwiftUI)     โ”‚โ—„โ”€โ”€โ–บโ”‚   (Node.js)      โ”‚โ—„โ”€โ”€โ–บโ”‚ (Granite Model) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”‚
         โ”‚              โ”‚ Device Simulator โ”‚              โ”‚
         โ”‚              โ”‚  (Real-time)     โ”‚              โ”‚
         โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
         โ”‚                                               โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ WebSocket Real-time โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • Xcode 15+ (for iOS development)
  • IBM Cloud account with watsonx.ai access

Backend Setup

  1. Clone the repository

    git clone https://github.com/Amith71965/smart-energy-optimizer.git
    cd smart-energy-optimizer
  2. Install backend dependencies

    cd backend
    npm install
  3. 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
  4. Start the backend server

    npm start
    # Server runs on http://localhost:3000
  5. Start device simulators (in new terminal)

    cd simulators
    npm install
    npm start

iOS App Setup

  1. Open Xcode project

    cd ios-app
    open ios-app.xcodeproj
  2. Configure network settings

    • Ensure Info.plist allows localhost connections
    • Backend URL: http://localhost:3000
    • WebSocket URL: ws://localhost:3000
  3. Build and run

    • Select iPhone simulator
    • Press โŒ˜+R to build and run

๐Ÿ“ฑ iOS App Features

Dashboard

  • 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

Device Management

  • HVAC temperature control (60-85ยฐF)
  • Lighting brightness control (0-100%)
  • Appliance on/off toggle
  • Real-time power consumption display

AI Analytics

  • 24-hour energy predictions
  • Peak/off-peak period identification
  • Cost optimization recommendations
  • Efficiency trend analysis

Real-time Features

  • WebSocket live updates (30-second intervals)
  • Smooth animations and transitions
  • Haptic feedback for interactions
  • Auto-reconnection handling

๐Ÿค– IBM watsonx.ai Integration

AI Agents

  1. Monitor Agent - Real-time energy pattern analysis
  2. Prediction Agent - 24-hour consumption forecasting
  3. Optimization Agent - Smart recommendation generation

Model Details

  • Model: ibm/granite-3-8b-instruct
  • Authentication: IBM Cloud IAM with auto-refresh
  • Response Time: < 2 seconds average
  • Fallback: Graceful degradation with statistical models

AI Capabilities

  • Energy consumption prediction with 70% confidence
  • Peak hour identification (7-9 AM, 6-9 PM)
  • Cost optimization recommendations
  • Device usage pattern analysis

๐Ÿ”ง API Endpoints

Core APIs

  • GET /health - System health and AI status
  • GET /api/devices - Device list and status
  • GET /api/energy/current - Real-time energy readings
  • GET /api/energy/summary - Dashboard summary data

AI APIs

  • GET /api/predictions - 24-hour AI forecasts
  • GET /api/optimization/recommendations - AI suggestions

Device Control

  • POST /api/devices/:id/control - Device control actions

WebSocket

  • ws://localhost:3000 - Real-time data streaming

๐ŸŽจ Design System

UI Features

  • Glassmorphism design with ultra-thin materials
  • Dark text on light backgrounds for accessibility
  • Smooth animations with spring physics
  • Haptic feedback for user interactions

๐Ÿ† Hackathon Highlights

Innovation

  • โœ… Real IBM watsonx.ai integration
  • โœ… 3 specialized AI agents working in concert
  • โœ… Real-time WebSocket data streaming
  • โœ… Professional iOS app with native performance

Technical Excellence

  • โœ… Granite-3-8b-instruct model integration
  • โœ… SwiftUI with modern iOS development patterns
  • โœ… RESTful API design with proper error handling
  • โœ… Real-time data visualization

User Experience

  • โœ… Intuitive energy management interface
  • โœ… Actionable AI recommendations
  • โœ… Real-time feedback and control
  • โœ… Professional design and animations

๐Ÿ“ˆ Performance Metrics

  • 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

๐Ÿ› ๏ธ Technology Stack

Backend

  • Node.js with Express.js
  • WebSocket for real-time communication
  • IBM watsonx.ai SDK
  • Device simulation with realistic patterns

iOS App

  • SwiftUI 5.0 with @Observable pattern
  • Combine framework for reactive programming
  • Network framework for connection monitoring
  • Native iOS performance optimization

AI/ML

  • IBM watsonx.ai platform
  • Granite-3-8b-instruct model
  • Statistical fallback algorithms
  • Real-time data processing

๐Ÿ“„ License

MIT License - Built for IBM TechXchange Hackathon 2025

๐Ÿ‘จโ€๐Ÿ’ป Author

Amit Kumar Yadav K Aryan Yadav Srikar

  • IBM TechXchange Hackathon 2025 Participant
  • Smart Energy Optimization with watsonx.ai

About

๐Ÿก Smart Energy Optimizer - IBM TechXchange Hackathon 2025 with watsonx.ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •