indykoning / PyPi_GrowattServer

MIT License
80 stars 34 forks source link

Change Growatt Server URL. #62

Closed wimdows-nl closed 1 year ago

wimdows-nl commented 1 year ago

Current package throws a 403, unless you use the new server URL.

chickenphone commented 1 year ago

I changed the url in _init.py to server_url = 'https://server.growatt.com/'

then I tried the code "example.py" This time no 403 error but my output is like this:

Enter username:myusername@gmail.com Enter password:*** Traceback (most recent call last): File "mix_example.py", line 39, in plant_list = api.plant_list(login_response['user']['id']) KeyError: 'user'

Is this response normal or what could be wrong ?

AnonTester commented 1 year ago

That error is likely a 509 or 507 where the api server blocked you for a little while. Happens from time to time, same issue with the shinephone app. Just wait a bit and try again later. Add a print(login_response) to see what the server responded with.

The server url is https://server.growatt.com

indykoning commented 1 year ago

The current URL set is actually the correct one and still the one being used and working when I test it. While server.growatt.com does work it is not the one designated for the API

However if server.growatt.com works better for you, feel free to set that URL after initialisation in your scripts https://github.com/indykoning/PyPi_GrowattServer#variables