jabesq-org / pyatmo

Simple API to access Netatmo weather station data from any python script (for Netatmo information, see www.netatmo.com)
MIT License
26 stars 28 forks source link

authentication #417

Open larszod opened 1 year ago

larszod commented 1 year ago

This is not an issue or bug, but a request for some instructions (sorry).

Maybe add some simple, basic example for connecting to netatmo on the home network inside firewall.

Something that I don't understand is the significance of "client_id" and "client_secret" and also the "redirect URL". Can you maybe shed some light on this?:

import pyatmo

USERNAME = "netatmo username" PASSWORD = "netatmo password" REDIRECT_URL = What is this?

authorization = pyatmo.ClientAuth( client_id=None, client_secret=None, username=USERNAME, password=PASSWORD, redirect_uri=REDIRECT_URL, scope="read_station", ) r = pyatmo.HomeData(authorization) r.update() r.process() print(r.homes) for home_id in r.homes.keys(): r = pyatmo.HomeStatus(authorization, home_id) r.update() r.process() print(r.rooms)

jabesq commented 1 year ago

This is used in netatmo authentication process to return the authentication code: https://dev.netatmo.com/apidocumentation/oauth

larszod commented 1 year ago

Forgot to write that I already had a look at https://dev.netatmo.com/apidocumentation/oauth

Netatmo also states on that webpage that the method "Client credentials grant type" in the script above is deprecated by October 2022.