diff --git a/templates/definition/meter/deye-hybrid-3p.yaml b/templates/definition/meter/deye-hybrid-3p.yaml index b0789521e..dbc59f458 100644 --- a/templates/definition/meter/deye-hybrid-3p.yaml +++ b/templates/definition/meter/deye-hybrid-3p.yaml @@ -311,8 +311,9 @@ render: | scale: 10 {{- end }} script: | + // float64 is required: a whole-number input arrives as an int literal // round, the watt conversion does not reproduce the written percent exactly - p := int(limit*100/{{ maxf .maxacpower 1 }} + 0.5) + p := int(float64(limit)*100/{{ maxf .maxacpower 1 }} + 0.5) if p > 100 { p = 100 }