Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I read the individual inversers? #10

Open
Peterpc58 opened this issue Mar 31, 2020 · 11 comments
Open

How can I read the individual inversers? #10

Peterpc58 opened this issue Mar 31, 2020 · 11 comments

Comments

@Peterpc58
Copy link

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

@Sjord
Copy link
Owner

Sjord commented Apr 2, 2020

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?

@Peterpc58
Copy link
Author

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....

@Sjord
Copy link
Owner

Sjord commented Apr 3, 2020

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.

@Peterpc58
Copy link
Author

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
Copy link
Author

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

@Sjord
Copy link
Owner

Sjord commented May 17, 2020

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

@Peterpc58
Copy link
Author

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?

@DanielBroad
Copy link

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

Sjord added a commit that referenced this issue Sep 14, 2021
@Sjord Sjord mentioned this issue Sep 14, 2021
@Sjord
Copy link
Owner

Sjord commented Sep 14, 2021

I may have a fix: #24
Could you test it?

@DanielBroad
Copy link

confirmed fixed 👍

@Sjord
Copy link
Owner

Sjord commented Sep 14, 2021

I have merged that PR and made a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants