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

Problems logging in #30

Open
Sjord opened this issue Jun 20, 2022 · 2 comments · May be fixed by #31
Open

Problems logging in #30

Sjord opened this issue Jun 20, 2022 · 2 comments · May be fixed by #31

Comments

@Sjord
Copy link
Owner

Sjord commented Jun 20, 2022

@WynandPrivate

See also indykoning/PyPi_GrowattServer#28

Sjord added a commit that referenced this issue Jun 28, 2022
@Sjord Sjord linked a pull request Jun 28, 2022 that will close this issue
@rulez86
Copy link

rulez86 commented Jan 23, 2023

Hello folks,
have a questions. I', trying to login to my growatt, but get following error by running mix_example.py. Any idea? I read the forum with having the newTwoLoginAPI issue, but it looks like it's already using this. But unfortunatelly it's still not working.

Do you know if i have to activate my account to be aple to use the api?

debian@debian11:~/growatt2/PyPi_GrowattServer/examples$ python3 mix_example.py
Enter username:
Enter password:
Traceback (most recent call last):
File "/home/debian/growatt2/PyPi_GrowattServer/examples/mix_example.py", line 37, in
login_response = api.login(username, user_pass)
File "/home/debian/.local/lib/python3.9/site-packages/growattServer/init.py", line 131, in login
response = self.session.post(self.get_url('newTwoLoginAPI.do'), data={
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 662, in send
r = dispatch_hook('response', hooks, r, **kwargs)
File "/usr/lib/python3/dist-packages/requests/hooks.py", line 31, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
File "/home/debian/.local/lib/python3.9/site-packages/growattServer/init.py", line 41, in
'response': lambda response, *args, **kwargs: response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://server-api.growatt.com/newTwoLoginAPI.do

@Sjord
Copy link
Owner Author

Sjord commented Jan 24, 2023

Growatt recently began blocking certain user-agents. It seems they don't want us to use this API. That's probably what you're experiencing.

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

Successfully merging a pull request may close this issue.

2 participants