Description
Create a dedicated energy consumption view showing real-time and historical power usage per room and device, with daily/weekly/monthly trends and estimated cost calculations based on user-configured energy rates.
Priority
High - Data Visualization
Current Gap
- No energy consumption visibility
- No cost estimates for electricity usage
- No per-device or per-room breakdown
- No historical trends for energy usage
- Users can't identify energy-hungry devices
- No comparison between time periods
Proposed Solution
1. Energy Service
Core service for fetching and calculating energy data:
- Real-time power - Current watts from power sensors
- Historical consumption - kWh from energy sensors over time periods
- Cost calculation - Based on user-configured price per kWh
- Room aggregation - Group device consumption by room
- Period comparison - Compare current vs previous period
2. Energy Dashboard UI
Current Usage Section:
┌─────────────────────────────┐
│ 1,234 W │
│ Current Power Usage │
└─────────────────────────────┘
Period Selector:
[ Today ] [ This Week ] [ This Month ]
Stats Grid:
┌─────────┬─────────┬─────────┐
│ 45.2 │ €13.56 │ 12 │
│ kWh │ Cost │ Devices │
│ +5.2% │ │ │
└─────────┴─────────┴─────────┘
Top Consumers List:
1. 🔌 Washing Machine 8.5 kWh €2.55
Laundry Room
2. 🔌 Refrigerator 6.2 kWh €1.86
Kitchen
3. 🔌 Desktop Computer 4.1 kWh €1.23
Office
...
3. Admin Configuration
Settings for energy tracking:
- Price per kWh - User's electricity rate (default: €0.30)
- Currency - EUR, USD, GBP, CHF
- Show costs - Toggle cost display on/off
4. Chart Visualization
- Line chart showing consumption over time
- Zoomable by period (day shows hourly, week shows daily, month shows weekly)
- Comparison overlay with previous period (optional)
Files to Create/Modify
frontend/services/energy-service.js - Energy data service
frontend/features/energy/energy-dashboard.js - Main dashboard component
frontend/features/energy/energy-chart.js - Chart component
frontend/features/admin/energy-settings.js - Admin configuration
frontend/features/home/index.js - Add energy card/link to main dashboard
frontend/locales/en.json / de.json - i18n strings
Acceptance Criteria
Description
Create a dedicated energy consumption view showing real-time and historical power usage per room and device, with daily/weekly/monthly trends and estimated cost calculations based on user-configured energy rates.
Priority
High - Data Visualization
Current Gap
Proposed Solution
1. Energy Service
Core service for fetching and calculating energy data:
2. Energy Dashboard UI
Current Usage Section:
Period Selector:
Stats Grid:
Top Consumers List:
3. Admin Configuration
Settings for energy tracking:
4. Chart Visualization
Files to Create/Modify
frontend/services/energy-service.js- Energy data servicefrontend/features/energy/energy-dashboard.js- Main dashboard componentfrontend/features/energy/energy-chart.js- Chart componentfrontend/features/admin/energy-settings.js- Admin configurationfrontend/features/home/index.js- Add energy card/link to main dashboardfrontend/locales/en.json/de.json- i18n stringsAcceptance Criteria