growatt_api_client icon indicating copy to clipboard operation
growatt_api_client copied to clipboard

How can I read the individual inversers?

Open Peterpc58 opened this issue 4 years ago • 11 comments

I have 2 inverters. How can I read the individual inverter values?

Peterpc58 avatar Mar 31 '20 15:03 Peterpc58

Thanks, @Peterpc58. This is kind of hard to test for me, since my environment only has one inverter. Could you try out the new get_all_device_list function?

Sjord avatar Apr 02 '20 13:04 Sjord

Do I call it like this: all_device_list = api.get_all_device_list() It gives me this error: AttributeError: 'GrowattApi' object has no attribute 'get_all_device_list'

I am new to this....

Peterpc58 avatar Apr 02 '20 19:04 Peterpc58

I added the get_all_device_list on a separate branch. First, you have to switch to that branch, using git.

If you haven't got a git repo yet, clone it like this:

git clone https://github.com/Sjord/growatt_api_client

If you have, update it like this:

git fetch

Then switch to the branch with the new function:

git checkout get-all-device-list

Then, change growatt/__main__.py or your own script to call get get_all_device_list, and pass it a plant_id:

device_list = api.get_all_device_list(plant_id)
print(device_list)

I would expect that to print information for each inverter.

Sjord avatar Apr 03 '20 15:04 Sjord

I get this error: AttributeError: 'GrowattApi' object has no attribute 'get_all_device_list' I also tried replacing plant_id with the pant id number, but same error.

Peterpc58 avatar Apr 04 '20 10:04 Peterpc58

Did it all over again and now it is working! Thanks! I have all the data I need now.

Peterpc58 avatar Apr 08 '20 21:04 Peterpc58

Indy Koning's Growatt script uses newPlantAPI.do?op=getAllDeviceListThree, while I use newTwoPlantAPI.do?op=getAllDeviceList. It would be interesting to compare these.

Sjord avatar May 17 '20 11:05 Sjord

a few days ago my script stpped working. I think the device_list = api.get_all_device_list(plant_id) gives he problem. This is returned: Traceback (most recent call last): File "testing.py", line 25, in device_list = api.get_all_device_list(plant_id) File "/home/pi/growatt_api_client/venv/lib/python3.7/site-packages/growatt-0.0.2-py3.7.egg/growatt/init.py", line 141, in get_all_device_list return response.json() File "/home/pi/growatt_api_client/venv/lib/python3.7/site-packages/requests-2.23.0-py3.7.egg/requests/models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 19)

can you help?

Peterpc58 avatar Sep 13 '21 19:09 Peterpc58

It seems newTwoPlantAPI.do?op=getAllDeviceList now gives an error 500

DanielBroad avatar Sep 14 '21 07:09 DanielBroad

I may have a fix: https://github.com/Sjord/growatt_api_client/pull/24 Could you test it?

Sjord avatar Sep 14 '21 08:09 Sjord

confirmed fixed 👍

DanielBroad avatar Sep 14 '21 08:09 DanielBroad

I have merged that PR and made a new release.

Sjord avatar Sep 14 '21 13:09 Sjord