Home Connect binding

Nothing big, but multiple times a week i get this timeout error with stacktrace in the logfiles. Seen it a couple of times right after i turn the device on. Not sure if it is used by the binding or an unstable home connect API. Anyway, if it is just a timeout, a warning (without stacktrace) would be enough i think. And some retry mechanism would be nice that only logs an error if it ultimately fails.

2019-05-27 09:55:33.222 [ERROR] [dler.AbstractHomeConnectThingHandler] - API communication problem while trying to update BOSCH-WAYH2842NL-xxxxxxx!
org.openhab.binding.homeconnect.internal.client.exception.CommunicationException: Communication error! response code: 504, message: Gateway Time-out, body: {"error":{"key":"SDK.Error.504.GatewayTimeout","description":"Timeout on Home Connect subsystem. Please try it again."}}
 (Tried at Mon May 27 09:55:33 CEST 2019)
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient.checkResponseCode(HomeConnectApiClient.java:660) ~[?:?]
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient.getProgram(HomeConnectApiClient.java:534) ~[?:?]
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient.getActiveProgram(HomeConnectApiClient.java:334) ~[?:?]
	at org.openhab.binding.homeconnect.internal.handler.HomeConnectWasherHandler.lambda$8(HomeConnectWasherHandler.java:93) ~[?:?]
	at org.openhab.binding.homeconnect.internal.handler.AbstractHomeConnectThingHandler.updateChannel(AbstractHomeConnectThingHandler.java:255) ~[?:?]
	at org.openhab.binding.homeconnect.internal.handler.HomeConnectWasherHandler.lambda$1(HomeConnectWasherHandler.java:54) ~[?:?]
	at java.util.Optional.ifPresent(Optional.java:159) ~[?:?]
	at org.openhab.binding.homeconnect.internal.handler.HomeConnectWasherHandler.lambda$0(HomeConnectWasherHandler.java:45) ~[?:?]
	at org.openhab.binding.homeconnect.internal.handler.AbstractHomeConnectThingHandler$1.onEvent(AbstractHomeConnectThingHandler.java:158) ~[?:?]
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient$1.lambda$1(HomeConnectApiClient.java:392) ~[?:?]
	at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4649) ~[?:?]
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient$1.lambda$0(HomeConnectApiClient.java:390) ~[?:?]
	at java.util.ArrayList.forEach(ArrayList.java:1257) [?:?]
	at org.openhab.binding.homeconnect.internal.client.HomeConnectApiClient$1.onMessage(HomeConnectApiClient.java:390) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent$Reader.dispatchEvent(RealServerSentEvent.java:239) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent$Reader.processLine(RealServerSentEvent.java:208) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent$Reader.read(RealServerSentEvent.java:185) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent.openSse(RealServerSentEvent.java:94) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent.access$100(RealServerSentEvent.java:26) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at com.here.oksse.RealServerSentEvent$1.onResponse(RealServerSentEvent.java:79) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [200:org.openhab.binding.homeconnect:2.4.0.201812302218]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Hi @E1yot,

havenā€™t encountered such a message before. I guess that it has something to do with your Java version. Do you the Java version the NAS is using?

Iā€™ve checked the domain api.home-connect.com. They use TLS 1.1 and TLS 1.2. They also allow weak cipher suits, so I guess communication should even work with old Java versions (https://www.ssllabs.com/ssltest/analyze.html?d=api.home-connect.com&hideResults=on).

So maybe trusted CA list is outdated? Can you check openhab log file for a stacktrace?

Greetings,
Jonas

Hello,

I did a manual Java update from 161 to 211 (161 is the latest version, Synology delivers for my NAS) and the binding gets a connection and found the dishwasher.

Regards

New to Openhab, bindings, curl, so please bear with me :slight_smile:

I am trying connect to the Homeconnect API. First step works fine, and I get a response

ā€œexpires_inā€: 300,
ā€œdevice_codeā€: ā€œxxā€,
ā€œuser_codeā€: ā€œzzā€,
ā€œverification_uriā€: ā€œblablaā€,
ā€œintervalā€: 5,
ā€œverification_uri_completeā€: ā€œ/verify.home-connect.com?user_code=yyā€

I am also able to login to my Homeconnect account using the verification_uri_complete. But it ends up with (translated from Danish) You have granted access - look at the devices for next steps.

Nothing happens at the devices. I have a dryer, washer, dishwasher and oven. I have tried to ignore this, but the next curl fails with

bash: /api.home-connect.com/security/oauth/token: No such file or directory

Can anyone point me in the right direction?

Since Iā€™m interested in the HomeConnect binding I would do some test - but Iā€™m struggeling building the HomeConnect binding. I have downloaded the OpenHab stuff (as described on the OpenHab site) and Iā€™m able to run the demo app. I have downloaded the complete fork from here but I have no idea how to integrate the HomeConnect binding into OpenHab. So, what do I have to do to build the HomeConnect binding? (Btw. my developer career ended when eclipse 3.0 started to become famous :stuck_out_tongue_winking_eye:)
Any help welcome!

And maybe the more important part: is there any chance to get this binding into the official release?

Deleted my account, started from scratch, and it worked :slight_smile: Must have made a mistake somewhere.

1 Like

Hi @F-E-B welcome back
Actually there is no need to ā€œbuildā€ the binding. You just download the latest binding .jar file from the source as described by @jb4711 and put it to your local openhab addons folder.

From there follow the description to establish the connection between openHAB environment and the HomeConnect API platform.

Cheers
Stefan

Really great work, my dishwasher, oven, washingmachine and dryer are connected :slight_smile:

I found 2 smaller issues:
Dryer: progress channels show NaN when drying
Washing machine active program show NULL when washing

Thanks for the feedback. Will check as soon I get the development environment setup. Currently I have difficulties (Eclipse IDE fails when using instructions).

Took some time, but now everything is goingā€¦

I connected a fridge, a washing machine and a dryer and so far everything is OK. Points I still have on the list (e.g. converting the remaining time from seconds to h:m:s) are not binding specific issues.

In my opinion, one thing that has not yet been solved so well is the login with all the curl scripts. I had to understand first that curl behaves a bit different under Windows ā€¦

Many thanks for the good job!
How can you push the integration into the main branch?

Cool

Iā€™m almost done with the web based authentication. Just made a unprofessional video to show you :smiley:

Hi,

I have a general question: is it possible to use this binding offline?
I am building a SmartHome without using internet connections. I wrote Siemens some months ago and they told me that it is possible to use Home Connect Devices without internet access after the initial setup. Any ideas, plans or something like this about that?
I am trying to implement that offline because what happens if in 20 years Home Connect Servers may go offline but I still want to use the functionsā€¦

Hi,

Thanks for the binding. I am successfully connected with my washer and dryer. My only question is why is not the power state available for washers and dryers?
I am able to at least turn off both of them from the Home Connect app.

Best regards,
BjĆørn Larsen

Hi,

this binding only works if you have an active internet connection. I do not plan to support offline support for this binding. Unfortunately, there is no official SDK or API available.

In theory this might be possible. But I believe if BSH is shutting down there servers they will also remove there apps from mobile market places. I think without a working backend an installed app will stop working. There oAuth-Tokens will expire and you donā€™t have access to the devices anymore. My last point: I donā€™t think that most appliances will last 20 years :smiley:

JB

Hi,

work in progress. Currently I have finished the dishwasher handler (select program and start/stop program). Next I start with CoffeeMaker actions.

Please follow this channel. I will keep you informed.

JB

2 Likes

Hi!

I wanna commend you on your work so far.

I changed my Athom Homey for a Debian setup with OpenHab some weeks ago, and was excited to see this binding, for use with Siemens home appliances (oven, coffee maker, hob and dish washer).

As an earlier poster Iā€™m excited about the coffee maker events. Besides the 2 requested, also ConsumerProducts.CoffeeMaker.Event.DripTrayFull.

I have been looking at the code but have not been able to figure it out (somewhat recently started coding).

Besides these events Iā€™m looking to log my coffee consumption. Seeing as they havenā€™t opened anything up regarding statistics, Iā€™m thinking I will get a number from the machine itself, and then keep logging to persistance.

Selecting the program for coffee, I can use /homeappliances/{haid}/programs/active/options to get:

{
ā€œdataā€: {
ā€œoptionsā€: [
{
ā€œkeyā€: ā€œConsumerProducts.CoffeeMaker.Option.CoffeeTemperatureā€,
ā€œvalueā€: ā€œConsumerProducts.CoffeeMaker.EnumType.CoffeeTemperature.90Cā€,
ā€œnameā€: ā€œTemperatureā€,
ā€œdisplayvalueā€: ā€œnormalā€
},
{
ā€œkeyā€: ā€œConsumerProducts.CoffeeMaker.Option.BeanAmountā€,
ā€œvalueā€: ā€œConsumerProducts.CoffeeMaker.EnumType.BeanAmount.DoubleShotPlusā€,
ā€œnameā€: ā€œStrengthā€,
ā€œdisplayvalueā€: ā€œDoubleShot +ā€
},
{
ā€œkeyā€: ā€œConsumerProducts.CoffeeMaker.Option.FillQuantityā€,
ā€œvalueā€: 180,
ā€œunitā€: ā€œmlā€,
ā€œnameā€: ā€œLiquid volumeā€
}
]
}
}

Is this included in the actions you are working on? (no point in logging consumption if I canā€™t differentiate between the family members) :slight_smile:

Thanks again.

Johan

Hi @johanone,

I finished coffee maker appliance support last week. Unfortunately I havenā€™t released a new version. Due to my heavy refactorings of the code the other appliances wonā€™t work anymore. I will fix them one at a time. Once done I will release a new version. Shouldnā€™t take to much time as I want to push my code to the official addon repository as soon as possible.

I have covered this event too. Please have a look at the screenshots. You can power on and off your coffee machine, select a program and start it.

I think using a persistence storage is the right way. You could track the operation state and count the the value ā€œrunningā€.

JB

Hi Jonas,

Firstly, thank you for this binding. I was really happy when i found it and itā€™s really useful to see the state of my Siemens Wash Machine.

I have two questions:
When do you think this addon will be complete?
In the branch master-homeconnect-2.5.0, the things that are supposed to show in OpenHab panel are the same as in the image below? And the only thing we can change is the ā€œSelected Programā€?


I can give you some help if you want to. Iā€™m somewhat new to making OpenHab addons but iā€™m learning for about sometime now. I have a physical device so itā€™s easier for me to see if the Wash Machine part is working.

Thank you and continue the good work :slight_smile:

Hi @FredyR4zox,

Hope I will be done in August.

The branch is reflecting the current development state. I havenā€™t touched wash machine devices yet. The current implementation isnā€™t finished. I have to fix ā€œSelected programā€ and also add actions like ā€œstart programā€. After Iā€™m done you can select a program and start it.

Great I will definitely let you know when I have wash machine appliances working. I do not have such an appliance at home. It will help me a lot, as the Siemens/Bosh/ā€¦ devices behave really different from type to type.

Greetings,
Jonas

Hi Jonas

I also want to thank you for this binding!

I have some new toys:

  • Siemens HN678G4S6 oven
  • Siemens LC91KWV60 hob
  • Siemens EX875LYV1E cook top

At this moment Iā€™ve connected the oven, but Iā€™m eager to connect the hob (Iā€™d like to use it as a ventilation system)
Can I help you? Are your latest changes on github?

kr
Boris

1 Like