rospogrigio / daikin_residential

Cloud control of Daikin devices that are supported by Daikin Residential Controller app.
GNU General Public License v3.0
283 stars 37 forks source link

Daikin integration fail to refresh token due to 400 response #212

Open tyge68 opened 3 months ago

tyge68 commented 3 months ago

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 commented 3 months ago

`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 commented 3 months ago

`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 `

jwillemsen commented 3 months ago

See #205

samimasad commented 3 months ago

Same issue

xkill commented 3 months ago

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

tane64 commented 3 months ago

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

jwillemsen commented 3 months ago

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

sraka1 commented 2 months ago

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

jwillemsen commented 2 months ago

https://daikincloudsolutions.statuspage.io/

bartjanisse commented 2 months ago

It seems to be up and running again.

stefanrusie commented 4 weeks ago

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.

Schwebebahn commented 3 weeks ago

@stefanrusie THANKS! Now it is working again :)