Home Assistant Energy Management
SkillMonitoring & opsGuidance for using correct energy and power metrics in Home Assistant energy features
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Home Assistant Energy Management skill
What this skill tells your AI
The instructions your AI receives, as published by taurgis/has-marstek-local-api in .agents/skills/homeassistant-energy-management/SKILL.md and read by ahel’s review.
This skill helps you choose and expose the correct metrics for Home Assistant energy features (Energy Dashboard, grid, and individual devices) to avoid incorrect graphs or totals.
When to Use
- Adding or auditing energy-related sensors in an integration.
- Mapping device data to Home Assistant energy concepts (grid import/export, production, consumption).
- Fixing Energy Dashboard configuration or incorrect totals.
Core Rules
- Power vs Energy: Power is instantaneous (W), energy is accumulated (kWh).
- Energy sensors must be monotonically increasing totals (never reset except on rollover).
- Use state_class
total_increasingand device_classenergyfor kWh totals. - Use state_class
measurementand device_classpowerfor W values. - Avoid mixing sign conventions for energy; separate import and export sensors.
Metric Mapping
| Concept | Correct Metric | Unit | Notes |
|---|---|---|---|
| Grid import | Total energy imported | kWh | Separate from export; total_increasing |
| Grid export | Total energy exported | kWh | Separate from import; total_increasing |
| Solar/production | Total energy produced | kWh | Must be total_increasing |
| Home consumption | Total energy consumed | kWh | Prefer derived if not provided |
| Instant grid power | Power at grid | W | Positive/negative must be consistent |
Grid Data Guidance
- Provide two energy totals for grid: import and export.
- If the device reports net energy, split into import/export totals before exposing sensors.
- Keep grid power sign conventions consistent with your integration (document it).
Individual Devices
- Each device should expose energy consumed (kWh) as a total_increasing sensor.
- If only power is available, use a platform-level integration sensor to integrate power into energy.
- Avoid using daily reset counters as energy totals unless clearly marked and not used in Energy Dashboard totals.
Implementation Checklist
- Use
device_class=energy,state_class=total_increasing,native_unit_of_measurement=kWh. - For power, use
device_class=power,state_class=measurement,native_unit_of_measurement=W. - Ensure totals never decrease; filter resets or rollovers.
- Add documentation to explain data sources and sign conventions.
- Validate sensor types in the Energy Dashboard configuration.
Reference
Signals
- GitHub stars
- 35
- Forks
- 5
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
homeassistant-energy-management- Source
- github.com/taurgis/has-marstek-local-api
github.com/taurgis/has-marstek-local-api
More in Monitoring & ops
Skill · anthropics
More in Monitoring & opsagent-eval
Skill · affaan-m
More in Monitoring & opsarchitecture-decision-records
Skill · affaan-m
More in Monitoring & opsbabysit
Skill · thedotmack
More in Monitoring & opseng-runbook
Skill · nexu-io
More in Monitoring & opsweekly-update
Skill · nexu-io
More in Monitoring & ops