Skip to content
New issue

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

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

Already on GitHub? # to your account

Use newTwoLoginAPI to login #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use newTwoLoginAPI to login #31

wants to merge 1 commit into from

Conversation

Sjord
Copy link
Owner

@Sjord Sjord commented Jun 28, 2022

Closes #30

@thomytp
Copy link

thomytp commented Jul 16, 2022

I use newTwoLoginAPI but I get a login error:

  File "/growatt_api_client/venv/lib/python3.6/site-packages/growatt-0.0.4-py3.6.egg/growatt/__init__.py", line 71, in login
    result = self._back_success_response(response)
  File "/growatt_api_client/venv/lib/python3.6/site-packages/growatt-0.0.4-py3.6.egg/growatt/__init__.py", line 157, in _back_success_response
    raise GrowattApiError("Request failed: %s" % response)
growatt.GrowattApiError: Request failed: <Response [400]>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/growatt_api_client/venv/lib/python3.6/site-packages/growatt-0.0.4-py3.6.egg/growatt/__main__.py", line 9, in <module>
    api.login(username, password)
  File "/growatt_api_client/venv/lib/python3.6/site-packages/growatt-0.0.4-py3.6.egg/growatt/__init__.py", line 76, in login
    raise LoginError
growatt.LoginError

The Login and the pass are correct...

@Sjord
Copy link
Owner Author

Sjord commented Jul 18, 2022

@thomytp Did it work before? Have you tried quoting your username and password? Are you perhaps on another server?

@dejavuus
Copy link

@thomytp Did it work before? Have you tried quoting your username and password? Are you perhaps on another server?

Hi,

Thanks for the Hard work on this. I just came across this 2 days ago and I am trying to install this to work with my New growatt SPH6000 inverter.

I have followed the instructions but unable to login.

I am able to login only on the server.growatt.com url website but not on the growatt us server url on the website.

I have quoted the username and password on the arguement line but it dosn work, I have edited the main_py file to add the username and password also with no luck.

With regards to the newTwoLoginAPI section in the init_py file, am I meant to change the username and password in double quote on line 68 into my username and password ( in the data brackets?)

""" password_md5 = hash_password(password) response = self.session.post( self.get_url("newLoginAPI.do"), self.get_url("newTwoLoginAPI.do"), data={"**userName**": username, "**password**": password_md5},

Thanks for your help.

Just to be sure I didnt miss any step, I followed the instructions you gave on the Setup page. I didnt edit the test.py file nor did I edit any other file aside of entering the username and password in the main_py file

username = "username" password = "password"

@thomytp
Copy link

thomytp commented Jul 24, 2022

@thomytp Did it work before? Have you tried quoting your username and password? Are you perhaps on another server?

@dejavuus sorry for the late response..

I can login in https://server.growatt.com/# but not in http://server-us.growatt.com. The Shine App works normal.
I use your API since one year, without Problems...

Thanks for your Work..:-)

Greetings...

@Sjord Sjord mentioned this pull request Jul 26, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems logging in
3 participants