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:
- 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!
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
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
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
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.
Best regards,
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.