Node-red-contrib-netatmo 0.3.0: Error: Authenticate error: unauthorized_client

This node does not work for some days now. It produces this error:

Error: Authenticate error: unauthorized_client

This issue is already discussed in Error: Authenticate error: unauthorized_client · Issue #28 · ssadams11/node-red-contrib-netatmo · GitHub

But there is another node, which uses the new authentication of Netatmo:

Time to switch ...

BTW: One user is complaining, that it seems to work with current data, but does not fetch historical data.

In the title you talk about node-red-contrib-netatmo v0.3.0. Your link talks about node-red-contrib-netatmo-dashboard v1.0.0, which are two different nodes.

I use node-red-contrib-netatmo v0.3.0 more than a year and it works fine without any problem.

Netatmo enabled their Oauth2 api (was announced last year), not going to be easy to get this working from node-red without some manual intervention.

I know, that these are different nodes. I have problems with the first one, (see the link to the github issue in my first post, which describes it) and recommend the second one, which seems to be able to deal with the new authorization from Netatmo.

Some people in that thread said, that they had the same problem not until restarting Node-RED last week.
Glad, it (still) works for you.

@Falfango are you sure this works for you because if you check the issue list, it reports the same issue (i encounter the same issue too). It might depend on the endpoint request.

I converted now to the Netatmo node node-red-contrib-netatmo-dashboard (which is working in my and many other setups).
I only had to generate a refresh token in my account at https://dev.netatmo.com/apps/ and had to change some of the paths because of a different data structure in the msg object.

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.

1 Like

Hi,

it works very well with the node-red-contrib-netatmo-dashboard. But there is no Node which ist working with Home Coach.

does anybody have an idea?

Have a look here

@juntiedt: Meanwhile you can get the refresh token directly from https://dev.netatmo.com/apps after choosing the desired scopes and "Generate Token".

I have three Home Coach running. But I use node-red-contrib-netatmo v0.3.0 to get the data.

Hi Juntiedt,

do you have a sample with postman and Netatmo Token verification?

Thx

Yes it was working very well, but after poweroff for 2h. there was a veryfication error.

you have to create a new http request and then fill the authorization page

like on this picture

Hi,

now i could configure the postman, but how i have to integrate this in the Node Red Postman?

In postman it works very well...

Thx

hi,

i have problem to find the right config für this Node:
image

you need to install postman on your PC. Not a node-red-node.
now you have to get your client-id and client secret from the net-atmo web site.
In the postman application you have to start a new http request and there you have to put in your data from netatmo like I showed earlier in this threat.

Ok, i use for the Weather Station the " node-red-contrib-netatmo-dashboard", evething works very well.

Now i will get the datas from the Netatmo HomeCoach to the Node-red. So there is no Node in Node-red which get the informations from Home Coaches. In Postman.com i made a collection with everything and receive the datas. But now, i would like import this datas to node red for some automations.

So maybe my question is simple. How i can get all the Datas from Netatmo Homecoach into a Node in Node red?

please post your Home Coaches data. Is it in JSON form?

On Postman, i receive the follow datas:



{
    "body": {
        "devices": [
            {
                "_id": "xx:xx:xx:xx:xx",
                "station_name": "Weinkeller",
                "date_setup": 1535040585,
                "last_setup": 1535040585,
                "type": "NHC",
                "last_status_store": 1691058884,
                "module_name": "Indoor",
                "firmware": 59,
                "last_upgrade": 1535040606,
                "wifi_status": 51,
                "reachable": true,
                "co2_calibrating": false,
                "data_type": [
                    "Temperature",
                    "CO2",
                    "Humidity",
                    "Noise",
                    "Pressure",
                    "health_idx"
                ],
                "place": {
                    "altitude": 454,
                    "city": "XXXXX",
                    "country": "XXX",
                    "timezone": "Europe/Zurich",
                    "location": [
                        X.XXX,
                        X.XXX
                    ]
                },
                "dashboard_data": {
                    "time_utc": 1691058884,
                    "Temperature": 22.3,
                    "CO2": 464,
                    "Humidity": 60,
                    "Noise": 54,
                    "Pressure": 1011.5,
                    "AbsolutePressure": 958.3,
                    "health_idx": 0,
                    "min_temp": 22,
                    "max_temp": 22.4,
                    "date_max_temp": 1691013729,
                    "date_min_temp": 1691018273
                }
            }
        ],
        "user": {
            "mail": "X@X.X",
            "administrative": {
                "country": "DE",
                "feel_like_algo": 0,
                "lang": "de",
                "reg_locale": "de-CH",
                "unit": 0,
                "windunit": 0
            }
        }
    },
    "status": "ok",
    "time_exec": 0.037837982177734375,
    "time_server": 1691059121
[{"id":"63b9839fad27ad6a","type":"function","z":"68cb8365d480cc44","name":"function 40","func":"\nlet a ={\"body\": {\n        \"devices\": [\n            {\n                \"_id\": \"xx:xx:xx:xx:xx\",\n                \"station_name\": \"Weinkeller\",\n                \"date_setup\": 1535040585,\n                \"last_setup\": 1535040585,\n                \"type\": \"NHC\",\n                \"last_status_store\": 1691058884,\n                \"module_name\": \"Indoor\",\n                \"firmware\": 59,\n                \"last_upgrade\": 1535040606,\n                \"wifi_status\": 51,\n                \"reachable\": true,\n                \"co2_calibrating\": false,\n                \"data_type\": [\n                    \"Temperature\",\n                    \"CO2\",\n                    \"Humidity\",\n                    \"Noise\",\n                    \"Pressure\",\n                    \"health_idx\"\n                ],\n                \"place\": {\n                    \"altitude\": 454,\n                    \"city\": \"XXXXX\",\n                    \"country\": \"XXX\",\n                    \"timezone\": \"Europe/Zurich\",\n                    \"location\": [\n                        5.5,\n                        5.8\n                    ]\n                },\n                \"dashboard_data\": {\n                    \"time_utc\": 1691058884,\n                    \"Temperature\": 22.3,\n                    \"CO2\": 464,\n                    \"Humidity\": 60,\n                    \"Noise\": 54,\n                    \"Pressure\": 1011.5,\n                    \"AbsolutePressure\": 958.3,\n                    \"health_idx\": 0,\n                    \"min_temp\": 22,\n                    \"max_temp\": 22.4,\n                    \"date_max_temp\": 1691013729,\n                    \"date_min_temp\": 1691018273\n                }\n            }\n        ],\n            \"user\": {\n            \"mail\": \"ptrsteiner@gmail.com\",\n                \"administrative\": {\n                \"country\": \"DE\",\n                    \"feel_like_algo\": 0,\n                        \"lang\": \"de\",\n                            \"reg_locale\": \"de-CH\",\n                                \"unit\": 0,\n                                    \"windunit\": 0\n            }\n        }\n    },\n    \"status\": \"ok\",\n        \"time_exec\": 0.037837982177734375,\n            \"time_server\": 1691059121\n} \n\nmsg.payload = a;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":240,"wires":[["a2d03ec676bc8c11","5de969a3b00f4733"]]},{"id":"e900ddba14e8c1d9","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":240,"wires":[["63b9839fad27ad6a"]]},{"id":"a2d03ec676bc8c11","type":"debug","z":"68cb8365d480cc44","name":"debug 172","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":200,"wires":[]},{"id":"5de969a3b00f4733","type":"function","z":"68cb8365d480cc44","name":"function 41","func":"msg.payload = msg.payload.body.devices[0].station_name;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":300,"wires":[["3d79538b3871c2a7"]]},{"id":"3d79538b3871c2a7","type":"debug","z":"68cb8365d480cc44","name":"debug 173","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":300,"wires":[]}]

install it and you should understand how to extract data