cjaliaga / home-assistant-aquarea

Home Assistant integration for Panasonic Aquarea devices connected to Aquarea Smart Cloud
MIT License
76 stars 13 forks source link

[Bug]: Panasonic changed their login system - Integration cannot log in into Aquarea Smart Cloud #105

Open hryhorash opened 6 months ago

hryhorash commented 6 months ago

The problem

Connection to the cloud stopped working. When i disabled the integration and tried to login via the panasonic website, I encountered the 2fa process, that was not there before. Probably it is the cause of the problem, but I could not find the option to disable 2fa in the panasonic account.

Then, I tried to reconnect my panasonic account from scratch, and it did not work. P.S. I also received a verification code from panasonic via sms

What version of Home Assistant Core are you running?

core-2024.3.0

What type of installation are you running?

Home Assistant OS

What version of the integration are you running?

v0.6.3

Device description

Is the integration loading?

Yes

Is the adapter able to connect to the Aquarea Smart Cloud with a stable internet connection?

Yes

Are you able to perform the action you're trying to with the Aquarea Smart Cloud Site/App?

Yes

Area of the issue

No response

Anything in the logs?

Logger: custom_components.aquarea.config_flow
Source: custom_components/aquarea/config_flow.py:144
integration: Aquarea Smart Cloud ([documentation](https://github.com/cjaliaga/home-assistant-aquarea), [issues](https://github.com/cjaliaga/home-assistant-aquarea/issues))
First occurred: 08:19:16 (2 occurrences)
Last logged: 08:20:16

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/aquarea/config_flow.py", line 144, in _validate_input
    await self._api.login()
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 246, in login
    await self._login_production()
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 266, in _login_production
    response: aiohttp.ClientResponse = await self.request(
                                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 214, in request
    raise ApiError(error.error_code, error.error_message)
aioaquarea.errors.ApiError: API error: 1000-0999 - Logged out due to system error. Please login again after a while.

Additional information

No response

flix4f commented 6 months ago

Same behavior here. Login via browser on the Aquarea does succeed. Albeit with a new comment on the bottom of the page referring to an’update’ IMG_2825

Logger: homeassistant.config_entries Source: config_entries.py:504 First occurred: 7:43:41 AM (1 occurrences) Last logged: 7:43:41 AM

Error setting up entry f….n@….com for aquarea Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/init.py", line 47, in async_setup_entry await client.login() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 246, in login await self._login_production() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 266, in _login_production response: aiohttp.ClientResponse = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 214, in request raise ApiError(error.error_code, error.error_message) aioaquarea.errors.ApiError: API error: 1000-0999 - Logged out due to system error. Please login again after a while.

mr0711 commented 6 months ago

Same problem here. Login at website still works with 2fa but nothing is working in HA.

2024-03-18 06:01:30.610 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry xx.xxx@mail.com for aquarea
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aquarea/__init__.py", line 47, in async_setup_entry
    await client.login()
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 246, in login
    await self._login_production()
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 266, in _login_production
    response: aiohttp.ClientResponse = await self.request(
                                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 214, in request
    raise ApiError(error.error_code, error.error_message)
aioaquarea.errors.ApiError: API error: 1000-0999 - Logged out due to system error. Please login again after a while.

image

OUEST-DIGIT commented 6 months ago

The same for me

sprzednowek commented 6 months ago

same here

`Logger: homeassistant.config_entries Source: config_entries.py:504 First occurred: 8:11:53 AM (4 occurrences) Last logged: 8:16:47 AM

Error setting up entry [my email address] for aquarea Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/init.py", line 47, in async_setup_entry await client.login() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 214, in login response: aiohttp.ClientResponse = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 179, in request raise ApiError(error.error_code, error.error_message) aioaquarea.errors.ApiError: API error: 1000-0999 - Logged out due to system error. Please login again after a while.`

sokrates209 commented 6 months ago

exactly the same problem :(

denisbobovnik commented 6 months ago

same problem here. at first i thought i broke something since i was tinkering with the integration and its automations, but i know it all worked before i went to sleep at 1am, now its 9am everything broken.

Borova357 commented 6 months ago

same problem here

xriser commented 6 months ago

There is a new option in the menu "account management" Here I found "reset mfa", but it doesn't work

Screenshot 2024-03-18 at 10 02 33

UPD: It seems reset doesn't mean remove. I managed to reset mfa, but when I try to login again, it just reask country and phone number. It seems there is a high chance that the integration will no longer work :(

sokrates209 commented 6 months ago

There is a new option in the menu "account management" Here I found "reset mfa", but it doesn't work Screenshot 2024-03-18 at 10 02 33

UPD: It seems reset doesn't mean remove. I managed to reset mfa, but when I try to login again, it just reask country and phone number. It seems there is a high chance that the integration will no longer work :(

I've use that, but it doesn't disable 2fa, You just have a choice of type of 2fa, ex You can use Your google auth app to do that or email with code, etc

FoxMike1 commented 6 months ago

Same problem since 9 hours now. After using 2fa on PC with Google Autehnticator I could use the Aquarea app on my Android Pixel without 2fa from the same IP, very strange. But HA from the same IP no connection to Aquarea.

tson0n0 commented 6 months ago

Same here, they change the authentification method. Good luck for the dev.

xriser commented 6 months ago

Same problem since 9 hours now. After using 2fa on PC with Google Autehnticator I could use the Aquarea app on my Android Pixel without 2fa from the same IP, very strange. But HA from the same IP no connection to Aquarea.

I can guess they have changed the auth domain I don't remember there being https://authglb.digital.panasonic.com/login before

viliusdidit commented 6 months ago

opened a tkt in aioaquarea project.

web login process to https://authglb.digital.panasonic.com/usernamepassword/login looks like this, don't have a setup for sniff the mobile app atm; Mobile app v1.20.0 (dev 14,2023) seems to be opening pic-in-pic chrome window to call authglb:

<client_id>vf2i6hW5hA2BB2BQGfTHXM4YFyW4I06K</client_id>
<redirect_uri>https://aquarea-smart.panasonic.com/authorizationCallback?lang=en</redirect_uri>
<tenant>pdpauthglb-a1</tenant>
<response_type>code</response_type>
<scope>openid offline_access</scope>
<audience>https://digital.panasonic.com/vf2i6hW5hA2BB2BQGfTHXM4YFyW4I06K/api/v1/</audience>
<_csrf>9OCkcl4F-fgQCE4wTTDWTMQnIHnO-Ek1wBlk</_csrf>
<state>hKFo2SAweUM4X0tybnhUNmZtSUZVdTlfTFVkdjQwZ0Z4TWJHeKFupWxvZ2luo3RpZNkgOG9rMzZOVkNjemJkRlN2a0J1YkN3OHdyczZ3S2RJTmOjY2lk2SB2ZjJpNmhXNWhBMkJCMkJRR2ZUSFhNNFlGeVc0STA2Sxx</state>
<_intstate>deprecated</_intstate>
<username>Panasonic@xxx</username>
<password>xxxx</password>
<lang>en</lang>
<connection>PanasonicID-Authentication</connection>
vukisz commented 6 months ago

Yes same as for everyone. I have two panasonic accounts. One main and another dedicated to HA. Main one does not require to setup up 2 factor authentication when logging in into Panasonic cloud. But it also does not work with Panasonic Comfort Cloud - HomeAssistant Component

Also I noticed this warning on login page: We kindly ask you to ensure that you SIGN IN WITH YOUR CURRENT PANASONIC ID FIRST after the update. My first login was probably from secondary HA account.

snaow commented 6 months ago

Same here!

Since this belong to aioaquarea library, I am following as well @viliusdidit ticket:

I hope that @cjaliaga can help us :P

PS: This is the reason I really need to flash my CZ-TAW and make this not cloud/panasonic dependant xD

man010 commented 6 months ago

Hello same issue here, I passed under review everything, it looks like an authentication issue, while I manage to authenticate to smart cloud with this account.

RedwoodNL commented 6 months ago

Panasonic is rendering the use for multiple accounts useless. Comfort Cloud for aircon's was done earlier this year, expecting this is the Smart Cloud update. From now on just one account for multiple devices. Hopefully this makes things easier for the future. Roll-out started about 12 hours ago.

cjaliaga commented 6 months ago

Hi everyone,

Thanks a lot for reporting the issue. The main investigation will happen on the issue that @viliusdidit created on the aioaquarea repo:

Unfortunately I need to set expectations here: A change like this is not simple, hopefully the new login system will allow us to do things in a better way, but it might also happen that we don't manage to get the integration working again in some time. We'll highly appreciate all your patience and any support that you can provide trying to reverse engineering the new process.

I'll update the README.

xriser commented 6 months ago

PS: This is the reason I really need to flash my CZ-TAW and make this not cloud/panasonic dependant xD

Please share any decent projects with the reflashing module.

PS. sorry for the offtopic.

os11k commented 6 months ago

I bit the bullet and ordered a Modbus adapter for my Panasonic just now. I mostly use this integration for power consumption monitoring. For my heat pump control, I was using my own small PHP script, but I'm fed up with fixing it every time Panasonic makes changes.

RedwoodNL commented 6 months ago

I bit the bullet and ordered a Modbus adapter for my Panasonic just now. I mostly use this integration for power consumption monitoring. For my heat pump control, I was using my own small PHP script, but I'm fed up with fixing it every time Panasonic makes changes.

Hopefully this was the last time 😂

Laksepote commented 6 months ago

Same same :-(

xriser commented 6 months ago

I bit the bullet and ordered a Modbus adapter for my Panasonic just now. I mostly use this integration for power consumption monitoring. For my heat pump control, I was using my own small PHP script, but I'm fed up with fixing it every time Panasonic makes changes.

I've searched over the internet and ordered HeishaMon communication PCB It is fully local and can work in parallel with CZ-TAW.

os11k commented 6 months ago

HeishaMon communication PCB It is fully local and can work in parallel

That is an interesting device, but I think to work in parallel, you need an additional board. I personally prefer Modbus because I have experience working with it on my ventilation system. But that price is a steal!

Laksepote commented 6 months ago

I have ordered the HeishaMon as well. It seems, you can't control your heatpump from both mqtt and CZ-TAW, but with the optional print, you can monitor from the HeishaMon while controlling from the CZ-TAW. I dont have the optional print though, and I plan to replace the CZ-Taw. Maybe ill sell it on Ebay for twice the amount of the HeishaMon :-D

RedwoodNL commented 6 months ago

On the K, L and upcoming M series you can connect north the Heishamon and TAW. There is also a goheishamon custom firmware for the TAW, not sure what it does. For the H and J you need the extra nsp print, which is quite expensive.

but can you actually control now with the heishamon? It’s still only monitoring right?

Laksepote commented 6 months ago

It seems so: https://www.tindie.com/products/thehognl/heishamon-communication-pcb/

lmahave commented 5 months ago

I have sent this to Panasonic. I used the Caliaga integration in Home Assistant to be able to manage my aquarium from there. It has stopped working, because they have decided to change the login api, without notice. It seems that they try to avoid those sessions, to force us to handle their application. Your application still works, but it has nothing to do with the possibilities that homeassistant provides. Can they even predict what time to start, depending on the solar time, the expected temperature or sunshine, the solar production of the panels, the needs for presence at home...? No, of course they can't. It seems to me an outrage unworthy of a supposedly great brand. It has happened with some other "big" brand and the response from the hoemassistant community made them change. Let them know that we will start an information campaign about their actions, so that anyone who intends to properly manage their home automation does not buy Panasonic. It's degrading. They cannot ignore a community in this way and I am sure they will pay dearly in the long or medium term. I hope they rectify in time. Greetings

cedcabgit commented 5 months ago

Let’s start the buzzz IMG_9355

lmahave commented 5 months ago

Muchas gracias. Molto gracie.

Luis Carlos Mahave Riaño

El jue, 21 mar 2024 a las 19:08, cedcabgit @.***>) escribió:

Let’s start the buzzz IMG_9355.jpeg (view on web) https://github.com/cjaliaga/home-assistant-aquarea/assets/157713095/88482b52-997a-47d8-94e5-7cd0f71cdd2c

— Reply to this email directly, view it on GitHub https://github.com/cjaliaga/home-assistant-aquarea/issues/105#issuecomment-2013202518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFCF3DN4PVAVGHGB33BRRLYZMOZTAVCNFSM6AAAAABE27CZYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJTGIYDENJRHA . You are receiving this because you commented.Message ID: @.***>

MarkMikkelsen83 commented 5 months ago

Follow!!!

bimusiek commented 5 months ago

Hey guys, please check my implementation under https://github.com/Hernas/homebridge-panasonic-heat-pump/commit/dd04fc2b7a207a2648d7ad94bb8eb19052d21bf2 It implements new Auth0 login for Panasonic Cloud

RedwoodNL commented 5 months ago

Hey guys, please check my implementation under Hernas/homebridge-panasonic-heat-pump@dd04fc2 It implements new Auth0 login for Panasonic Cloud

so wait... you've fixed it?

cedcabgit commented 5 months ago

Hey guys, please check my implementation under Hernas/homebridge-panasonic-heat-pump@dd04fc2 It implements new Auth0 login for Panasonic Cloud

so wait... you've fixed it?

I Think there’s everything in that code to fix our integration but we have to identify what we have to reuse and at what place in @cjaliaga code to make it work again.

cjaliaga commented 5 months ago

Hey guys, please check my implementation under Hernas/homebridge-panasonic-heat-pump@dd04fc2 It implements new Auth0 login for Panasonic Cloud

so wait... you've fixed it?

I Think there’s everything in that code to fix our integration but we have to identify what we have to reuse and at what place in @cjaliaga code to make it work again.

The amazing @bimusiek changes are for his Typescript implemention. I'll apply the same logic to our aioaquarea library (in python) later today and let's see if we can get the integration back working.

aLAN-LDZ commented 5 months ago

Hey guys, please check my implementation under Hernas/homebridge-panasonic-heat-pump@dd04fc2 It implements new Auth0 login for Panasonic Cloud

so wait... you've fixed it?

I Think there’s everything in that code to fix our integration but we have to identify what we have to reuse and at what place in @cjaliaga code to make it work again.

The amazing @bimusiek changes are for his Typescript implemention. I'll apply the same logic to our aioaquarea library (in python) later today and let's see if we can get the integration back working.

Hello, do we know yet whether integration can be repaired? I don't know whether to switch to a local one <3 Can i help somehow?

cjaliaga commented 5 months ago

@aLAN-LDZ hopefully it'll be repaired. I hope to publish an update soon :)

aLAN-LDZ commented 5 months ago

@aLAN-LDZ hopefully it'll be repaired. I hope to publish an update soon :)

You are the best! :)

cjaliaga commented 5 months ago

Great news, thanks to the amazing @bimusiek implementation, I have a working version of the aioaquarea library. There has been some modifications to the library due to the auth breaking changes and I'm sure we will have some unexpected behaviors and edge cases. Plus some required refactor and extra logging that I'm sure will need to be added.

In order to unblock everyone I'm releasing a new version of the integration using the revamped login method but be aware that we're not bug free as we're missing some testing. Please report everything that you find!!

tkamj commented 5 months ago

Hi. Just updated and everything is back to normal from my perspective after just few minutes of using. Thanks for all your work! I’ll report in case of any issues.

cedcabgit commented 5 months ago

Thanks a lot! Everything back to normal after upgrade. You’re the best @cjaliaga

figaro-smartotum commented 5 months ago

Currently working for me! Absolutely GREAT, your work is priceless.

For other users: you should first configure the phone number using the standard Panasonic login. After doing this, the integration will start to properly work again, without any kind of modification on HA side.

Boooomerang commented 5 months ago

It’s working here! Awesome! Will send some free beer your way!

aLAN-LDZ commented 5 months ago

Currently working for me! Absolutely GREAT, your work is priceless.

For other users: you should first configure the phone number using the standard Panasonic login. After doing this, the integration will start to properly work again, without any kind of modification on HA side.

exactly, it didn't work for me without this step

I haven't noticed any problems at the moment. Thanks you are great!

denisbobovnik commented 5 months ago

i got it working for a split second, showing all the data, then became unavailable, and this was in the logs

This error originated from a custom integration.

Logger: custom_components.aquarea.coordinator Source: helpers/update_coordinator.py:313 Integration: Aquarea Smart Cloud (documentation, issues) First occurred: 11:01:54 AM (10 occurrences) Last logged: 11:03:24 AM

Unexpected error fetching aquarea-testableminds@gmail.com-B344347134 data: 'token' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/coordinator.py", line 67, in _async_update_data await self.device.refresh_data() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 921, in refresh_data self._status = await self._client.get_device_status(self._info.long_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 70, in _wrap response = await fn(client, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 481, in get_device_status response = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 223, in request self._access_token = data["accessToken"]["token"]


KeyError: 'token'
RedwoodNL commented 5 months ago

Working like a charm here. Good job! Epic.

add a (https://www.buymeacoffee.com/) link! You deserve it.

os11k commented 5 months ago

i got it working for a split second, showing all the data, then became unavailable, and this was in the logs

This error originated from a custom integration.

Logger: custom_components.aquarea.coordinator Source: helpers/update_coordinator.py:313 Integration: Aquarea Smart Cloud (documentation, issues) First occurred: 11:01:54 AM (10 occurrences) Last logged: 11:03:24 AM

Unexpected error fetching aquarea-testableminds@gmail.com-B344347134 data: 'token' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/coordinator.py", line 67, in _async_update_data await self.device.refresh_data() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 921, in refresh_data self._status = await self._client.get_device_status(self._info.long_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 70, in _wrap response = await fn(client, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 481, in get_device_status response = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 223, in request self._access_token = data["accessToken"]["token"] ~~~~~~~^^^^^^^^^ KeyError: 'token'

I'm getting same error. I did try meanwhile Comfort cloud app, maybe after you try Comfort cloud app integration stops to work? Because I was surprised that Comfort cloud was not logging me out with working home assistant integration. Before 18th march it was constantly logging me out in comfort cloud app.

Maison-GIDON commented 5 months ago

Great news, thanks to the amazing @bimusiek implementation, I have a working version of the aioaquarea library. There has been some modifications to the library due to the auth breaking changes and I'm sure we will have some unexpected behaviors and edge cases. Plus some required refactor and extra logging that I'm sure will need to be added.

In order to unblock everyone I'm releasing a new version of the integration using the revamped login method but be aware that we're not bug free as we're missing some testing. Please report everything that you find!!

you are the best @cjaliaga !!!! thank you very much <3

denisbobovnik commented 5 months ago

integration

No, mine isn't logging out too. But i have separate account for HA integrstion shared by my main account which i also use to login to panasonic cloud

lmahave commented 5 months ago

It works well. I had to delete the added user and add it again, the way Carlos says in the documentation. What's more, I have not used another email; just an alias. v.g.: main user: juanayuso@gmail.com; alias: juan.ayuso@gmail.com. Thank you very much, Carlos.