The Home tile in the Energy tab always shows “— kWh”. The Grid and Battery tiles show correct values, and the flow animation between grid, battery and home is correct. Restarting Homey and the app does not help.
Setup
Homey Pro (Early 2023), firmware 13.5.3
Homey mobile app 10.1.3.2136, iOS 27.0.1
No solar panels
A hybrid inverter with a battery, exposed by my own app as two devices:
Both configs are copied from the SDK docs (Energy | Homey Apps SDK). measure_power follows the documented signs: the battery is positive when charging and negative when discharging.
Every hourly sub-report has numbers in all of these fields, so the home total can be computed: imported − exported + discharged − charged = 8.13 kWh. In /api/manager/energy/live, totalCumulative and totalConsumed have values, and totalGenerated.W is null.
What I observed
In every period I checked, the Home tile showed “—” whenever the battery had non-zero energy in that period. I don’t know whether this is the cause.
Adding a virtual solar panel so that generatedPeriod became 0 instead of null did not change anything.
You added the energy config to your driver config?
Dod you also update existing devices? Devices added before don’t get auto updated. Only new added devices are using the driver energy config.
If that"s the case, just update the device (something like this):
// update energy settings
let energy = JSON.parse(JSON.stringify(this.getEnergy())) || {};
if (energy["electricCar"] == undefined){
energy["electricCar"] = true;
await this.setEnergy( energy );
}
Both devices were paired with the energy blocks already in place. meter_power.exported and cumulativeExportedCapability were added to Grid later in an app update; the device got the capability through addCapability, and the output above shows that Homey picked up the new energy config as well. The Home tile showed “— kWh” both before and after that change.
It would help a lot to know exactly how Homey calculates the Home value: which report fields it uses and what makes it show “—” instead of a number. Then I could check which input is missing on my side.
In short:
For current energy (the chart), the measure_power capability is used. And the device class (electricCar, solarpanel) or energy setting (homebattery) defines the type.
For meter data (the house with the “lines”), meter_power capability is used. Then the energy setting defines the imported/exported subcapability.
But that’s more or less described in the SDK you already used.
And as hint: The meter data needs some time to appear. Perhaps it’s shown at next day. Reason is not to show the current meter value as today usage. Homey stores the meter data and calculates the daily difference to show this in the house drawing.
Thanks! I don’t think it’s a matter of waiting: the tile has stayed “— kWh” for several days. In the meantime I found exactly when it happens, using two test devices whose values I control.
Setup
My real Grid and Battery devices are set to “Exclude from Energy”.
Energy reports were deleted (DELETE /api/manager/energy/reports).
Two test devices with the energy config from the SDK docs:
Test Grid: sensor, cumulative: true, cumulativeImportedCapability: meter_power.imported, cumulativeExportedCapability: meter_power.exported
Test Battery: battery, homeBattery: true, meterPowerImportedCapability: meter_power.charged, meterPowerExportedCapability: meter_power.discharged
Each device reports a constant measure_power and integrates it into its meters every 10 s.
Result
Step
Grid
Battery
Home tile
1
1000 W (import)
—
number, equals Grid
2
1000 W
+500 W (charging)
number: Grid 86 Wh = Home 78 Wh + Battery 8 Wh
3
0 W
−100 W (discharging)
“— kWh” within about a minute
4
0 W
+500 W
still “—” (the day already has discharged energy)
5
−250 W (export)
−100 W
number again as soon as the day has exported energy
So the Home tile shows “—” when the period has battery discharged energy > 0 and exported energy = 0. As soon as there is any export, the value is correct. Without discharge, it is also correct.
I have no solar panels and never export, so every day the battery discharges shows “— kWh”. The day report has all the numbers, so this looks like a bug in how the app or the backend computes the Home value.
Also: while the battery discharges, /api/manager/energy/live reports a negative totalConsumed. The battery’s negative measure_power is summed with the consumers.
Steps to reproduce:
Use a cumulative meter without export and a home battery.
Deleted all Energy reports with DELETE /api/manager/energy/reports.
Added the two test devices described above (Test Grid: cumulative, Test Battery: homeBattery), both at 0 W.
Set Grid = 1 kW, Battery = 0 W. Result: Home = Grid.
Set Battery = +500 W (charging). Result is exact: Home = Grid − Battery.
Set Grid = 0 W, Battery = −500 W (discharging). Result: Home = “— kWh” right away.
The same happens with steps 1 → 2 → 5. So as soon as the battery discharges, Home becomes “—”.
The only fix I found: the day needs an export increase of at least 0.001 kWh (1 Wh). As soon as I add that, Home shows a correct value again.
I thought it might be related to the export events. Maybe when Homey sees a discharge, it looks for export events to include in the calculation. There are none, so maybe it gets export = null and the calculation breaks.
So I tried increasing the export meter by only 0.000001 kWh. Homey rounds meter_power to 3 decimals (decimals: 3 in the capability definition), so the stored value did not change, although lastUpdated was updated. That did not help: Home stayed “—”. Only an increase of 0.001 kWh brings the correct value back.
This really looks like a bug in Homey, but it is not clear what exactly breaks. For now I see this workaround: let the app add 0.001 kWh to the exported meter once a day, at about 00:01 local time, so every day report contains some export before the battery starts discharging.