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

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

Open
hryhorash opened this issue Mar 18, 2024 · 60 comments
Assignees
Labels
bug Something isn't working

Comments

@hryhorash
Copy link

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

  • 1 zone
  • supports cooling
  • supports DHW

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

@hryhorash hryhorash added the bug Something isn't working label Mar 18, 2024
@flix4f
Copy link

flix4f commented Mar 18, 2024

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
Copy link

mr0711 commented Mar 18, 2024

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
Copy link

The same for me

@sprzednowek
Copy link

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
Copy link

exactly the same problem :(

@denisbobovnik
Copy link

denisbobovnik commented Mar 18, 2024

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
Copy link

same problem here

@xriser
Copy link

xriser commented Mar 18, 2024

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
Copy link

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
Copy link

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
Copy link

tson0n0 commented Mar 18, 2024

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

@xriser
Copy link

xriser commented Mar 18, 2024

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
Copy link

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
Copy link

vukisz commented Mar 18, 2024

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
Copy link

snaow commented Mar 18, 2024

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
Copy link

man010 commented Mar 18, 2024

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
Copy link

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
Copy link
Owner

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.

@cjaliaga cjaliaga changed the title [Bug]: Auth [Bug]: Panasonic changed their login system - Integration cannot log in into Aquarea Smart Cloud Mar 18, 2024
@cjaliaga cjaliaga self-assigned this Mar 18, 2024
@cjaliaga cjaliaga pinned this issue Mar 18, 2024
@xriser
Copy link

xriser commented Mar 18, 2024

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
Copy link

os11k commented Mar 18, 2024

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
Copy link

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
Copy link

Same same :-(

@xriser
Copy link

xriser commented Mar 18, 2024

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
Copy link

os11k commented Mar 18, 2024

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Owner

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
Copy link

aLAN-LDZ commented Mar 25, 2024

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
Copy link
Owner

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

@aLAN-LDZ
Copy link

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

You are the best! :)

@cjaliaga
Copy link
Owner

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
Copy link

tkamj commented Mar 30, 2024

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
Copy link

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

@figaro-smartotum
Copy link

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
Copy link

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

@aLAN-LDZ
Copy link

aLAN-LDZ commented Mar 30, 2024

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
Copy link

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
Copy link

Working like a charm here. Good job! Epic.

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

@os11k
Copy link

os11k commented Mar 30, 2024

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
Copy link

Maison-GIDON commented Mar 30, 2024

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
Copy link

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
Copy link

lmahave commented Mar 30, 2024

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.

@robbo1001
Copy link

Working brilliantly here. A big thanks for all the hard work!

@stephanlarsson
Copy link

Great job! Thank you so much for the fix!!!! ❤️

@man010
Copy link

man010 commented Mar 30, 2024

Thanks so much Carlos for your efforts to have this integration working again. I confirm it seems to be working flawlessly since this morning. Great job !👏

@cjaliaga
Copy link
Owner

Hi,

We've found an issue when the token expires and its refresh process that lets the integration in a state where is not able to retrieve the data until it's reloaded. You'll find the entities as "unavailable". This would probably happen once every 24H, correlating with token expiration. I'll try to release a hotfix at the earliest, for the time being please reload the integration.

Thanks!

@rcarvajales
Copy link

rcarvajales commented Apr 1, 2024

Hi,
Thanks for the fix, the login itself now works for me! however, I can no longer see the climate entity, only the water heater and the exterior temperature. But I lost the hability of changing climate parameters, am I the only one?

@rcarvajales
Copy link

Hi, Thanks for the fix, the login itself now works for me! however, I can no longer see the climate entity, only the water heater and the exterior temperature. But I lost the hability of changing climate parameters, am I the only one?

Ok, in case someone find the same issue, please double check your HA Core version is 2024.02 or latest as stated in the Readme.md.
My climate entity is working again.
Thanks a lot!

@cjaliaga
Copy link
Owner

cjaliaga commented Apr 1, 2024

I just released https://github.com/cjaliaga/home-assistant-aquarea/releases/tag/v0.7.1 that should fix the refresh issue (entities unavailable after 24H). Please let me now if you find any issue.

@os11k @denisbobovnik this version hopefully should also mitigate the issue that you folks are having.

@arnolds77
Copy link

Thank you cjaliaga. Great job!!!

@denisbobovnik
Copy link

that fixed it for me yes!! does anyone know how can i get the full spectre from -5 to 5 settings of my heat pump to homekit? it only shows from 0 to 5.

@rivojo
Copy link

rivojo commented Apr 5, 2024

Let's show our support for the Carlos!
Every contribution helps keep his great work going.
https://buymeacoffee.com/cjaliaga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests