Home Connect binding

@chill.kroete @kl8ter

Could you please remove/delete your binding and install the following jar manually:
https://jb-bucket-34324.s3.eu-central-1.amazonaws.com/test/org.openhab.binding.homeconnect-3.2.0-SNAPSHOT.jar

I’ve enabled oven control scope. Fingers crossed. If it works for you I will prepare a new commit to the official repository.

Thanks for testing it.

1 Like

Thanks for the fast reaction.
Re-authorizing the bridge now requests the oven permission (last row):

The items and rule I included in my post above now works and starts the oven with the desired settings.

Big thank you for implementing this so fast. I will do some more testing and let you know if there are any issues.

cc @kl8ter

Youre Welcome. It works very well! Great fast Job!

But it is not working to set “Fast Heat” and the “duration time” at the oven?

Create a pull request: [homeconnect] Add oven control by bruestel · Pull Request #11706 · openhab/openhab-addons · GitHub

Hi Jonas, I just installed the latest v3.2.x.SNAPSHOT on my system (in order to avoid the log4j risk), and now I am seeing the following errors. So I wonder if there is something currently in the snapshot builds which may be causing this?

2021-12-15 22:17:12.103 [ERROR] [oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://api.home-connect.com/security/oauth/token failed with error code invalid_scope, description given scope doesn't match requested scope
2021-12-15 22:18:59.308 [ERROR] [oauth2client.internal.OAuthConnector] - grant type authorization_code to URL https://api.home-connect.com/security/oauth/token failed with error code invalid_grant, description invalid authorization_code
2021-12-15 22:18:59.350 [ERROR] [.internal.servlet.HomeConnectServlet] - Could not fetch token!
org.openhab.core.auth.client.oauth2.OAuthResponseException: null
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
	at com.google.gson.internal.ConstructorConstructor$3.construct(ConstructorConstructor.java:110) ~[bundleFile:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:212) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:932) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:897) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:846) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:817) ~[bundleFile:?]
	at org.openhab.core.auth.oauth2client.internal.OAuthConnector.doRequest(OAuthConnector.java:319) ~[?:?]
	at org.openhab.core.auth.oauth2client.internal.OAuthConnector.grantTypeAuthorizationCode(OAuthConnector.java:223) ~[?:?]
	at org.openhab.core.auth.oauth2client.internal.OAuthClientServiceImpl.getAccessTokenResponseByAuthorizationCode(OAuthClientServiceImpl.java:211) ~[?:?]
	at org.openhab.binding.homeconnect.internal.servlet.HomeConnectServlet.getBridgeAuthenticationPage(HomeConnectServlet.java:495) ~[bundleFile:?]
	at org.openhab.binding.homeconnect.internal.servlet.HomeConnectServlet.doGet(HomeConnectServlet.java:169) ~[bundleFile:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[bundleFile:3.1.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[bundleFile:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:82) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.43.v20210629]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Please reauthenticate the binding in the UI. I’ve added a new oauth scope. I think this is causing it.

If it doesn’t help, I will investigate further.

Jonas, maybe you could adjust the title of this topic?

I have had this for a couple of days already. I confirm that re-athenticating does fix it, but it only lasts for 24 hours, and then the same error occurs again.

EDIT: to be precise, the error occurs 23 hours after re-authenticating.

Interesting, seems to be something wrong while refreshing the access token. The access token is usually valid for 24h. I’ll check.

Which OH version are you using?

Can you try the following steps:

  1. stop OH
  2. remove ./userdata/jsondb/StorageHandler.For.OAuthClientService.json
  3. start OH
  4. Re-authenticate

If that doesn’t work, send me the following file via private message ./userdata/jsondb/StorageHandler.For.OAuthClientService.json

Fingers crossed :smiley:

As I said before, I am on v3.2.x-SNAPSHOT from about 3 days ago (in order to overcome the log4j security breach)…

I think we just hit an example of the ‘demo effect’. I had this issue for about 3 days, whereby the hub Thing would go offline, and if I re-authenticated, it would come back online, and work for 23 hours, and then the problem would repeat etc. However yesterday and (so far) today, the Thing did not go offline (so you could say the problem is “solved”). I guess that there might have been some bad cached version of ./userdata/jsondb/StorageHandler.For.OAuthClientService.json which has finally been purged (or something like that)…

Hey, im currently using the official OH 3.2 version of this binding with an BOSCH Dishwasher very successfully.

When using the HomeConnect App i can see a feature called “Silence on Demand”.
Now i want to add this feature to an openhab Switch.

i tried sending:
{"data":"key":"Dishcare.Dishwasher.Option.SilenceOnDemand","value":true}}
to the Basic Action channel but nothing happens.

On the openhabip:8080/homeconnect/log/requests site i can see an error containing the body:

{
  "error": {
    "key": "SDK.Error.UnsupportedProgram",
    "description": "Unsupported operation: Dishcare.Dishwasher.Option.SilenceOnDemand"
  }
}

Using above command on “Send Raw Command” with the Path
/api/homeappliances/{ID}/programs/active/options/Dishcare.Dishwasher.Option.SilenceOnDemand
the option is successfully set.

How can i add this functinality to a switch?

Hi @TheOriginal92,

not sure if it possible at the moment. If you use the basic action channel you have to pass a program. I’ve checked the source code - the path is hard coded to /programs/active.

I think your only choice is to pass the program name with your silence option (see Home Connect - Bindings | openHAB).

Maybe I can extend the source code to allow the caller to pass the url path and the payload. I’ll put it on my list.

Hi,

Just purchased a Bosch washing machine with home connect so currently playing around with the API instead of actually, you know washing any clothes. Just wanted to say thanks for all of the hard work on this binding. I also have a query around the rinse hold option made in a previous comment.

The documentation suggests this has been implemented as a read only channel. Is their any option for this to be made writable? I noted BSC haven’t even documented this in the api so understand it is unsupported but just wanted to see how possible this would be.

I was hoping to be able to automate rinse hold as an option for when raining or no one is at home.

Any option to add this functionality?

Hi Stevs,

unfortunately, I don’t have a Home Connect-based washing machine (my old Siemens washing machine just doesn’t want to break. I would really like to buy a new one, as the old one is now almost 12 years old.).

Without a real washing machine, it is really difficult to add new functions to the binding.

@Lolodomo could you answer the question? You have already added a lot of useful things to the binding and you also have a washing machine that supports Home Connect.

Hey @jb4711,

thank you very much for your reply! I would really appreciate this modification as it would open up the binding to some more functionally.
Controlling dishwasher-options witch are available within the HomeConnect-App by openHAB may be interesting for some other users as well.

How can i help in developing this functionality?

Thank you and a happy new year!

Rinse hold feature is supported as read only because command is not yet supported by the API.

Thought that could be the case. Thanks for confirming. Let’s hope BSH take the brakes off and add some more options to the API soon. Again, thanks to all the contributions to this binding.

Hi @jb4711,

first of all, thank you for developing this add-on! It’s one of the most usful bindings in my openHAB installation :). I’m using it with three appliences (diswasher, washing machine and dryer).

Sadly, since many weeks I’m having the same issue @AndrewFG has or had. In my case a fresh login resolves the issue as well – but only for several hours.

Do you have an idea on how I could possibly fix this?

In my case, the problem has gone away. :slight_smile: