daikin_residential icon indicating copy to clipboard operation
daikin_residential copied to clipboard

Daikin integration fail to refresh token due to 400 response

Open tyge68 opened this issue 11 months ago • 12 comments

Note I cannot find the device diagnostic from the mobile app, I will try later from desktop.Still it would be nice to know if other users have the same issue as it was working fine for months now. I started to happen recently (few hours actually).

I restarted multiple time HA, without success.

tyge68 avatar Mar 19 '24 20:03 tyge68

`This error originated from a custom integration.

Logger: custom_components.daikin_residential.daikin_api Source: custom_components/daikin_residential/daikin_api.py:171 integration: Daikin Residential Controller (documentation, issues) First occurred: 7:26:06 PM (4 occurrences) Last logged: 9:32:37 PM

CANNOT REFRESH TOKENSET (400): will login again and retrieve a new tokenSet.`

tyge68 avatar Mar 19 '24 20:03 tyge68

`Logger: homeassistant.config_entries Source: config_entries.py:504 First occurred: 7:26:07 PM (4 occurrences) Last logged: 9:32:38 PM

Error setting up entry Daikin for daikin_residential Traceback (most recent call last): File "/config/custom_components/daikin_residential/daikin_api.py", line 393, in retrieveAccessToken raise Exception("Unknown Login error: " + response["errorDetails"]) Exception: Unknown Login error: Login Failed Captcha Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/daikin_residential/daikin_api.py", line 177, in refreshAccessToken await self.retrieveAccessToken(data[CONF_EMAIL], data[CONF_PASSWORD]) File "/config/custom_components/daikin_residential/daikin_api.py", line 395, in retrieveAccessToken raise Exception("Login failed: %s", e) Exception: ('Login failed: %s', Exception('Unknown Login error: Login Failed Captcha Required'))

During handling of the above exception, another exception occurred:

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/daikin_residential/init.py", line 85, in async_setup_entry devices = await daikin_api.getCloudDevices() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikin_residential/daikin_api.py", line 488, in getCloudDevices self.json_data = await self.getCloudDeviceDetails() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikin_residential/daikin_api.py", line 484, in getCloudDeviceDetails return await self.doBearerRequest("/v1/gateway-devices") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikin_residential/daikin_api.py", line 116, in doBearerRequest await self.refreshAccessToken() File "/config/custom_components/daikin_residential/daikin_api.py", line 183, in refreshAccessToken raise Exception( Exception: Token refresh was not successful! Status: 400 `

tyge68 avatar Mar 19 '24 20:03 tyge68

See #205

jwillemsen avatar Mar 19 '24 20:03 jwillemsen

Same issue

samimasad avatar Mar 26 '24 18:03 samimasad

Same issue here. I had to login manually on the app and a cept the new terms and the problem was fixed.

xkill avatar Apr 01 '24 08:04 xkill

Same problem.
API error.

ONECTA Cloud API: Refresh tokens expire after approximately 12 hours Investigating Daikin is aware of reports regarding refresh token expiration after 12 hours, impacting 3rd party integrations. Some users may encounter a "400 Bad Request" response when refreshing their access token. We're actively investigating with our IT department for a solution.

We appreciate your patience as we work to ensure the ONECTA API meets user expectations. Thank you for your understanding. Posted 7 days ago. Mar 25, 2024 - 10:23 CET

tane64 avatar Apr 01 '24 09:04 tane64

See https://github.com/jwillemsen/daikin_onecta/issues/41 for the token renew issue

jwillemsen avatar Apr 04 '24 07:04 jwillemsen

@tane64 where did you get that status from? Does Daikin have an API status page? I wasn’t able to find it.

sraka1 avatar Apr 07 '24 03:04 sraka1

https://daikincloudsolutions.statuspage.io/

jwillemsen avatar Apr 07 '24 06:04 jwillemsen

It seems to be up and running again.

bartjanisse avatar Apr 13 '24 07:04 bartjanisse

Had the same issue twice in Home Assistant. When Daikin is making some fields mandatory to your account then the integration is not working anymore. For example, a few months ago, they made the field 'Language' mandatory and now I found I had to accept the new T&C, but for that I had to logout/login within Mobile app.

Hope this helps.

stefanrusie avatar Jun 05 '24 11:06 stefanrusie

@stefanrusie THANKS! Now it is working again :)

Schwebebahn avatar Jun 12 '24 20:06 Schwebebahn