Site: add returnEnergy to aggregated battery state (#33241)

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
github-actions[bot] 2026-08-28 09:05:47 +02:00 • committed by GitHub
parent 8ccd72e141
commit ea8e2a72c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 11 deletions

View file

@ -3843,7 +3843,11 @@
"type": "number"
},
"energy": {
"description": "Total battery energy in kWh.",
"description": "Total discharged energy in kWh.",
"type": "number"
},
"returnEnergy": {
"description": "Total charged energy in kWh.",
"type": "number"
},
"devices": {

View file

@ -152,7 +152,7 @@ func (suite *mqttSuite) TestMeasurement() {
func (suite *mqttSuite) TestBatteryState() {
topics := lo.Map([]string{
"power", "energy", "capacity", "soc",
"power", "energy", "returnEnergy", "capacity", "soc",
"devices", "devices/1/name", "devices/1/title", "devices/1/icon", "devices/1/power", "devices/1/energy", "devices/1/returnEnergy", "devices/1/powers", "devices/1/currents", "devices/1/excessDCPower", "devices/1/capacity", "devices/1/soc", "devices/1/controllable", "devices/1/suggestion",
"forecast",
}, func(s string, _ int) string {
@ -169,5 +169,5 @@ func (suite *mqttSuite) TestBatteryState() {
})
suite.Equal(topics, suite.topics, "topics")
suite.Equal([]string{"2", "", "", "20", "1", "", "", "", "1", "", "", "", "", "", "", "10", "", "", ""}, suite.payloads, "payloads")
suite.Equal([]string{"2", "", "", "", "20", "1", "", "", "", "1", "", "", "", "", "", "", "10", "", "", ""}, suite.payloads, "payloads")
}

View file

@ -302,7 +302,10 @@ components:
description: Charge level in %. Weighted by capacity across all batteries.
type: number
energy:
description: Total battery energy in kWh.
description: Total discharged energy in kWh.
type: number
returnEnergy:
description: Total charged energy in kWh.
type: number
devices:
description: Measurement data per battery meter.