Home Connect: alpha testers wanted

The cloud component uses ssl… So maybe there is a way? I don’t want to expose my hass outside the cloud cloud component…

1 Like

I’m using this component since last week with my Bosch WAWH2643NL washer. I was looking for a possibility to run some automations when the program has finished but there is no specific sensor for the state of the appliance.

There is a value available in the api response that reflects the stat of the machine. Is it possible to add that value to a sensor.

Here is a code snipped from the response;

Washer running:
'BSH.Common.Status.OperationState': {'timestamp': 1554962132, 'handling': 'none', 'uri': '/api/homeappliances/BOSCH-WAWH2643NL-68XXXXXXXXXX/status/BSH.Common.Status.OperationState', 'value': 'BSH.Common.EnumType.OperationState.Run', 'level': 'hint'}

Washer finished:
'BSH.Common.Status.OperationState': {'timestamp': 1554965982, 'handling': 'none', 'uri': '/api/homeappliances/BOSCH-WAWH2643NL-68XXXXXXXXXX/status/BSH.Common.Status.OperationState', 'value': 'BSH.Common.EnumType.OperationState.Finished', 'level': 'hint'}

Washer ready:
'BSH.Common.Status.OperationState': {'timestamp': 1554972231, 'handling': 'none', 'uri': '/api/homeappliances/BOSCH-WAWH2643NL-68XXXXXXXXXX/status/BSH.Common.Status.OperationState', 'value': 'BSH.Common.EnumType.OperationState.Ready', 'level': 'hint'}

Just wanted to chime and let you know that I got this working with our new Bosch dishwasher (SMV88TX36E). Super easy to set up and no problems! Thanks for your hard work.

Hi, follwed the great instructions. I’m using the simulate option because I do not have any device. After approval I receive the following error:

{“error”:“invalid_client”,“error_description”:“Invalid client: redirect_uri does not match client value”}

How can I fix it?

I’m using letsencrypt & duckdns in a docker container to access from outside of my network.

@sierraalpha83 did you set the base_url in your http config?

Hi, thanks for response.

Is the same as redirect_uri correct?

https://xxx.duckdns.org/ --> 500 internal server error
or
https://xxx.duckdns.org/api/homeconnect --> same response
?

If you set the base_url of the http component to https://xxx.duckdns.org (this is crucial, have you done it?), then your redirect URI is https://xxx.duckdns.org/api/homeconnect.

Hi,

yes I tried both and exact what you described in the reply. Maybe it’s an issue with the nginx reverse proxy?

This is what I get:

500 Internal Server Error

Server got itself in trouble

Please add the Port 443 to your base url and thx again.
Ngix uses this Port, HA normaly uses 8123.
Maybe this is the Solution

Hi, added 443 to the baseurl: https://xxx.duckdns.org:443 and received following response

{“error”:“invalid_client”,“error_description”:“Invalid client: redirect_uri does not match client value”}

You have to put https://xxx.duckdns.org:443/api/homeconnect as redirect URI in the Home Connect Developer Portal then as well.

Not working. Can I edit the
AUTH_CALLBACK_PATH = ‘/api/homeconnect’
to
AUTH_CALLBACK_PATH = ‘/’
in the init.py file?

edit:
it’s working. i don’t use the port in my base url and redirect uri. bad mistake from my side. i forgot the !secret keyword for the client_secret in my configuration.yaml file :frowning:

thanks for support

Yes! Thanks @DavidMStraub!

Got my Siemens EQ9 coffee maker up and running. Setup was pretty straight forward.
Things that I´ve experienced :

  • Do not use Safari browsers for Setup
  • Integration needs some time to “warm up” (few hours) as some permissions inside BSH backend seem to need provisioning
  • After the “Approve appliance to be use on home assistant” both, the provision and the home assistant popup window will remain blank. Just close them

Bad news. The component seems to loose connection to the BSH backend.
As i wrote, the initial connection was made successfully and my coffee brewers
sensors were enumerated perfectly fine.

When i try to integrate with the device, the component trows an error (pasted below).
Any ideas, what might be wrong? I´m running on current hass.io raspberry 3 image.

Thanks so much (also for the great work till now!)

Jakob

{'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance connection initialization failed'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1141, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1163, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/local/lib/python3.7/site-packages/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 "/config/deps/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 "/config/deps/lib/python3.7/site-packages/homeconnect/api.py", line 218, in put
    return self.hc.put('{}/{}{}'.format(ENDPOINT_APPLIANCES, self.haId, endpoint), data)
  File "/config/deps/lib/python3.7/site-packages/homeconnect/api.py", line 131, in put
    raise HomeConnectError(res['error'])
homeconnect.api.HomeConnectError: {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance connection initialization failed'}

Thanks for the great work!
Managed to connect succesfully aftera few tries.
The only trouble I am seeing is duplications of switches inmy states ui
I had to authorize several times may it be due to that?

update> restarting did the trick!
great!

I’m using nginx for the https part.
My home assistant runs on http

What should my redirect URI look like then ?

Tx for the support

Hi!

The redirect URI must be HTTPS. So in your case use the https URI, but it also needs to be the one set in the base_url attribute of the http component. Is that the case?

Note that your HA instance doesn’t necessarily have to be accessible from outside.

I do not have https enabled, no http setting in my configuration as the reverse proxy is my gateway to the outside
I can do portforwarding in my router though.
So…
Https://xxx:port ==> http://10.0.1.33:8123
Would this be ok?

Not sure I understand the problem. I can tell you how I configured it.

  • HA running locally without SSL on http://LOCAL_IP:8123
  • nginx reverse proxy accessible from the outside via https://MYNAME.duckdns.org:MY_PORT
  • in configuration.yaml:
http:
  base_url: 'https://MYNAME.duckdns.org:MY_PORT'
  • redirect URI: https://MYNAME.duckdns.org:MY_PORT/api/homeconnect