rospogrigio / daikin_residential

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

[Issue]: Unable to connect due to missing parameters #213

Open tetele opened 8 months ago

tetele commented 8 months ago

Upon setup i get this error

Logger: homeassistant.config_entries
Source: config_entries.py:551
First occurred: 8:55:23 PM (2 occurrences)
Last logged: 9:12:09 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: Missing required fields for registration: data.profile.communicationLanguage, data.profile.countryResidence

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: Missing required fields for registration: data.profile.communicationLanguage, data.profile.countryResidence'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, 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

Not sure if this is related to the recent API authentication changes.

I use HA 2024.4.0b0

jwillemsen commented 8 months ago

See #205

tetele commented 8 months ago

Thank you @jwillemsen! I've started using your integration