johanmeijer / grott

Growatt inverter monitor
https://github.com/johanmeijer/grott/wiki
375 stars 103 forks source link

Values are wrong by factor of 10 #463

Open PietFourie opened 8 months ago

PietFourie commented 8 months ago

Hi. I have a SPF5000 ES inverter installed. I entered the Inverter type to SPF in the grott.ini file. It now provides the correct variables. In the command window (logging) the list of values, "- Grott values retrieved:" are correct and correspond to the output in the Growatt server and app. However, the "MQTT jsonmsg:" has all the values multiplied by 10. I am not sure why but this provides the wrong values to the MQTT server. Maybe this can be considered a bug? Bug.txt

johanmeijer commented 8 months ago

No this is not a bug. In the MQTT values the original values comming from the inverter are being used. Most often this means actual power is display in 0.1 W, energy in 0.1Kwh, Volt in 0.1 V. (as documented in the Growatt Modbus protocol documentation)

In the grott log the values are formatted to a more "readable" value. But for the MQTT message processing client (e.g HA, Nodered) it means it has to take care of the formatting/calculation.

PietFourie commented 8 months ago

Thank you for the clarification. I thought it might be something like that. That's why the question mark .... -:)

ORi0N commented 8 months ago

In your home assistant MQTT sensors use the value_template to correct *10 or /10

- state_topic: energy/growatt/TPXXXXX
  value_template: "{{ value_json['values']['pvpowerin'] | int / 10 }}"
  unique_id: growatt_actual_input_power_TPXXXXX
  device_class: power
  unit_of_measurement: "W"
  name: "Growatt TPXXXXXX - Input watt (Actual)"

and mark the issue as resolved ;)

johanmeijer commented 7 months ago

Can we close this issue (@PietFourie)