hon icon indicating copy to clipboard operation
hon copied to clipboard

Can not login with correct email and password

Open maxifly opened this issue 1 year ago • 20 comments

v0.13.0

I use EVO application on my phone.| I setup addon to HA, enter correct email and password (I check this information by logout/login on phone) In HA log I see that hon can not login In integration setting I see my email "Setup fail" and "No device or entityes".

Environment (please complete the following information):

  • Home Assistant Version: core-2024.5.4
  • hOn Integration Versionv 0.13.0
  • pyhOn Version ???

Additional context Add any other context about the problem here.

Home Assistant Logs Check System -> Logs if you can find any logs related to this integration and post it here.

Device Log Post your device info here (if available) 2024-06-01 17:10:34.864 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for hon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/init.py", line 41, in async_setup_entry hon = await Hon(**kwargs).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/hon.py", line 74, in create await self.setup() File "/usr/local/lib/python3.12/site-packages/pyhon/hon.py", line 105, in setup appliances = await self.api.load_appliances() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/api.py", line 84, in load_appliances async with self._hon.get(f"{const.API_URL}/commands/v1/appliance") as resp: File "/usr/local/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/base.py", line 64, in get async with self._intercept(*args, **kwargs) as response: File "/usr/local/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/hon.py", line 74, in _intercept kwargs["headers"] = await self._check_headers(kwargs.get("headers", {})) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/hon.py", line 64, in _check_headers await self.auth.authenticate() File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 258, in authenticate if not (url := await self._login()): ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 195, in _login await self._error_logger(response) File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 96, in _error_logger raise exceptions.HonAuthenticationError("Can't login") pyhon.exceptions.HonAuthenticationError: Can't login

maxifly avatar Jun 01 '24 14:06 maxifly

  1. Reset password in you hon app
  2. Remove integration entry in haier h0n integration
  3. Add again

tomaszwozniak avatar Jun 12 '24 06:06 tomaszwozniak

Hello there, I'm having the same issue and I also tried what @tomaszwozniak suggested but gives me the same error. My Logs: Dettagli registro (ERRORE) Registratore: homeassistant.config_entries Fonte: config_entries.py:594 Prima occorrenza: 12:39:22 (7 occorrenze) Ultima registrazione: 12:46:00

Error setting up entry [email protected] for hon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/init.py", line 41, in async_setup_entry hon = await Hon(**kwargs).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/hon.py", line 74, in create await self.setup() File "/usr/local/lib/python3.12/site-packages/pyhon/hon.py", line 105, in setup appliances = await self.api.load_appliances() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/api.py", line 84, in load_appliances async with self._hon.get(f"{const.API_URL}/commands/v1/appliance") as resp: File "/usr/local/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/base.py", line 64, in get async with self._intercept(*args, **kwargs) as response: File "/usr/local/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/hon.py", line 74, in _intercept kwargs["headers"] = await self._check_headers(kwargs.get("headers", {})) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/handler/hon.py", line 64, in _check_headers await self.auth.authenticate() File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 258, in authenticate if not (url := await self._login()): ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 195, in _login await self._error_logger(response) File "/usr/local/lib/python3.12/site-packages/pyhon/connection/auth.py", line 96, in _error_logger raise exceptions.HonAuthenticationError("Can't login") pyhon.exceptions.HonAuthenticationError: Can't login

Feirbran avatar Jun 14 '24 10:06 Feirbran

  1. Reset password in you hon app
  2. Remove integration entry in haier h0n integration
  3. Add again

This fixed it for me. Seems so easy in the end, but was reluctant to choose "delete".

ikreis avatar Jun 19 '24 09:06 ikreis

Yes, I had exactly the same problem today, but before deleting it (because I had similar concerns) I tried to persistently add the integration again, it ended with an empty window without any message. It wasn't until I looked at the server's response that I saw the actual error information (duplicate).

Also, remove and re-add according to the instructions.

mateuszfl avatar Jun 19 '24 09:06 mateuszfl

Log in to the website https://account2.hon-smarthome.com using your login and password and turn off Two-Factor Verification in your account settings. It worked for me.

daemon76 avatar Jun 21 '24 08:06 daemon76

Hmmm, I don't get it, I tried what is suggested here:

  1. Delete Integration
  2. Reset pwd
  3. Login as @daemon76 suggested and make sure 2FA is deactivated
  4. Readd Integration

I am stuck with the "Can't login" message posted by @Feirbran.

Maybe one thought, we had our account configured with Google Social Login, I reset the pwd today for the first time in like a year to get the integration to work. Might there be a difference on accounts that support social login? Could other people who have posted and cannot fix this confirm if this is the case on their account too?

mschmiedel avatar Jun 28 '24 16:06 mschmiedel

I did not use a social account, but it is possible that a social account is handled differently.

pt., 28 cze 2024 o 18:13 mschmiedel @.***> napisał(a):

Hmmm, I don't get it, I tried what is suggested here:

  1. Delete Integration
  2. Reset pwd
  3. Login as @daemon76 https://github.com/daemon76 suggested and make sure 2FA is deactivated
  4. Readd Integration

I am stuck with the "Can't login" message posted by @Feirbran https://github.com/Feirbran.

Maybe one thought, we had our account configured with Google Social Login, I reset the pwd today for the first time in like a year to get the integration to work. Might there be a difference on accounts that support social login? Could other people who have posted and cannot fix this confirm if this is the case on their account too?

— Reply to this email directly, view it on GitHub https://github.com/Andre0512/hon/issues/215#issuecomment-2197250986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANSG6LRKK6PBQVUEVIUIOI3ZJWDR7AVCNFSM6AAAAABIUGJELWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGI2TAOJYGY . You are receiving this because you were mentioned.Message ID: @.***>

daemon76 avatar Jun 28 '24 16:06 daemon76

@daemon76 , just to make it clear, I do not use the social login for the integration (this cannot work!), just created a pwd which I can use on the app and on the account2.hon-smarthome.com by hand, but not on the integration.

I just checked the pyhOn library:

Exception is raising here: image

Last thing it prints is this: homeassistant | 1 200 - https://account2.hon-smarthome.com/setup/secur/RemoteAccessAuthorizationPage.apexp?source

along with the full response body of that page, which has a few js if conditions for some redirect, but if I understand the code correctly from the auth.py, it seems to be looking for some "url=" regex or the access token, which it cannot find...

Redirects want to go to https://account2.hon-smarthome.com/loginflow/loginFlowOnly.apexp?retURL=...

However, these are js manual redirects, not http (30X) ones...

What is very strange, if I do the login in a browser, I never see the "RemoteAccessAuthorizationPage" in the log...

Maybe a feedback for @Andre0512: I activated debug in the HomaAssistant Integration, for the auth flow, it would be great if in that case every visited URL with response codes would be logged.

mschmiedel avatar Jun 29 '24 05:06 mschmiedel

One more comment here. I checked out the phyOn library and made a manual test from my pc. I can successfully login outside of HomeAssistant using the library. So I guess it might be some difference with the aiohttp HomeAssistant provides (maybe not in every case). I will see if I find a way to log stuff like the user-agent headers (in case they are set) and such...

mschmiedel avatar Jun 29 '24 08:06 mschmiedel

This is very strange, I just retested (without deleting and adding the integration) and it worked, maybe it was just a coincidence that something was wrong on server-side and I tested the lib manually after the fix. Now it works and I got the entities...

mschmiedel avatar Jun 29 '24 09:06 mschmiedel

Same problem here ... Can't login, tried to change the password, tried to delete and install the integration again, nothing works ... 😢 Edit: Also tried with pyH0n and have a similar problem.

But it's strange since, I don't have an HTTP error, instead it seems to get a 200, but for some reason, it's considered as an error

image

Triskae avatar Jul 09 '24 11:07 Triskae

Same login issue here. Credentials are good as they works in mobile app or via http page. PWD reset, integration re-download did not help :/

Logger: pyhon.connection.auth Zdroj: custom_components/hon/init.py:40 Integrácia: Haier hOn (dokumentácia, problémy) Prvýkrát sa vyskytol: 15:00:32 (1 výskytov) Naposledy prihlásený: 15:00:32

hOn Authentication Error 1 200 -

lacko-hub avatar Jul 09 '24 13:07 lacko-hub

I have some error since 1st of July. I've reset password, uninstall and install again integration. Still pyhon.exceptions.HonAuthenticationError: Can't login.

On mobile app works fine.

dszymczuk avatar Jul 09 '24 16:07 dszymczuk

Could it be that freshly changed passwords are not synced and might need some time? In my case it startet working when I ignored it for like 24h... ;) I guess the login flow that was reverse engineered in the pyHOn library might not be always 100% identical to what happens in the app. At the end it is not an official integration. ;)

mschmiedel avatar Jul 09 '24 21:07 mschmiedel

I have the same problem. I changed the password and then I looged into https://account2.hon-smarthome.com/ as @daemon76 suggested. It didn't work.

Does somebody know how to solve it?

Thank you so much!

rpadafo avatar Jul 16 '24 18:07 rpadafo

Same login issue here. The only thing I did different I think is that I had first created my hon account with Google sign-in, but as I noticed I needed a password to login I've reset password. Still, can't login.

iancedev avatar Jul 17 '24 15:07 iancedev

It seems that the solution is here #230 @addshore has made a fork with corrections https://github.com/addshore/hon

(It doesn't work for me)

rpadafo avatar Jul 18 '24 06:07 rpadafo

It seems that the solution is here #230 @addshore has made a fork with corrections https://github.com/addshore/hon

(It doesn't work for me)

It doesn't work for me neither :/

Triskae avatar Jul 18 '24 15:07 Triskae

I have same issue is there any update for this. I tested every method.

goktugolmez avatar Aug 08 '24 16:08 goktugolmez

I encountered the same issue, any updates on this?

thunderbug1 avatar Apr 05 '25 10:04 thunderbug1