Home Connect binding

Oh good advice: for me the error also started after a restart.

Unfortunately it happened here again as well.

Have the same oAuth-Problem. But only by 2 of 3 machines. In the past, it was the same behaviour. If i create a new token, all is okay for some Time.
Greetings, Markus

We would like to test the binding - where to go next?

Best regards,
Jochen

Hi @Master79 @mstehle @johannesbonn @borcon,

I encountered the same error too. Will analyse the logs now. Till now I hadnā€™t enough energy to analyse the problem ( common cold).

@Jochen_Bauer
If you would like to test the binding, I would recommend the simulator environment of HomeConnect. The binding can talk to that environment too. You donā€™t need to own a Siemens or Bosch device for that.
This is a good starting point: https://github.com/bruestel/org.openhab.binding.homeconnect/tree/master/addons/binding/org.openhab.binding.homeconnect

Just opened a ticket and waiting for a response.

Problem summary:

  • The API client is refreshing his access token every 24h
  • This is done with the help of the refresh token
  • During the refresh the API could also send a new refresh token, but this never happens. I always have to use the same refresh token
  • After a couple of days the API denies the refresh token --> broken client

Possible solution if the support canā€™t help:

3 Likes

@jb4711 thank you for this great binding! Iā€™ve had it working initially yesterday, but unfortunately got the famous 400 error here as well :smiley:. Iā€™ll wait until you hear something from those Siemens guys!

Hi Jonas,

first of all great work! But i have issues to receive the tokenā€¦
Seems my command line is not correct.
My openhab server is a Windows Server 2016, never used curl before :slight_smile:

My first curl command is like this:

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=000000000000000&scope=IdentifyAppliance%20Monitor%20Settings

Seems to work, but at the end of the reply there is an error about the command ā€œscopeā€ wrong / not found?
Device code & user code are ok, verification via website also working.

At the next step mit command line looks like this:
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=00000000000000000&client_secret=000000000000000000000&grant_type=device_code&device_code=000000000000000

But here the reply begins with ā€œerrorā€: ā€œinvalid_requestā€ ā€œmissing or invalid parameterā€?

Can you please take a look at my commands what iĀ“m doing wrong there?

Thanks &BR from Berlin,
Manuel

Hi Jonas,
have you received any feedback yet?

No not yet. Writing back and forth with the support team. Conclusion so far: It should work like in the documentation mentioned. But somehow it does not work for us :smiley:

Did you used quote sign (') after -d like in my example?
You could also try to replace %20 with a space. &scope=IdentifyAppliance Monitor Settings

You donā€™t need to execute the curl commands from the openhab server machine. Can you try it on your local machine for example.

@jb4711 Thanks for the fast answer :slight_smile:

Tried all, with quotes, space, without, on Windows 7, on Windows 10ā€¦ hmpfā€¦ drives me crazy
Scope is always wrong or missing, and second command doesnĀ“t work completely

Any more ideas?

Can you please send me a screenshot of your command line via PM. I will try to reproduce it.

Good news from the Home Connect Developer team:

ā€˜ā€™ā€™
First, sorry for the late response. Weā€™ve checked it again on our side and it seems that we found the reason. In the next days we will deploy a new version of our OAuth service. As soon as this is done, we will inform you.
ā€˜ā€™ā€™

2 Likes

Yay :smiley: thanks for your help :slight_smile:

You knowā€¦itā€™s quite a hassle to live without lights that turn on when you open the dishwasher, or signals when the washung machine is done :rofl: :rofl:

Excellent! Thank you very much Jonas.

Thanks also for chasing this up too.

My wife didnā€™t think much to all the home automation stuff until I linked up the washing machine and drier with Alexa to tell us when either of them had finished their cycles.

Thatā€™s a major time saver on washing day.

New message from Home Connect development team.

We have good news for you. The latest version was deployed some minutes ago.

In addition you can decided per client in developer portal if a new refresh token is generated each time. But please not if you enable this then you can only use a refresh token once. If it is used twice or more then the whole client is revoked automatically. This is a recommendation of the OAuth standard.

Best regards,

3 Likes

Thatā€™s great Jonas! Is the binding fully compatible with this or is there a modification required?

No modification required. Now it just should work.

@All: I would like to get rid of the initial curl commands. Has anyone a hint which other binding I could have a look at? I would like to checkout how other bindings handle oAuth flow.