Skip to content

Add Energy Consumption Dashboard with Cost Tracking #55

@mholzi

Description

@mholzi

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

  • Real-time power usage display (watts)
  • Historical consumption by day/week/month
  • Cost calculation based on user-configured rates
  • Per-device breakdown sorted by usage
  • Per-room aggregation
  • Comparison with previous period (% change)
  • Visual chart of usage over time
  • Admin settings for price/currency
  • Works with standard Home Assistant energy entities
  • Graceful handling when no energy sensors exist
  • Fully translated (EN/DE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogNot scheduled for any releaseenhancementNew feature or requestpost-mvpDeferred to post-MVPresearch-plannedDeep dive research session scheduled

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions