# Net Atmo login - how to connect?

**URL:** <https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756>\
**Category:** General\
**Created:** [26 February 2023 11:01 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756 "2023-02-26T11:01:40Z")\
**Posts on this page:** 16\
**Page:** 1

<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:** [26 February 2023 11:01 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/1 "2023-02-26T11:01:40Z")

</div>

Since a few years I am using node-red-contrib-netatmo-dashboard.  
Today I updated the node and found out, that the login does not work anymore.  
It seems that Net Atmo has changed the Authentification process.  
With my Client ID, Client secret, username and password I can not connect.  
How do I get a refresh token?

Help very much appreciated

---

<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:** [26 February 2023 11:39 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/2 "2023-02-26T11:39:56Z")

</div>

You should open an issue on the [node's GitHub page](https://github.com/guidone/node-red-contrib-netatmo-dashboard/issues) so the node's author can address this

---

<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:** [26 February 2023 14:50 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/3 "2023-02-26T14:50:49Z")

</div>

I am using node-red-contrib-netatmo (doesnt require the oauth2 credentials.)

But the node you are referring to [has documentation](https://flows.nodered.org/node/node-red-contrib-netatmo-dashboard) on the flow page (in the bottom) how to get the credentials.

---

<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:** [26 February 2023 18:45 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/4 "2023-02-26T18:45:14Z")

</div>

thanks for your post regarding node-red-contrib-netatmo.  
I switched to this node and all works well. I had to change a few pathes but my old credentials are working 🙂

---

<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:** [26 February 2023 22:30 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/5 "2023-02-26T22:30:09Z")

</div>

It would be nice if you would open an issue on the original node and maybe the author would fix it and that would help others in the future.

---

<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:** [27 February 2023 10:17 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/6 "2023-02-27T10:17:04Z")

</div>

Hi Paul,  
I did this already before I got the tip of bakman2.  
I am waiting for a response.  
As soon as I get it, I will let you know.

---

<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:** [28 February 2023 09:41 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/7 "2023-02-28T09:41:26Z")

</div>

Hi Paul,  
please have a look at [Netatmo guidelines](https://dev.netatmo.com/apidocumentation/oauth).

I managed to get my user code but I was not succesfull with Step 4 - Retrieve the access token with the code.

I always get this message: {"error":"invalid\_request","error\_description":"Invalid grant\_type parameter or parameter missing"}

How would you put the link together?

---

<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:** [28 February 2023 10:04 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/8 "2023-02-28T10:04:56Z")

</div>

1. While I can offer some suggestions, I've never used Netatmo
2. did you follow the steps in the documentation @bakman2 pointed you at?
3. you don't show what you sent as a request

---

<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:** [28 February 2023 10:50 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/9 "2023-02-28T10:50:25Z")

</div>

I think there is nothing wrong with that node.

The problem is getting the token, which needs to be done separately (via OAuth2) which can be quite convoluted.

---

<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:** [28 February 2023 10:54 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/10 "2023-02-28T10:54:30Z")

</div>

this is my link that I put together in a little flow.  
I x-ed a few numbers of my user code.  
Does the content statement go into headers?

```auto
[{"id":"7d0f1c8ef7cbe606","type":"function","z":"264e8ddc6a8ee1d7","name":"function 64","func":"delete msg.topic;\ndelete msg.payload;\nmsg.headers =\"Content-Type: application/x-www-form-urlencoded;charset=UTF-8\"\nlet u = \"https://api.netatmo.com/oauth2/token?\";\nlet p = \"grant_type=authorization_code\" + \"&\" +\n\"code=xxxxxxxxdb002c922a6b68202d4d87365\" + \"&\" +\n\"client_id=xxxxxxxad076b72e221919dbc\" + \"&\" +\n\"client_secret=xxxxxxxx6yjx717g98gABh0uiSGgyEsJ\" + \"&\" +\n\"redirect_uri=localhost\" + \"&\" +\n\"scope=read_station\" + \"&\" +\n\"state = Bebefunk\";\nmsg.url = u + p;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":340,"wires":[["9a5586f4ca368a78","adcf8213009aa17c"]]},{"id":"adcf8213009aa17c","type":"http request","z":"264e8ddc6a8ee1d7","name":"","method":"POST","ret":"obj","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":670,"y":340,"wires":[["de9fc90132f0778e"]]},{"id":"9a5586f4ca368a78","type":"debug","z":"264e8ddc6a8ee1d7","name":"debug 109","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":400,"wires":[]},{"id":"0536db188c167914","type":"inject","z":"264e8ddc6a8ee1d7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":340,"wires":[["7d0f1c8ef7cbe606"]]},{"id":"de9fc90132f0778e","type":"debug","z":"264e8ddc6a8ee1d7","name":"debug 110","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":340,"wires":[]}]

```

---

<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:** [28 February 2023 10:57 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/11 "2023-02-28T10:57:08Z")

</div>

I followed the steps in the docu. Getting the user code was easy and straight forward.

but step 4, which should give me the tokens, comes back with this error message.

---

<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:** [28 February 2023 11:07 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/12 "2023-02-28T11:07:27Z")

</div>

The tokens are based on a scope - which scope did you specify on the netatmo app side ?

---

<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:** [28 February 2023 11:17 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/13 "2023-02-28T11:17:43Z")

</div>

read\_station

I also tried Postman, but as this was the first time for me, I have to read the docs first. ☹

link to postman [Postman](https://learning.postman.com/docs/sending-requests/authorization/#oauth-20)

link to a you tube video for postman [https://www.youtube.com/watch?v=3yfHIVWddqk](https://www.youtube.com/watch?v=3yfHIVWddqk)

---

<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:** [28 February 2023 17:21 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/14 "2023-02-28T17:21:58Z")

</div>

Hi Paul, I was able to get my tokens with postman.  
It is not difficult when you know how to do it.  
postman is a perfect tool for such problems.

---

<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:** [1 March 2023 13:42 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/15 "2023-03-01T13:42:12Z")

</div>

If you use postman, the links on this picture can be used. Looks very similar in Postman.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39644cfdff6c6a34ae09162b137b66e9469e3a50.jpeg)

---

<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:** [15 March 2023 13:42 UTC](https://discourse.nodered.org/t/net-atmo-login-how-to-connect/75756/16 "2023-03-15T13:42:46Z")

</div>

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