Home Connect binding

I´ve got the same Problem to get the Token, DrLoop, did you solve it?

thanks JAN, from Oldenburg

Thanks for this addon! Could you or anyone else please provide a small tutorial how to configure it? Maybe we can update the first post then.

What do you think?

I got a home connect developer account, registered an app over there at developer.home-connect.com and got access to a home connect fridge, coffee maker and dish washer. I activated the addon in openhab2 by using karaf. No I’m stuck with the binding configuration in Paper UI - thanks in advance for a few screenshots or text.

Best regards,
Jochen

Hi Jochen,
for me the Readme in the GitHub Repository is sufficient enough. The way forward is documented very well, I think. I was able to fully configure the Binding along this docu.
See here: Docu in GitHub

Regards
Jonathan

Perfect - I wasn’t at the Github-repo before.

Dear Community,

the binding looks great - what are the next steps to get it into the official addon-directory?

Best regards,
Jochen

Hi Jochen,

I will improve the login process. I try to do it like the Amazon Echo Control Binding does it. I think it is much easier than using curl commands.

Best regards,
Jonas

Dear Jonas,

why don’t you just add it to the official repo and then we try to get this done together?

By the way, have you had a look into Stefan Foydl’s code - I guess he was able to achieve the auth-procedure, see https://github.com/FanFanEEI/org.openhab.binding.homeconnect ?

Moreover we could strive for adding things which are available in the Home Connect API but not in the simulator, i.e. get the pictures of the fridge cam as a channel.

What do you think?

Cheers
Jochen

Hi Jochen,

why don’t you just add it to the official repo and then we try to get this done together?

Ok, then I need to rebase my branch and check if all checks pass. Are you willing to help? That would be great.

By the way, have you had a look into Stefan Foydl’s code - I guess he was able to achieve the auth-procedure, see https://github.com/FanFanEEI/org.openhab.binding.homeconnect ?

Sure, I tried to use it as a base but for a couple of reasons I started from scratch.

Greetings,
Jonas

Thanks for the invitation - I will help! Please send me an e-mail (jochen.bauer@gmail.com) then we can get in touch.

Dear Jonas,

I downloaded a fresh addons repo and will bring your code in it. Afterwards I try to do the checks and tests and then I will send the PR to the original repo. Once the code is in the main repo we can try to improve a lot of other stuff. Plese keep me posted if you got any problems with this procedure.

Cheers
Jochen

I managed to successfully use this binding to monitor my washing machine and dryer, so first I want to say “thank you” for creating this binding.

However the setup included too many manual steps for “ordinary people”. It would be nice if you could it make like the Amazonechocontrol binding. That binding offers a small webside where you are guided through the authentication process without any manual curl requests, just using OAuth to log you in.

1 Like

The first CURL step gives me:
“error”: “unauthorized_client”,
“error_description”: “request rejected by client authorization authority (developer portal)”
I have a new client_id that shows active, but I get this error. Any ideas?

And getting the hood and stove working as well would be nice…

Thanks!

Got it working!

Do you have any idea when the hood and stovetop might work in here?

Thanks a lot!

Just got an email from homeconnect.

They are working on the hood now.

I quote "The hood in your kitchen can add something special to your cooking experience. It’s main function is, of course, to make sure the fumes get vented away. Besides synchronizing it with your cooking experience through the API, you will soon also be able to set the mood through the hood’s ambient light. "

And some thing are already in the api.
https://developer.home-connect.com/docs/hood/supported_programs_and_options

Great, hopefully i can soon controll the entire kitchen

and…

Cooktop Programs

Program support is planned to be released in 2019.

So its not out yet. Hopefully soon.

Hello @iway - can you share here, how you solved the issue with the authorisation. I just ran into the same problem and assume, that the cause is me not understanding sth correct, rather than a problem with CURL or such?
thx

I use the Linux shell to issue the CURL command as described in the binding description and get this response:

“error”: “unauthorized_client”,
“error_description”: “request rejected by client authorization authority (developer portal)”

Hi Martin,

can you please post your curl command (please remove tokens etc.).

JB

hej @jb4711 , thanks for quick answer

i used the CURl command from github with the clientID from the Home connect developer page. And I simply paste it into the Linux shell of my raspPi and “fire it off”. I assume, this is the right way to handle it, or?

curl -X POST \
  https://api.home-connect.com/security/oauth/device_authorization \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'client_id=[Client ID]&scope=IdentifyAppliance%20Monitor%20Settings' 

The Home Connect dev page asks for a redirect URL (see screenshot). I assume, this is not important for the usage of the API within openHAB, but maybe you can tell anyway, which URL to use for this field. thx

Hi @mdnx,

that’s exactly the same way I did it. Did you verify that the client ID is correctly pasted into the curl-string?

On the developer web site of home connect (LINK), the reason for this issue is:
Invalid client ID or redirect URI

For the “Success Redirect URI”, I have put my website there https://www.lubach-online.de and it worked like a charm from the beginning.
Maybe the one you entered there is not valid, because it is the URI for completing the verification process?

Regards
Jonathan

Thank you very much - I tried both, changing to other redirect webpage and pasting the
clientID from the home connect application again. Success came, when I wrote the CURL call as one long string:

curl -X POST https://api.home-connect.com/security/oauth/device_authorization -H Cache-Control:no-cache -H Content-Type:application/x-www-form-urlencoded -d client_id=CLIENT_ID&scope=IdentifyAppliance%20Monitor%20Settings

Now Im stuck in the second step: I can grant access to Homeconnect on the verification page.
but when pasting the new CURL call:

curl -X POST https://api.home-connect.com/security/oauth/token -H 'Cache-Control: no-cache' -H 'Content-Type: application/x-www-form-urlencoded' -d 'client_id=[CLIENT_ID]&client_secret=[CLIENT_Secret]&grant_type=device_code&device_code=[DEVICE_CODE]'

I get as response:

{
  "error": "expired_token",
  "error_description": "Device authorization session not found, expired or blocked"
}

Problem "Solution"
after a bit of pushing around the second step of the authentication worked as well out

curl -X POST https://api.home-connect.com/security/oauth/token -H 'Cache-Control: no-cache' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=device_code&device_code=DEVICE_CODE&client_id=CLIENT_ID&client_secret=CLIENT_SECRET'

The CURL call down here works. The difference is, that Client_ID etc are not writte in brackets and that grant_type is written in first place,as suggested in the ConnectHome documentation.

For all other total Web Authentication newbies - here the obvious :wink: :

  • write the CURL call in one line and take for this all backslashes " \ " out
  • no brackets or such around Client ID etc

thanks @jb4711 for a nice binding. The CURL command is the only stumbling block for ignorant users, as me