growatt_api_client icon indicating copy to clipboard operation
growatt_api_client copied to clipboard

Current Power Value different to web / mobile app

Open exiom-xyz opened this issue 5 years ago • 2 comments

I get the following results from your script... with u'currentPower': u'2.44 kW'

{u'data': [{u'todayEnergy': u'32.6 kWh', u'totalEnergy': u'105 kWh', u'currentPower': u'2.44 kW', u'isHaveStorage': u'false', u'plantMoneyText': u'525.0 ', u'plantId': u'274240', u'plantName': u'R19'}, {u'todayEnergy': u'0 kWh', u'totalEnergy': u'0 kWh', u'currentPower': u'0 W', u'isHaveStorage': u'false', u'plantMoneyText': u'0.0 ', u'plantId': u'274226', u'plantName': u'R18'}], u'success': True, u'totalData': {u'totalEnergySum': u'105 kWh', u'todayEnergySum': u'32.6 kWh', u'eTotalMoneyText': u'525.0 ', u'CO2Sum': u'104.68 T', u'isHaveStorage': u'false', u'currentPowerSum': u'2.44 kW'}}

but on the website and the iOS app, I get Current Power 3.21kW why is there such a significant difference?

Also how do I get rid of the "u" being littered around the data?

exiom-xyz avatar Mar 16 '20 07:03 exiom-xyz

Thank you for this issue, @jacksonhk. Are you comparing the correct plants? In the data above, R19 is generating 2.44 kW, and R18 is generating 0 W. Does the website show the total of both plants? I will check tomorrow if I can reproduce this mismatch.

The code in main retrieves the data and prints it, in a format that Python uses to represent objects. In Python 2, a "u" is prepended to indicate these are Unicode strings. If you want to output JSON, you can change the print statement to the following:

import json
print(json.dumps(plant_detail))

Sjord avatar Mar 16 '20 17:03 Sjord

I wasn’t looking at the combined output besides R18 is not yet online.

However at the time of reply the results are now matching so I’m a bit perplexed...

Thanks for your quick reply tho... and thanks for the tip on python

exiom-xyz avatar Mar 17 '20 06:03 exiom-xyz