Skip to content

Commit

Permalink
Powerwall: fix Wh to kWh conversion (#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Feb 8, 2023
1 parent d073107 commit cfb4ef1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions meter/powerwall.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func NewPowerWall(uri, usage, user, password string) (api.Meter, error) {
}

batteryCapacity = func() float64 {
return float64(res.NominalFullPackEnergy)
return float64(res.NominalFullPackEnergy) / 1e3
}
}

Expand Down Expand Up @@ -125,9 +125,9 @@ func (m *PowerWall) totalEnergy() (float64, error) {
if o, ok := res[m.usage]; ok {
switch m.usage {
case "load":
return float64(o.EnergyImported), nil
return float64(o.EnergyImported) / 1e3, nil
case "solar":
return float64(o.EnergyExported), nil
return float64(o.EnergyExported) / 1e3, nil
}
}

Expand Down

0 comments on commit cfb4ef1

Please sign in to comment.