Home Connect binding

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

Did you call the verify URI?

  1. Open the verification_uri_complete link in a web browser. You can now login with your Home Connect account and grant access. _Please don’t use your developer account credentials

Thanks for the help - its working now - see post above
the problem was as usual in front of the computer :slight_smile:

EDIT: Is it possible that the status in OH on/off can only be displayed/changed once the dishwasher door is open?

Hello everybody,

first of all: the binding seems to work quite well for me, except for one point. I don’t manage to show the power status of the dishwasher / to switch it on or off. The status “power_state” remains unchanged. In the logfile, however, the state is displayed correctly when I change it on the machine or the regular Home Connect app. But not in OH.

But I don’t see any error in my configuration:

.item:

Switch                 Geschirrspueler_PowerState                  "Betriebszustand"                       {channel="homeconnect:Dishwasher:XXX:power_state"}

.sitemap

Switch item= 	Geschirrspueler_PowerState

Log:

2019-03-10 14:52:55.017 [vent.ItemStateChangedEvent] - homeconnect_Dishwasher_XXX_power_state changed from OFF to ON

Does anyone have any idea where the mistake could be?

Hi Thomas,

according to your log, your power_state channel is linked to an item called “homeconnect_Dishwasher_XXX_power_state” and not “Geschirrspueler_PowerState”:

Check your config again. Have linked the channel via the UI?

Regards,
Matt

Hi,

I’ve rebooted several times and all of a sudden it works. I didn’t change any more names. Strange but no matter. The main thing is that it works. Have a nice Sunday to all of you!

Hood and stove seem to be in the API now, how can we get that into openHAB now?
Thanks!

Dear all

was there a change that I missed ?? I thought the ON / OFF state was earlier correctly given. Now the washer is running but shows OFF

siemens.items:

Group WM “Washing machine [%s]” (Cleaning)
String WMops “Status [%s]” (Cleaning)
Contact WMdoor "Door " (Cleaning)
Switch WMremoteallow “Remote start” (Cleaning)
Switch WMremotestate “Remote Control status” (Cleaning)
String WMprogram “Active program” (Cleaning)
String WMprogramstate “Program Status” (Cleaning)
Number WMprogramremain “Program remain [%.0f]” (Cleaning)
Number WMprogramprog “Program progress [%.0f]” (Cleaning)
String WMtemperature “Temperature” (Cleaning)
String WMspinspeed “Spin Speed” (Cleaning)

@jb4711 : Any idea?

Cheers
Stefan

Hi Jonas,

thx for your Home Connect Binding. I wanted to give him a try but on the CURL Call it ends for me.

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=[4CF4AEXXXXXXXXXXXXXXXXXX]&scope=IdentifyAppliance%20Monitor%20Settings'

results in

{
  "error": "unauthorized_client",
  "error_description": "request rejected by client authorization authority (developer portal)"
}

i have no idea whats going wrong.

Regards

Hi Daniel,

remove the [] brackets in client ID.
That should help.

Regards
Jonathan

1 Like

Didn’t saw that. :slight_smile: Thanks

Hi all,

I liked to try this Binding as well, but fail - as some others - with athentication :frowning:

I managed to get first curl command applied, even with error on scope

{
“expires_in”: 300,
“device_code”: “DEVICE-CODE”,
“user_code”: “abcd-1234”,
“verification_uri”: “https://verify.home-connect.com”,
“interval”: 5,
“verification_uri_complete”: “Home Connect Authorization”
}Der Befehl “scope” ist entweder falsch geschrieben oder konnte nicht gefunden werden.

Honestly I have no idea what’s going wrong with scope

But I fail on second curl, while I was able to login to HC Portal, and grant access

Second Error

{
“error”: “invalid_request”,
“error_description”: “missing or invalid request parameters”
}Der Befehl “device_code” ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Der Befehl “client_id” ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Der Befehl “client_secret” ist entweder falsch geschrieben oder konnte nicht gefunden werden.

Any help is much appreciated

Regards
int5749

Finally after some research/trying I managed to get all curl commands working and proper results

But now there is no communication after I reconfigure PaperUI :confused:

]@1fe3a7f{STARTING,5<=0<=5,i=0,q=0}[ReservedThreadExecutor@8d5058{s=0/1,p=0}]
00:37:09.231 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘homeconnect:api_bridge:xxxxxx’ changed from OFFLINE (COMMUNICATION_ERROR): Communication error
! response code: 403, message: Forbidden, body: {
“error”: “access_denied”,
“error_description”: “invalid user”
} (Tried at Tue Mar 26 00:36:32 CET 2019) to OFFLINE (COMMUNICATION_ERROR): Communication error! response code: 403, message: Forbidden, body: {
“error”: “access_denied”,
“error_description”: “invalid user”
} (Tried at Tue Mar 26 00:37:08 CET 2019)

Any Idea on this? I configured PaperUI according to instruction.

The only piece I wasn’t able to finish was in Home Connect Portal after I grant access I should enter a code which was displayed on device, but there wasn’t any on my dishwasher.