# Node-red-contrib-netatmo 0.3.0: Error: Authenticate error: unauthorized\_client

**URL:** <https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952>\
**Category:** General\
**Created:** [20 July 2023 06:29 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952 "2023-07-20T06:29:00Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [3 August 2023 12:37 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/21 "2023-08-03T12:37:17Z")

</div>

`[{"id":"1cbf23a1.c57b7c","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"255cedb1.d40692","type":"inject","z":"1cbf23a1.c57b7c","name":"3 Minuten","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"180","crontab":"","once":true,"onceDelay":"1","topic":"3 Min Timer","payload":"true","payloadType":"bool","x":150,"y":100,"wires":[["f1969024.1987b"]]},{"id":"f1969024.1987b","type":"netatmo-dashboard","z":"1cbf23a1.c57b7c","creds":"e32844f7.84fe58","x":370,"y":100,"wires":[["4f0f230e.dc0d3c"]]},{"id":"4f0f230e.dc0d3c","type":"debug","z":"1cbf23a1.c57b7c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":100,"wires":[]},{"id":"e32844f7.84fe58","type":"netatmo-config-node","name":"HomeCoach","client_id":"XXXX","client_secret":"XXXX","refresh_token":"XXXX"}]`

Thx, but my question is, how i can get the datas from the HomeCoach?

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [3 August 2023 12:50 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/22 "2023-08-03T12:50:10Z")

</div>

> [@fuul](#):
>
> [{"id":"1cbf23a1.c57b7c","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"255cedb1.d40692","type":"inject","z":"1cbf23a1.c57b7c","name":"3 Minuten","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"180","crontab":"","once":true,"onceDelay":"1","topic":"3 Min Timer","payload":"true","payloadType":"bool","x":150,"y":100,"wires":[["f1969024.1987b"]]},{"id":"f1969024.1987b","type":"netatmo-dashboard","z":"1cbf23a1.c57b7c","creds":"e32844f7.84fe58","x":370,"y":100,"wires":[["4f0f230e.dc0d3c"]]},{"id":"4f0f230e.dc0d3c","type":"debug","z":"1cbf23a1.c57b7c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":100,"wires":},{"id":"e32844f7.84fe58","type":"netatmo-config-node","name":"HomeCoach","client\_id":"64a015b8dce01f3a190c2643","client\_secret":"6fCm1uAKBUbwHn8gzCnmglhHfRXO1sS","refresh\_token":"51149bd1187759c7370000ee|2381180867a07d06ae99da90834f8ca6"}]

```auto
[{"id":"65dd246ebde5169d","type":"function","z":"68cb8365d480cc44","name":"function 42","func":"let a = [{ \"id\": \"1cbf23a1.c57b7c\", \"type\": \"tab\", \"label\": \"Flow 2\", \"disabled\": false, \"info\": \"\" },\n { \"id\": \"255cedb1.d40692\", \"type\": \"inject\", \"z\": \"1cbf23a1.c57b7c\", \"name\": \"3 Minuten\",\n \"props\": [{ \"p\": \"payload\" }, { \"p\": \"topic\", \"vt\": \"str\" }], \"repeat\": \"180\",\n \"crontab\": \"\", \"once\": true, \"onceDelay\": \"1\", \"topic\": \"3 Min Timer\", \"payload\": \"true\",\n \"payloadType\": \"bool\", \"x\": 150, \"y\": 100, \"wires\": [[\"f1969024.1987b\"]] },\n { \"id\": \"f1969024.1987b\", \"type\": \"netatmo-dashboard\", \"z\": \"1cbf23a1.c57b7c\", \"creds\": \"e32844f7.84fe58\",\n \"x\": 370, \"y\": 100, \"wires\": [[\"4f0f230e.dc0d3c\"]] }, { \"id\": \"4f0f230e.dc0d3c\", \"type\": \"debug\",\n \"z\": \"1cbf23a1.c57b7c\", \"name\": \"\", \"active\": true, \"tosidebar\": true, \"console\": false,\n \"tostatus\": false, \"complete\": \"false\", \"statusVal\": \"\", \"statusType\": \"auto\", \"x\": 660, \"y\": 100,\n \"wires\": [] }, { \"id\": \"e32844f7.84fe58\", \"type\": \"netatmo-config-node\", \"name\": \"HomeCoach\",\n \"client_id\": \"64a015b8dce01f3a190c2643\", \"client_secret\": \"6fCm1uAKBUbwHn8gzCnmglhHfRXO1sS\",\n \"refresh_token\": \"51149bd1187759c7370000ee|2381180867a07d06ae99da90834f8ca6\" }];\nmsg.payload = a;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":560,"wires":[["649e1e32f83cf071","aa18b23087008cc0"]]},{"id":"252bd24d08db3d12","type":"inject","z":"68cb8365d480cc44","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":560,"wires":[["65dd246ebde5169d"]]},{"id":"e2d14ed7245c7431","type":"debug","z":"68cb8365d480cc44","name":"debug 174","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":950,"y":540,"wires":[]},{"id":"649e1e32f83cf071","type":"function","z":"68cb8365d480cc44","name":"function 43","func":"msg.payload = msg.payload[0].label;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":540,"wires":[["e2d14ed7245c7431"]]},{"id":"aa18b23087008cc0","type":"function","z":"68cb8365d480cc44","name":"function 44","func":"msg.payload = msg.payload[2].type;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":600,"wires":[["5f4522cff75cd6a8"]]},{"id":"5f4522cff75cd6a8","type":"debug","z":"68cb8365d480cc44","name":"debug 175","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":950,"y":600,"wires":[]}]

```

I don't know home coach. This is the only help I can provide.

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [4 August 2023 04:50 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/23 "2023-08-04T04:50:51Z")

</div>

Thank you very much for your help. But i need a Node or something to get the Datas from Netatmo into the Node-Red. And actually there is no working Node to get the Datas ☹

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [4 August 2023 12:18 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/24 "2023-08-04T12:18:30Z")

</div>

I have said it before - oauth2 is horrible. Would be nice if it could be integrated into the http request node (somehow), especially with so many applications using it today and it requires a browser for interaction with the api provider to provide scoped access.

> What I used with the old node and still miss in the new node is the ability to read public data from other Netatmo installations, which I used to get rain information in my area.

I had the same issue. Instead I installed the [node-red-oauth2](https://flows.nodered.org/node/node-red-contrib-oauth2) node, which made this relatively easy, as it provides an interface to setup the access.

Example flow (still requires one-time fiddling)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9d45b64f67c96e7c698d1bfde81eead3461c70ce.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90e0a2fa7addf6ce5b33265748583356bda225cc.png)  
In the authorization code node provide the

clientid  
client secret

Click the key button, it will open a window to netatmo, ok for access, window will close  
now the code has been filled in, done  
deploy  
press the inject button

Access token and refresh token are saved as a global object

Now you can access the public data url (make sure to modify the url inside the function node)  
Adjust the credentials function node to refresh the token automatically every 55 mins.

```auto
[{"id":"cb7f83d9a367348a","type":"inject","z":"225edc0f2ab084a8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":260,"wires":[["2514d8dc875c1b2e"]]},{"id":"990b3fc65eb5a01c","type":"http request","z":"225edc0f2ab084a8","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"credentials":{},"x":445,"y":260,"wires":[["8c7095a7361d00b6"]],"l":false},{"id":"2514d8dc875c1b2e","type":"function","z":"225edc0f2ab084a8","name":"get public data","func":"const access_token = global.get('netatmo_oauth2').token.access_token\nconst headers = {}\nconst types = [\"rain\", \"wind\"]\n\nheaders[\"Authorization\"] = `Bearer ${access_token}`\n\nlet url = \"https://api.netatmo.com/api/getpublicdata?lat_ne=52.147605%20&lon_ne=4.473581&lat_sw=52.108087&lon_sw=4.435644&filter=false\"\n\ntypes.forEach(type=>{\n url = `${url}&required=${type}`\n node.send({headers,url})\n})\n\n\nreturn null","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":260,"wires":[["990b3fc65eb5a01c"]]},{"id":"8c7095a7361d00b6","type":"debug","z":"225edc0f2ab084a8","name":"debug 383","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":260,"wires":[]},{"id":"592dc8f750c3cd36","type":"group","z":"225edc0f2ab084a8","name":"setup credentials","style":{"label":true},"nodes":["9909b6f7dfd95f9f","1ef7250fbe8d2af9","7c6ab1c7a02690d4","6f5aed0bdbad1cae","8198db5e0cfcb195","e1fbe19cb319629c","cdab0b5dadd0e33e","8251478843e59995","28a02df4e332b227"],"x":54,"y":59,"w":642,"h":142},{"id":"9909b6f7dfd95f9f","type":"oauth2","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"Authorization Code","container":"oauth2Response","grant_type":"authorization_code","access_token_url":"https://api.netatmo.com/oauth2/token","authorization_endpoint":"https://api.netatmo.com/oauth2/authorize","redirect_uri":"/oauth2/redirect_uri","open_authentication":"","username":"","password":"","client_id":"","client_secret":"","scope":"read_station","proxy":"","senderr":false,"client_credentials_in_body":false,"rejectUnauthorized":true,"headers":{},"x":330,"y":100,"wires":[["e1fbe19cb319629c"]]},{"id":"1ef7250fbe8d2af9","type":"inject","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":100,"wires":[["9909b6f7dfd95f9f"]]},{"id":"7c6ab1c7a02690d4","type":"inject","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"Refresh Token","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":160,"wires":[["8251478843e59995"]]},{"id":"6f5aed0bdbad1cae","type":"oauth2","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"Set by msg.oauth2Request","container":"oauth2Response","grant_type":"set_by_credentials","access_token_url":"http://localhost:3000/oauth/token ","username":"pedroet","password":"","client_id":"confidentialApplication","client_secret":"topSecret","scope":"*","headers":{},"x":455,"y":160,"wires":[["28a02df4e332b227"]],"l":false},{"id":"8198db5e0cfcb195","type":"debug","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"DBG 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":600,"y":160,"wires":[]},{"id":"e1fbe19cb319629c","type":"function","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"Set refreshToken","func":"const access_token_url = \"https://api.netatmo.com/oauth2/token\"\n\nif (msg.oauth2Response.access_token) {\n const netatmo_oauth2 = {}\n netatmo_oauth2.url = access_token_url\n netatmo_oauth2.token = msg.oauth2Response\n\n global.set(\"netatmo_oauth2\", netatmo_oauth2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":455,"y":100,"wires":[["cdab0b5dadd0e33e"]],"l":false},{"id":"cdab0b5dadd0e33e","type":"debug","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"DBG 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":100,"wires":[]},{"id":"8251478843e59995","type":"function","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"credentials","func":"let netatmo = global.get('netatmo_oauth2');\n\nmsg.oauth2Request = { \n \"access_token_url\": netatmo.url,\n \"credentials\": {\n \"grant_type\": \"refresh_token\",\n \"client_id\": \"\",\n \"client_secret\": \"\",\n \"scope\": \"read_station\",\n \"refresh_token\": netatmo.token.refresh_token \n },\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":160,"wires":[["6f5aed0bdbad1cae"]]},{"id":"28a02df4e332b227","type":"function","z":"225edc0f2ab084a8","g":"592dc8f750c3cd36","name":"Set refreshToken","func":"const access_token_url = \"https://api.netatmo.com/oauth2/token\"\n\nif (msg.oauth2Response.access_token) {\n const netatmo_oauth2 = {}\n netatmo_oauth2.url = access_token_url\n netatmo_oauth2.token = msg.oauth2Response\n\n global.set(\"netatmo_oauth2\", netatmo_oauth2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":505,"y":160,"wires":[["8198db5e0cfcb195"]],"l":false}]

```

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [4 August 2023 15:26 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/25 "2023-08-04T15:26:46Z")

</div>

Hi bakman2,  
this looks very promising to me. Thaks for the info!

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [7 August 2023 14:59 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/26 "2023-08-07T14:59:16Z")

</div>

Hi bakman2

thx for additional help. i will try it soon.  
Actually i am unable to install the node. I receive everytime the Failure:

```auto
2023-08-07T14:57:31.020Z installieren : node-red-contrib-oauth2 5.0.4

2023-08-07T14:57:31.069Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production node-red-contrib-oauth2@5.0.4
2023-08-07T14:57:41.057Z [out] + node-red-contrib-oauth2@5.0.4
2023-08-07T14:57:41.057Z [out] updated 3 packages and moved 1 package in 8.731s
2023-08-07T14:57:41.084Z rc=0

```

i can't find any dependencies... any idea?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 August 2023 15:24 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/27 "2023-08-07T15:24:23Z")

</div>

Looks like it installed succesfully. Would recommend to use the node-red palette to install plugins.  
If you don't see the node, you may need to restart node-red

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [7 August 2023 16:32 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/28 "2023-08-07T16:32:57Z")

</div>

@bakman2

It works!!  
I had problems with generating the key (I did not realize, that the code is already filled in)  
and also in the Refresh token line the oauth2 node shows a status "`ERR_BAD_REQUEST`" when pressing inject and DBG2 says: `oauth2Response.error: invalid_client`

Another point: according to

> **[Netatmo Connect | Weather API Documentation](https://dev.netatmo.com/apidocumentation/weather#getpublicdata)**
>
> We want to create a smarter home. With Netatmo connect, creative people can imagine solutions to make users' life easier.
> Netatmo products are ready to communicate with all Apps and services to fit your vision of what makes a home...

the parameter to get only rain sensors should be `required_data=rain`  
but in your code you use `&required=${type}`!?

But I get the data I need and now I only have to integrate the new flow in my existing flow.

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [7 August 2023 16:51 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/29 "2023-08-07T16:51:03Z")

</div>

I had to move `msg.payload.body` to `msg.payload`, so that my existing flows continues to work.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 August 2023 16:52 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/30 "2023-08-07T16:52:58Z")

</div>

> [@stefan24](#):
>
> but in your code you use `&required=${type}`!?

I defined an array of types:

```auto
...
const types = ["rain", "wind"]
...
types.forEach(type=>{
    url = `${url}&required=${type}`
    node.send({headers,url})
})

```

So it makes 2 requests, one for rain and another for wind.  
Change it to:

```auto
const types = ["rain"]

```

and you will only get rain.

> Refresh token line the oauth2 node shows a status "`ERR_BAD_REQUEST` " when pressing inject and DBG2 says: `oauth2Response.error: invalid_client`

you will need to provide the credentials in the "credentials" function node (client\_id,client\_secret) .

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [7 August 2023 17:44 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/31 "2023-08-07T17:44:46Z")

</div>

I saw the code and understood it 😄

But your `&required=` should be a `&required_data=`

> [@bakman2](#):
>
> you will need to provide the credentials in the "credentials" function node (client\_id,client\_secret) .

I thought, they can be used from the first line, but obviously they cannot be extracted out of the oauth2 node. It works now, but is there any chance to hide the client secret in the function code, maybe by filling the second oauth2 node with client\_id and client\_secret instead of "Set by msg.oauth2Request"?

Nevertheless, thank you very much for helping me / us with the oauth2 thing.

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [8 August 2023 05:24 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/32 "2023-08-08T05:24:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/61557be3769c4aac9df104de4672a3e73f3af4f4.png)

I receive in all ways this error, restart Node-red oder the Pi doesn't help.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [8 August 2023 05:38 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/33 "2023-08-08T05:38:07Z")

</div>

> [@stefan24](#):
>
> the parameter to get only rain sensors should be `required_data=rain`

You are correct, my mistake.

> I receive in all ways this error, restart Node-red oder the Pi doesn't help.

Which node-red version and node js version do you use ?

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [9 August 2023 17:23 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/34 "2023-08-09T17:23:48Z")

</div>

Hi Guys,

thanks a lot for all the help.  
My Problem was a old version of Node Red to install the Oauth2 Node.

Now i am able to receive the right Array, but i am stil not able to work with them 😢

So my debug node shows this:  
 ![Bildschirmfoto 2023-08-09 um 19.21.12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5e1caf2baf3edc16ea153d4ea28e284c9e6ef0ca.png)

My function is:

```auto
var msg1 = {};

msg1.payload = msg.payload.body.devices[0].station_name;

return msg1;

```

and it doesn't work. do you see any mistake? I add this Function instead of the "debug383" in your sample.

thx

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [10 August 2023 06:59 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/35 "2023-08-10T06:59:13Z")

</div>

Looks ok for me. But what Do you mean exactly regarding does not work?

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [10 August 2023 08:08 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/36 "2023-08-10T08:08:37Z")

</div>

There is no Output in the Debug Node after the Script...

 ![Bildschirmfoto vom 2023-08-10 10-06-37](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/e/6ec595a0e36aab40626de0c6c7377e57bb87f574.png)

I receive in "debug 384" the right Array. In the Node "debug 385" i receivenothing.

I don't understand why...

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 August 2023 10:48 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/37 "2023-08-10T10:48:59Z")

</div>

Set the debug node to Output Complete Message.

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [10 August 2023 11:04 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/39 "2023-08-10T11:04:19Z")

</div>

Doesn't work... ☹

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 August 2023 11:14 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/40 "2023-08-10T11:14:48Z")

</div>

The `function` node has two outputs but only one of the outputs has a `debug` attached. Put another `debug` node on the other output.

---

<div class="post-metadata">

**Author:** ![fuul](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fuul](https://discourse.nodered.org/u/fuul)\
**Post date:** [13 August 2023 13:45 UTC](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952/41 "2023-08-13T13:45:38Z")

</div>

Thank you very much, now it works. It was a failure with the Outputs an the Var's.

Now i can read the homecoach perfectly!

Thx you all!

[Previous page](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952.md?page=1)

[Next page](https://discourse.nodered.org/t/node-red-contrib-netatmo-0-3-0-error-authenticate-error-unauthorized-client/79952.md?page=3)
