Zendure: fix battery power (#17443)

This commit is contained in:
Vrabetz 2024-11-25 20:48:27 +01:00 • committed by GitHub
parent aa513c43de
commit d7e87bf207
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -57,7 +57,7 @@ func (c *Zendure) CurrentPower() (float64, error) {
case "pv":
return float64(res.SolarInputPower), nil
case "battery":
return float64(res.GridInputPower) - float64(res.OutputHomePower), nil
return float64(res.PackInputPower) - float64(res.OutputPackPower), nil
default:
return 0, fmt.Errorf("invalid usage: %s", c.usage)
}

View file

@ -48,6 +48,7 @@ type Data struct {
MasterSwitch bool `json:"masterSwitch"` // true,
OutputLimit int `json:"outputLimit"` // 0,
OutputPackPower int `json:"outputPackPower"` // 70,
PackInputPower int `json:"packInputPower"` // 70,
OutputHomePower int `json:"outputHomePower"` // 70,
PackNum int `json:"packNum"` // 1,
PackState int `json:"packState"` // 0,