Home Connect: alpha testers wanted

I’m able to see the login screen and adapt my settings.

Kudos David !!!

When I approve, then I get “404: Not found”

Jan

Do you recommenced specifying the port even if I use the https default port 443?

Thanks and regards

Jakob

I think in that case it shouldn’t matter…

Hi, everything is setup and I receive the following response:

https://domain.local:8123/api/homeconnect?code=thecode&state=thestate&grant_type=authorization_code .

However, the response is 500 Internal Server Error/Server got itself in trouble.

Any idea what it can be?
The domain is correct and the port also.

Thanks,

Marcel

tx for this great component
just installed it (passing a apache reverse proxy and a firewall with geoip blocking) and it seems to work for:
Siemens iQ700 Dishwasher 60 cm SN678X26TE

now i can lett alexa notify me when it is finished and send a mail to the kids to empty the dishwasher (and call me when not done :p)

Mario

Is it possible to use this with the Nabu Casa cloud access instead of DuckDNS?

1 Like

No, I haven’t looked into that at all.

If you were to have time, this would have been great.

Actually, I don’t really understand the point. Your HA instance does not have to be accessible from the outside to make this work.

1 Like

Now I’m confused, I though that the whole purpose of the duckDNS setup was making the HASSIO instance accessible from outside my own network…

To be clear: for the Home Connect integration to work, you do not need your Home Assistant (or Hass.io) to be accessible from the outside. The only thing you need is to have a base_url with https, since the Home Connect API requires that. But it can even be https://localhost/... if you use a self-signed certificate.

@DavidMStraub Thanks for your awesome custom component. Some of the features work like a charm.

When I turn on one of my devices and try to turn them off I get the following error:

{'key': 'BSH.Common.Error.WriteRequest.NotAvailableByList', 'code': 528, 'description': 'HomeAppliance reported an error'}
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/app/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/app/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/src/app/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/app/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  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/switch.py", line 89, in turn_on
    self.device.appliance.set_setting('BSH.Common.Setting.PowerState',  'BSH.Common.EnumType.PowerState.On')
  File "/usr/local/lib/python3.7/site-packages/homeconnect/api.py", line 265, in set_setting
    return self.put('/settings/{}'.format(settingkey), {'data': {'key': settingkey, 'value': value}})
  File "/usr/local/lib/python3.7/site-packages/homeconnect/api.py", line 218, in put
    return self.hc.put('{}/{}{}'.format(ENDPOINT_APPLIANCES, self.haId, endpoint), data)
  File "/usr/local/lib/python3.7/site-packages/homeconnect/api.py", line 131, in put
    raise HomeConnectError(res['error'])
homeconnect.api.HomeConnectError: {'key': 'BSH.Common.Error.WriteRequest.NotAvailableByList', 'code': 528, 'description': 'HomeAppliance reported an error'}

How to get rid of it? Its not possible to turn off the device once it was turned on.

Thank you

I’ve looked at other Home Automations with HomeConnect integration and they don’t need the base_url with SSL etc. All you need is the developer account. Maybe you can implement it as well so it is easier for users to use your integration without having to deal with the Redirect URI?

E.g. for ioBroker (similar to HA) with english instructions including the used code: https://github.com/dna909/ioBroker.homeconnect

Interesting. This uses the OAuth Device Flow that doesn’t need a redirect URI and indeed should be simpler. I am pretty sure they hadn’t implemented that when I originally implemented the component. So I should look into that. Thanks @enigma2k.

2 Likes

you’re welcome! Looking forward to your simplified integration. :slight_smile:

I think this might be an even easier implementation for the device “Homey” (which is also some kind of HA). This is done directly by the manufacturer Bosch-Siemens, so they might have some other tricks for the integration:

That sound great, I’d really like to try this plugin but I don’t want do go through the hassle of installing custom certificates.

Unfortunately, I didn’t find a Python library supporting the Device Flow, since it’s a very new OAuth feature. There is an issue on this in oauthlib. Until this is implemented, I’m afraid this cannot be used (I can’t write a client for this from scratch).

that’s a pity, there is no easier integration possible in HA :frowning:

Trying to get this to work but gett the following error while starting up HA:

‘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)’

I have registered and have edited configuration.yaml with Client_ID and Client_Secret

Running HA 0.95.4 on Docker

Any ideas

I sometimes get this error, too, and it doesn’t make any sense to me as the file in question does contain that name. I have no idea so far what is causing it. But usually when I restart HA the problem is gone. Sorry, not a very good solution…