I hope someone can help me here, I’ve been trying it since hours to get it to work… My authorization fails when I click on the “Link Home Connect account” link in HA.
I’m getting this error message:
{
“error”: “unauthorized_client”,
“error_description”: “client or redirection URI not authorized”,
“state”: “M0mHJobp7FPs4Xv5vyoOwh0vnu5n0j”
}
the duckdns URL is working as I can access it over https://xxx.duckdns.org:8123 and it is showing up as secure. only when I access it local with https://hassio.local:8123 it is showing as non secure. Don’t know if this is normal…
Managed to get the connection to work now. But after reboot I get errors. And it is looking for Python3.7 which is not installed (running Docker on Synology).
Error during setup of component homeconnect
Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 156, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/homeconnect/init.py”, line 49, in setup
from homeconnect import HomeConnect
File “/usr/local/lib/python3.7/site-packages/homeconnect/init.py”, line 1, in
from .api import HomeConnect
File “/usr/local/lib/python3.7/site-packages/homeconnect/api.py”, line 1, in
from requests_oauthlib import OAuth2Session
File “/usr/local/lib/python3.7/site-packages/requests_oauthlib/init.py”, line 3, in
from .oauth1_auth import OAuth1
File “/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth1_auth.py”, line 10, in
from requests.utils import to_native_string
File “/usr/local/lib/python3.7/site-packages/requests/utils.py”, line 24, in
from . import certs
File “/usr/local/lib/python3.7/site-packages/requests/init.py”, line 114, in
from .models import Request, Response, PreparedRequest
File “/usr/local/lib/python3.7/site-packages/requests/models.py”, line 28, in
from .auth import HTTPBasicAuth
File “/usr/local/lib/python3.7/site-packages/requests/auth.py”, line 22, in
from .utils import parse_dict_header
ImportError: cannot import name ‘parse_dict_header’ from ‘requests.utils’ (/usr/local/lib/python3.7/site-packages/requests/utils.py)
It is working now for me and I don’t even know the reason, because I haven’t changed anything. I think there was just an issue with the authorization server there…
Great component! However, my connection to the backend seems to be lost silently after about a day. If I restart Home Assistant, everything is fine again. For about a day.
What can I do?
There is nothing in the home assistant log about this, apart from Unexpected value for HomeConnect door state: {} which I get at startup, and I guess is unrelated since it works for a while.
Interesting, this probably means that the token refresh fails since tokens have a lifetime of 24h. This is supposed to be taken care of automatically by the requests_oauthlib library and in my case works. Does anybody else have this problem? Can you check if the homeconnect-token-cache file appears in your HA config dir when you log in?
The expires_at is already passed by more than a day now. It reads 2019-07-22 20:14 UTC, and right now we have 2019-07-23 21:39 UTC. The fil was last touched at 2019-07-21 20:14 UTC. HA was restarted about 2019-07-21 11:31 UTC.
I run the latest and greatest HA in a Docker.
I thought I was coming back here to tell you that lack of time, pour knowledge of OAuth and Python made me not be able to debug this much further. But, it seems to work now! I don’t know if it is related to me updating Home Assistant to 0.96.5 or fiddling with Home Connect, but it seems to be working now for at least four days without restarting HA…
I had the problem for many months and tried tweaking both Home Connect and Home Assistant before without success.
Just added the component … if you run into problems with unauthorized_client errors, check the URL you were meant to click on. If it has %3A443 (or likewise %3A8123) in there, update the redirect_url at the developers site accordingly to state https://hass.example.org:443/api/homeconnect.
@DavidMStraub nice work, seems to give a lot of entities to look at tomorrow.
@DavidMStraub This component worked fine for a while and all of a sudden it would not start anymore. I deleted the token cache file and re-ran the authorisation. Now i get this error, only get it to work again if i make a new application in the DEV website of homeconnect. But after one reboot that also gives this error.
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/homeconnect/__init__.py", line 72, in setup
hass.data[DOMAIN]['devices'] = get_devices(hc)
File "/config/custom_components/homeconnect/__init__.py", line 129, in get_devices
appl = retry(hc.get_appliances, times=20, sleep=0.1)
File "/config/custom_components/homeconnect/__init__.py", line 120, in retry
return f()
File "/usr/local/lib/python3.7/site-packages/homeconnect/api.py", line 146, in get_appliances
data = self.get(ENDPOINT_APPLIANCES)
File "/usr/local/lib/python3.7/site-packages/homeconnect/api.py", line 109, in get
raise HomeConnectError(res['error'])
homeconnect.api.HomeConnectError: {'key': 'invalid_token', 'description': 'The access token is malformed'} ```
I was just looking to set this up and then noticed that their App is also spitting out all sorts of errors - can you use the App itself?
I cannot login to their app, shows a ‘no connection to the server’ error, ‘the backend server is currently not available’ or it spits out a general 503 application error. Even the password reset link was not working earlier this morning, but seems to be now… but unable to login after resetting the password.
I think Bosch/Home Connect might be having some general problems.
I have a dishwasher from Bosh (SBV88TX36E/38) and must say that your plugin was very easy to install and runs without any problems. Thanks very much for your good work.
A small bug (i think it is a bug?) I have found:
Sometimes (i think after a restart of Hass.io the sensors are all not available. Then when I restart one or two times everything is back). I also think there is nothing really much in the error log. If I have more info, I let you know.