Overview
Modern energy and power-consumption views for Home Assistant, turning meter and circuit entities into readable charts and summaries for everyday use. Aims to make usage patterns and peaks obvious without exporting data to a separate tool. TypeScript Lovelace front end, HACS distribution, and design tuned for clarity on both phone and desktop dashboards.
README
⚡ Ohm Assistant Card
<p align="center"> <img src="assets/card.png" align="center" width="50%"> </p> <p align="center"><h1 align="center">Ohm Assistant Card</h1></p> <p align="center"> <em>Modern energy monitoring and power consumption visualization for Home Assistant</em> </p>
Overview
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.
Features
📊 Dual Metric Display
- 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

🎨 Modern Design
- 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

🏠 Area-Based Discovery
- 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
📈 Advanced Charting
- 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
No Fill
Gradient No Fill
Gradient
Stacked Bar Chart w/ Untracked Consumption
Stacked Line Chart w/ Untracked Consumption
⚙️ Flexible Configuration
- 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
Installation
Prerequisites
[!NOTE]
This card works with any Home Assistant entities that havedevice_class: power(for Watts) ordevice_class: energy(for kWh). No additional integrations are required.
HACS (Recommended)
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"
Manual Installation
- 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: module
Usage
Add the card to your dashboard using the UI editor or YAML:
Card Editor
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
YAML
This is the most minimal configuration needed to get started:
type: custom:area-energy-card
area: living_room
For custom entity configuration:
type: custom:area-energy-card
area: living_room
entities:
- sensor.living_room_power
- sensor.living_room_energy
The 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
Configuration Options
| 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 |
Entity Configuration
The entities field accepts two formats:
String Format (simple entity IDs):
entities:
- sensor.living_room_power
- sensor.living_room_energy
Object 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 color
Mixed Format (combine both):
entities:
- sensor.living_room_power # Uses default color
- entity_id: sensor.living_room_energy
color: '#00ff00' # Custom color
When 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.
Chart Configuration
| 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 Flags
| Feature | Description |
|---|---|
| hide_name | Hide the card name from display |
| exclude_default_entities | Exclude default auto-discovered entities |
Entity Requirements
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
Auto-discovery
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.
Example Configurations
Basic Configuration
type: custom:area-energy-card
area: living_room
With Custom Name
type: custom:area-energy-card
area: living_room
name: 'Living Room Energy Monitor'
With Custom Entities
type: custom:area-energy-card
area: living_room
entities:
- sensor.living_room_power
- sensor.living_room_energy
With Custom Entity Colors and Names
type: 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 color
With Chart Configuration
type: 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: gradient
With Untracked Power Visualization
type: 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 entity
Note: 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.
With Feature Flags
type: custom:area-energy-card
area: living_room
features:
- hide_name
- exclude_default_entities
Full Configuration Example
type: 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_name
Screenshots
Coming soon - screenshots of the card in action will be added here.
Project Roadmap
-
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
Contributing
- 💬 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.
- 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!
Development
Prerequisites
- Node.js 18+
- Yarn or npm
Setup
cd ohm-assistant
yarn install
Development Mode
yarn watch
Build
yarn build
Testing
yarn test
Formatting
yarn format
License
This project is protected under the MIT License. For more details, refer to the LICENSE file.
Acknowledgments
- Built using LitElement
- Chart visualization powered by Chart.js
- Inspired by modern energy monitoring dashboards
- Thanks to all contributors!
Code Quality
Forgive me and my badges..
Stats
Ratings
