home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.61k stars 30.77k forks source link

Home Connect integration failed to add: error while obtaining access token #114092

Closed Rediwed closed 7 months ago

Rediwed commented 7 months ago

The problem

When adding the Home Connect integration to Home Assistant, the final authorisation step errors out with the message: Error while obtaining access token.

All other steps (adding application in Home Connect Developer account) were completed successfully.

I have tried setting up this account both with and without my Nabu Casa external address. Https is also enabled for me server on the external address. My HA is also enabled, though I tried both redirecting back directly from the Developer app as well as through my home assistant.

What version of Home Assistant Core has the issue?

Core-2024.3.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

home_connect

Link to integration documentation on our website

https://www.home-assistant.io/integrations/home_connect

Diagnostics information

N/a since the integration can’t be added

Example YAML snippet

N/a since the integration can’t be added.

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @davidmstraub, mind taking a look at this issue as it has been labeled with an integration (home_connect) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `home_connect` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign home_connect` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


home_connect documentation home_connect source (message by IssueLinks)

kwitt21 commented 7 months ago

I also tried it just now and with the first attempt I got the same error "Fehler beim Abrufen des Zugriffstokens." as @Rediwed

The problem was, I used the wrong OAuth-Client-Secret. Go to https://developer.home-connect.com/applications/ click on details of your registered Home Assistant Application and there you have OAuth-Client-ID and OAuth-Client-Secret. With these credentials it worked for me.

Rediwed commented 7 months ago

Thanks! This solved it for me. I guess there was an error in copying/pasting. I didn't know before these application credentials could be adjusted from the overflow menu in the top-right corner in the integrations page.

Also, had other issues for another hour, but disabling default_config as well as removing a trailing '/' from the callback URI in the Home Connect Developer portal solved it for me.

TheIronRock95 commented 7 months ago

I'm experiencing the same issue at the moment. I've followed the documentation as instructed, but I'm still receiving an 'error while obtaining access token'.

I've copied the Client ID and Client Secret from my application detailed page on https://developer.home-connect.com/applications/.

But still receiving:

image
Rediwed commented 7 months ago

Did you try to remove the credentials and add them again? Not sure what happened with me but it was probably a copy&paste error from my side. Readding solved it for me. And don’t forget to log out of the developer portal or use a incognito tab.

TheIronRock95 commented 7 months ago

In solved the problem, had nothing to do with the home-connect appliance.. but with some Kubernetes DNS-settings.