Modern energy monitoring and power consumption visualization for Home Assistant
Built with the tools and technologies:
A modern, professional Home Assistant custom card for displaying electricity usage and power consumption data. The Ohm Assistant Card provides real-time energy monitoring with beautiful charts and intuitive area-based entity discovery, making it easy to track your home's energy consumption patterns.
- Real-time Power Monitoring - Shows current power consumption in Watts with live updates
- Daily Energy Tracking - Displays daily energy usage in kWh with historical data
- Dual Y-Axis Charts - Separate scales for power (W) and energy (kWh) on the same chart
- Interactive Tooltips - Hover over data points to see exact values and timestamps
- Professional UI - Clean, modern card design with gradient icons and smooth animations
- Theme Integration - Automatically adapts to Home Assistant's light and dark themes
- Responsive Layout - Optimized for both desktop and mobile viewing
- Visual Indicators - Color-coded statistics to understand energy consumption at a glance
- Automatic Entity Detection - Automatically finds power and energy entities within a specified area
- Smart Entity Mapping - Intelligently identifies power (W) and energy (kWh) sensors
- Device Integration - Works seamlessly with Home Assistant's area and device structure
- Flexible Configuration - Override auto-discovery with custom entity lists
- Interactive Charts - Built with Chart.js for smooth, responsive data visualization
- Chart Type Selection - Choose between Line charts (detailed), Stacked Bar charts (overview), or Stacked Line charts
- Line charts: 5-minute data aggregation for smooth, detailed visualization
- Stacked Line charts: Line charts with stacking enabled for cumulative visualization
- Bar charts: Hourly aggregation for larger, easier-to-read bars with stacking support
- Untracked Power Visualization - See power consumption not tracked by individual entities (bar charts only)
- Automatically calculates:
untracked = total_power - sum(tracked_power_entities) - Displays as a gray bar stacked on top of tracked power
- Perfect for identifying phantom loads and unmetered devices
- Automatically calculates:
- Multiple Line Types - Choose from normal, gradient, gradient-no-fill, or no-fill line styles
- Customizable Legends - Configure legend display (entities, compact, or none)
- Axis Control - Show/hide X and Y axes independently. Power (W) and Energy (kWh) axes are only displayed when their data is present.
- Time-based Data - Automatic time scaling with proper date/time formatting
Stacked Bar Chart w/ Untracked Consumption
Stacked Line Chart w/ Untracked Consumption
- Visual Editor - Easy configuration through Home Assistant's card editor
- YAML Support - Full YAML configuration for advanced users
- Feature Flags - Toggle functionality like hiding card name or excluding default entities
- Chart Customization - Fine-tune chart appearance and behavior
- Entity Override - Specify custom entities to include or exclude
Note
This card works with any Home Assistant entities that have device_class: power (for Watts) or device_class: energy (for kWh). No additional integrations are required.
NOTE: may not work until the project is added to HACS official, see Manual Installation
- Open HACS in your Home Assistant instance
- Click the menu icon in the top right and select "Custom repositories"
- Add this repository URL and select "Dashboard" as the category
https://github.com/homeassistant-extras/ohm-assistant
- Click "Install"
- Download the
ohm-assistant.jsfile from the latest release in the Releases tab. - Copy it to your
www/community/ohm-assistant/folder - Add the following to your
configuration.yaml(or add as a resource in dashboards menu)
lovelace:
resources:
- url: /local/community/ohm-assistant/ohm-assistant.js
type: moduleAdd the card to your dashboard using the UI editor or YAML:
The card is fully configurable through the card editor, allowing you to customize:
- Area selection for automatic entity discovery
- Custom entity lists
- Chart configuration options
- Feature toggles
This is the most minimal configuration needed to get started:
type: custom:area-energy-card
area: living_roomFor custom entity configuration:
type: custom:area-energy-card
area: living_room
entities:
- sensor.living_room_power
- sensor.living_room_energyThe card will automatically:
- Detect power and energy entities within the specified area
- Create beautiful charts with dual Y-axis (power in W, energy in kWh)
- Display real-time data with historical context
- Adapt to your Home Assistant theme
| Name | Type | Default | Description |
|---|---|---|---|
| area | string | Required | The area name to automatically discover energy/power entities |
| name | string | Area Energy | Custom name for the card |
| entities | array | auto | Custom list of entities to include (see Entity Configuration) |
| chart | object | none | Chart configuration options |
| features | array | none | Feature flags to enable/disable functionality |
The entities field accepts two formats:
String Format (simple entity IDs):
entities:
- sensor.living_room_power
- sensor.living_room_energyObject Format (with custom colors and names):
entities:
- entity_id: sensor.living_room_power
color: '#ff0000' # Hex color
- entity_id: sensor.living_room_energy
color: 'rgba(0, 255, 0, 0.8)' # RGBA color with transparency
- entity_id: sensor.waschmaschinensteckdose_leistung
name: Waschmaschine # Custom display name in charts/legends
- entity_id: sensor.kuhlschrank_garage_leistung
name: KΓΌhlschrank Garage
- entity_id: sensor.bedroom_power
color: 'primary' # Home Assistant theme colorMixed Format (combine both):
entities:
- sensor.living_room_power # Uses default color
- entity_id: sensor.living_room_energy
color: '#00ff00' # Custom colorWhen using the object format:
entity_id(required): The entity ID stringcolor(optional): Color value in any CSS format (hex, rgba, named colors, etc.) or Home Assistant theme colors (primary, accent, red, blue, green, etc.)name(optional): Custom display name for the entity in charts and legends (e.g. "Waschmaschine" instead of the entity's friendly_name)
Entities without custom colors will use the default color scheme based on their type (power/energy) and position.
| Name | Type | Default | Description |
|---|---|---|---|
| chart_type | string | line | Chart type: line (detailed), stacked_bar (overview), or stacked_line (stacked lines) |
| total_power_entity | string | none | Total power entity ID for untracked power visualization (stacked charts only) |
| legend_style | string | entities | Legend display style: entities, compact, none |
| axis_style | string | all | Axis display: all, x_only, y_only, none. Power/Energy axes are only shown when their data is present. |
| line_type | string | normal | Line style: normal, gradient, gradient_no_fill, no_fill |
| Feature | Description |
|---|---|
| hide_name | Hide the card name from display |
| exclude_default_entities | Exclude default auto-discovered entities |
Power Entity:
device_class: powerunit_of_measurement: W- Example:
sensor.living_room_power
Energy Entity:
device_class: energyunit_of_measurement: kWh- Example:
sensor.living_room_energy
The card automatically discovers energy and power entities within the specified area based on:
- Entity
device_class(power or energy) - Entity
unit_of_measurement(W for power, kWh for energy) - Entity relationships to the area
This includes sensors with the appropriate device classes and units.
type: custom:area-energy-card
area: living_roomtype: custom:area-energy-card
area: living_room
name: 'Living Room Energy Monitor'type: custom:area-energy-card
area: living_room
entities:
- sensor.living_room_power
- sensor.living_room_energytype: custom:area-energy-card
area: living_room
entities:
- sensor.living_room_power # Default color
- entity_id: sensor.living_room_energy
color: '#ff6b6b' # Custom red color
- entity_id: sensor.kitchen_power
color: '#4ecdc4' # Custom teal color
name: KΓΌhlschrank Garage # Custom display name
- entity_id: sensor.bedroom_power
color: 'primary' # Home Assistant theme colortype: custom:area-energy-card
area: living_room
chart:
chart_type: stacked_bar # Use bar charts for better overview
legend_style: compact
axis_style: y_only
line_type: gradienttype: custom:area-energy-card
area: living_room
chart:
chart_type: stacked_bar # Required for untracked power
total_power_entity: sensor.total_power # Your total power entityNote: Untracked power visualization only works with chart_type: stacked_bar or chart_type: stacked_line. The card will automatically calculate and display the difference between total power and the sum of tracked power entities.
type: custom:area-energy-card
area: living_room
features:
- hide_name
- exclude_default_entitiestype: custom:area-energy-card
area: living_room
name: 'Living Room Energy Monitor'
entities:
- sensor.living_room_power # Default color
- entity_id: sensor.living_room_energy
color: '#10b981' # Custom green color
chart:
chart_type: stacked_bar # Use bar charts
total_power_entity: sensor.total_power # Track untracked power
legend_style: entities
axis_style: all
line_type: gradient_no_fill
features:
- hide_nameComing soon - screenshots of the card in action will be added here.
-
Initial design: Create initial area energy card design -
Area-based discovery: Automatic detection of energy/power entities within areas -
Dual metric display: Real-time power (W) and energy (kWh) visualization -
Chart integration: Chart.js implementation with dual Y-axis support -
Modern UI: Professional design with theme integration -
Configuration options: Visual editor and YAML support -
Feature flags: Toggle functionality like hiding card name -
Chart customization: Multiple line types and legend styles -
Performance optimization: Efficient rendering with memoization -
TypeScript support: Full type safety and modern development -
UI improvements: Tweaks and changes for the UI - thanks @LamarcLS -
Custom entity colors and name: Choose colors/name for individual chart items - thanks @LamarcLS, @frankfrommelt -
Conditional axis display: Show Power/Energy axes only when their data is displayed - thanks @frankfrommelt -
Chart type selection: Line and Stacked Bar chart options - thanks @LamarcLS -
Untracked power visualization: Visualize power consumption not tracked by individual entities - thanks @LamarcLS
- π¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
- π Report Issues: Submit bugs found or log feature requests for the
ohm-assistantproject. - π‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
- π£ Check out discord: Need further help, have ideas, want to chat?
- π Check out my other cards! Maybe you have an integration that I made cards for.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your GitHub account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/homeassistant-extras/ohm-assistant
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
- Node.js 18+
- Yarn or npm
cd ohm-assistant
yarn installyarn watchyarn buildyarn testyarn formatThis project is protected under the MIT License. For more details, refer to the LICENSE file.
- Built using LitElement
- Chart visualization powered by Chart.js
- Inspired by modern energy monitoring dashboards
- Thanks to all contributors!
Forgive me and my badges..
Stats
Ratings




