Miele@home integration need help

I'm trying to integrate my Miele washing machine into Home-assistant with NR.
I have already received my keys on the Miele Dev website and am using the Miele app and everything works.

Unfortunately I can't get a connection with Node-Red.
I use it
https://flows.nodered.org/flow/32ab59e2399e1b99f786fd40bfa0835a
and also filled out the ID's, username and password...

I get error:

msg.payload : string[42]

at the "get Bearer" SubFunction Function-Node, i get this debug-output===>

12.12.2023, 16:52:21node: debug 3
 msg.payload : string[239]
" -d "grant_type=password" -d "client_id=d4exxxxxxxxxxxxxxxxxxxxxxxb" -d "client_secret=f6xxxxxxxxxxxxxxxxxxxxxxx1u" -d "username=xxxxxxle" -d "password=xxxxxxxxx" -d "vg=de-DE" https://api.mcs3.miele.com/thirdparty/token/"

"{"message":"username/password is invalid"}"



12.12.2023, 16:52:22[node: debug 1]
(http://homeassistant.local:8123/api/hassio_ingress/xCis3omFC_5y71-jqISBajW9uY_t2luB8bOQtUyIV4k/#)access_token : msg.payload : undefined

undefined

Sorry, this is all a bit fragmented!

Are you trying to connect to Home Assistant? if so - you will need to ask the HA community - most here do not use HA

If your are trying to connect to a Miele web service, I'm not sure why the exec node is needed, and you can just use the HTTP Request Node?

Your goal is not entirely clear?

Yes, and ther runs already... thats mean my account works and also the connect.
Now i would like try it in Node-Red but ther i get the problems

edit:
I would like to use the example nodes mentioned above as examples to test the functions.
But as you can see, authentication fails.
Even if I use the first flow from the example. That doesn't work either.

What can I post here so that you can see where in the Flo it doesn't work, otherwise I'll go around in circles with the questions

Ok, if you're trying to connect to your washing machine by connecting to HA - then you will need to seek support from the HA community.

As I mentioned, most here do not use Home Assistant.

sorry but you misunderstood

I ONLY want to establish the connection via Node-Red now.
Miele uses a cloud for this, this cloud has an API, in order to control my washing machine I have to access it via their API and cloud... that has nothing to do with HA...

Please try not to send me to HA if this is about NR and the Miele API...

I would appreciate some help

edit:
maybe @colin can help me

Then don't answer yes to you are trying to connect to Home Assistant :wink:

Taking HA out of this equation, and the flow you posted (its seems way overkill) - most can be achieved with the HTTP Request Node and the OAuth2 node such as below.

given you have a collection of API keys from Miele - do they not provide documentation for there API? - it will help massively

EDIT
I removed the home assistant tag from this post

but there is already a small description of the API. But the examples are very sparse for me.
For this reason, I would like to use finished Note-Red flows like the ones mentioned above for the first time and only when I have learned can I delve into further details.

In the flows mentioned above that I use. Normally you can't do much wrong.
You apply for your IDs and then enter the data into the flows.

According to information from the internet, the registration problems should occur if you haven't made the country setting correctly... that's de-DE for me... and it should work... but unfortunately it doesn't work

Humor me, and go for a simple approach by seeing if you can get the auth token with the below approach, if you can, build it up from there.

I don't use Miele, so not sure what else could be at fault, if this still fails

Set your creds in the function node - The HTTP Request node, handles all the rest

[{"id":"caa9182d6bf17da5","type":"http request","z":"2d7bf6e3.84c97a","name":"","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://api.mcs3.miele.com/thirdparty/token/","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/x-www-form-urlencoded"}],"x":595,"y":1280,"wires":[["86bc668b598281c8"]]},{"id":"e374d018058eb540","type":"inject","z":"2d7bf6e3.84c97a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":1280,"wires":[["40d10d3cf51a6502"]]},{"id":"40d10d3cf51a6502","type":"function","z":"2d7bf6e3.84c97a","name":"Set Request VARS (edit me)","func":"const ClientID = 'xxxxxxxx'\nconst ClientSecret = 'xxxxxxxx'\nconst Username = 'xxxxxxxx'\nconst Password = 'xxxxxxxx'\nconst VG = 'de-DE'\n\n\nmsg.payload = {\n    \"grant_type\": \"password\",\n    \"client_id\" : ClientID,\n    \"client_secret\" : ClientSecret,\n    \"username\": Username,\n    \"password\": Password,\n    \"vg\" : VG\n}\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1280,"wires":[["caa9182d6bf17da5"]]},{"id":"86bc668b598281c8","type":"debug","z":"2d7bf6e3.84c97a","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":785,"y":1280,"wires":[]}]

Note: What I am seeing is a requirement for redirect_uri which does not appear to be optional, and there appears to be various steps according to below
https://www.miele.com/developer/authorization.html

Thank you very much for your patience and help, the developer of the node said that it was probably DE-de. de-DE would be wrong.
I have to try this this evening. But with all the testing, my node red has now been destroyed and I have to repair that first :frowning:

After repair my Node-Red and check again my node-Red Flows works now all
Thanks a lot for help!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.