ha-energy
The Energy dashboard config and statistics. Prerequisite:
../ha-shared/SKILL.md.
Read the energy setup
hass-cli energy prefs get # configured sources + device consumption
hass-cli energy validate # surface misconfigured sensors
hass-cli energy info # cost sensors / solar forecast domains
energy prefs get returns energy_sources (each with stat_energy_from/to,
stat_cost, ...) and device_consumption (per-device stat_consumption).
Those stat_* ids are statistic ids you feed to hass-cli statistics period.
A brand-new instance with no configured Energy dashboard returns
not_found: No prefsuntil you save prefs once.
Change the energy config
hass-cli energy prefs save --data @prefs.json
hass-cli energy prefs save --file prefs.yaml # YAML or JSON document
The payload mirrors energy prefs get: energy_sources + device_consumption
(+ device_consumption_water). Round-trip: get → edit → save. Use --data
(@file.json) for inline JSON or --file for a YAML/JSON document.
Pull consumption / cost numbers
Energy uses long-term statistics, not live state (see
../ha-statistics/SKILL.md):
hass-cli statistics period \
--ids sensor.grid_consumption,sensor.solar_production \
--start 2026-06-01T00:00:00+00:00 --period day
For "what used the most", read the device stat_consumption ids from
energy prefs get, then compare their sum deltas over the period.
Find energy sensors
hass-cli state list -o json | rg '"device_class": "energy"'
hass-cli statistics list --type sum