Netatmo Themostat API access - help with API authorization needed

Can anybody please give me a very short noob explanation on how to authenticate to be able to use the Netatmo APIs?

https://dev.netatmo.com/en-US/resources/technical/reference/energy/setroomthermpoint

I’m sure it’s me but unable to do this :frowning:

Thanks!

after registering/logging in, press on the ‘create your app’ link at the top.

Create an app, fill out all the info.
Shouldn’t need a redirect of webhook uri/url.

Make sure it’s activated, and nab the client id/secret.

Thanks for the info! I did as advised.
Now I can call the APi but it’s still complaining about: Access token is missing
How do I actually perform the authentication via API? I’ve tried different options but no luck.

Thanks again!

it uses OAuth, so you’ll need to get an access token to pass before you can call the api if you’re trying to build something yourself. There is already a thermostat component for netatmo, but I’ve used the API through node-red also.

Depending on the grant type, you need to pass headers like

msg.headers = {};
msg.headers["content-type"]="application/x-www-form-urlencoded";


msg.payload="grant_type=password";
msg.payload+="&username=USER"
msg.payload+="&password=PASS"
msg.payload+="&client_id=CLIENTID"
msg.payload+="&client_secret=SECRET";
msg.payload+="&scope=read_thermostat write_thermostat";

then make a POST to:
https://api.netatmo.net/oauth2/token

This will then return you an access token, refresh token, and expiry time.
See netatmo’s example here:
https://dev.netatmo.com/resources/technical/samplessdks/codesamples#clientcredentials

Of course, if you use the netatmo component in HA this is all handled for you

netatmo:
  api_key: CLIENT ID
  secret_key: CLIENT SECRET
  username: USER
  password: PASS
  discovery: false

climate:
  - platform: netatmo