Home Connect integration fails with "error" (and nothing more!)

I’m trying to get Home Connect working to connect a new dishwasher. I have started the integration installation, worked my way through the prompts (included avoiding the authorisation error that all posts online seem to refer to), clicked the box to agree to HA accessing my Home Connect details, then I click the “Link Account” button which is a local HA URL. At that point I am redirected back to the “Integrations” page of my HA instance but greeted with a box which simply says ‘Error’. There are no other details.

The Home Connect credentials are visible in the “Application Credentials” screen of HA, so there’s definitely something happening. The HA Core log contains the following, which I guess suggests something is wrong with the contents of an oauth call somewhere, but I neither understand nor can fix it. My Home Connect username (and my developer username) don’t contain any uppercase characters (as noted in the documentation). Any suggestions gratefully received! I don’t need my dishwasher connected to HA, but it’s bugging me that it doesn’t work. :grinning:

Logger: aiohttp.server
Source: helpers/config_entry_oauth2_flow.py:209 
First occurred: 8 March 2023 at 21:39:11 (4 occurrences) 
Last logged: 07:24:11

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 171, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 96, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 315, in async_step_creation
    token = await self.flow_impl.async_resolve_external_data(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 172, in async_resolve_external_data
    return await self._token_request(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 209, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://api.home-connect.com/security/oauth/token')

Hello,

i have the same issue.

Logger: aiohttp.server
Source: helpers/config_entry_oauth2_flow.py:209
First occurred: 10:53:38 (1 occurrences)
Last logged: 10:53:38

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 171, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 96, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 315, in async_step_creation
    token = await self.flow_impl.async_resolve_external_data(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 172, in async_resolve_external_data
    return await self._token_request(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 209, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://api.home-connect.com/security/oauth/token')

in both cases, it seems to be an issue with the OAuth token:

aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://api.home-connect.com/security/oauth/token')

Are you using the core HomeConnect integration, or the “HomeConnect Alt” from HACS?

I am using the the Home Connect Integration.

ok. I don’t know if this integration is still “up to date” … I am using the homeconnect alternative from hacs without issues… but I will try to setup the core integration in another test instance to see, if this is working or throwing similar issues…

give me some minutes :slight_smile:

UPDATE:
Adding my coffeemaker just worked without any issue…
I would consider to re-install the integration…

Also, check if you have the application credentials stored in the Devices&Services

1 Like

Thanks, I wasn’t aware of Home Connect Alt. I had considered removing the original integration and re-installing, but it’s impossible to remove it because it doesn’t show up in the list. When you try to add it again it doesn’t take you to the ‘install’ screen, it just immediately redirects you to the oauth screen. Is there a way to manually delete integrations?

In more positive news, I deleted my Home Connect and HC Developer accounts, created entirely new ones, and installed Home Connect Alt. All seems to be working nicely. :smiley:

tbh - home connect alt is also a much more powerfull integration :slight_smile:
Don’t know the details for the dishwasher, but for my coffee maker, it does provide much more options compared to the core integration :wink:

I changed my email address and now it works.

Nevermind, it was indeed the e-mailadres with 1 letter in caps. Changed it, it’s working now!

Email got me too.

same problem with caps in email-address. took me 2 days :roll_eyes: