diff --git a/meter/shelly/connection.go b/meter/shelly/connection.go index 63cfe8d8c..191ee7c09 100644 --- a/meter/shelly/connection.go +++ b/meter/shelly/connection.go @@ -184,9 +184,9 @@ func (d *Connection) TotalEnergy() (float64, error) { switch { case d.channel < len(res.Meters): - energy = float64(res.Meters[d.channel].Total) / 60 + energy = res.Meters[d.channel].Total / 60 case d.channel < len(res.EMeters): - energy = float64(res.EMeters[d.channel].Total) / 60 + energy = res.EMeters[d.channel].Total / 60 default: return 0, errors.New("invalid channel, missing power meter") } diff --git a/meter/shelly/types.go b/meter/shelly/types.go index 0a37575a9..040fed021 100644 --- a/meter/shelly/types.go +++ b/meter/shelly/types.go @@ -44,11 +44,11 @@ type Gen1SwitchResponse struct { type Gen1StatusResponse struct { Meters []struct { Power float64 - Total int64 + Total float64 } // Shelly EM meter JSON response EMeters []struct { Power float64 - Total int64 + Total float64 } }