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.
We would like to test the binding - where to go next?
I encountered the same error too. Will analyse the logs now. Till now I hadn’t enough energy to analyse the problem ( common cold).
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.
- 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:
- Don’t use the refresh token
- use username and password of the user and try emulate a web browser to automate the authorization step described in https://github.com/bruestel/org.openhab.binding.homeconnect/tree/master/addons/binding/org.openhab.binding.homeconnect#2-create-oauth2-tokens-device-flow Step 5
@jb4711 thank you for this great binding! I’ve had it working initially yesterday, but unfortunately got the famous 400 error here as well . I’ll wait until you hear something from those Siemens guys!
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
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,
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
Did you used quote sign (
-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
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.
Yay thanks for your help
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
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.
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.