# Miele@home integration need help

**URL:** <https://discourse.nodered.org/t/miele-home-integration-need-help/83643>\
**Category:** General\
**Created:** [12 December 2023 16:04 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643 "2023-12-12T16:04:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [12 December 2023 16:04 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/1 "2023-12-12T16:04:18Z")

</div>

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

> **[Miele@Home Integration (flow) - Node-RED](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===\>

```auto
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

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [12 December 2023 16:17 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/2 "2023-12-12T16:17:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [12 December 2023 16:32 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/3 "2023-12-12T16:32:03Z")

</div>

> [@marcus-j-davies](#):
>
> Are you trying to connect to Home Assistant?

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

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [12 December 2023 16:36 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/4 "2023-12-12T16:36:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [12 December 2023 16:48 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/5 "2023-12-12T16:48:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [12 December 2023 16:56 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/6 "2023-12-12T16:56:01Z")

</div>

> [@selfmade](#):
>
> sorry but you misunderstood

Then don't answer `yes` to you are trying to connect to Home Assistant 😉

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.

> **[node-red-contrib-oauth2](https://flows.nodered.org/node/node-red-contrib-oauth2)**
>
> The node-red-contrib-oauth2 is a Node-RED node that provides an OAuth2 authentication flow. This node uses the OAuth2 protocol to obtain an access token, which can be used to make authenticated API requests.

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

---

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [12 December 2023 18:34 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/7 "2023-12-12T18:34:15Z")

</div>

> [@marcus-j-davies](#):
>
> given you have a collection of API keys from Miele - do they not provide documentation for there API? - it will help massively

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

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [12 December 2023 19:06 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/8 "2023-12-12T19:06:51Z")

</div>

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

```auto
[{"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](https://www.miele.com/developer/authorization.html)

---

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [13 December 2023 13:09 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/9 "2023-12-13T13:09:23Z")

</div>

> [@marcus-j-davies](#):
>
> 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

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 ☹

---

<div class="post-metadata">

**Author:** ![selfmade](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selfmade/32/79581_2.png) [@selfmade](https://discourse.nodered.org/u/selfmade)\
**Post date:** [15 December 2023 20:48 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/10 "2023-12-15T20:48:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 February 2024 20:49 UTC](https://discourse.nodered.org/t/miele-home-integration-need-help/83643/11 "2024-02-13T20:49:22Z")

</div>

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