You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,11 @@ If you are using a single account with a single home and single weather station,
13
13
If you have multiple homes or were supplying a station name in some method calls, you will have to adapt your code :
14
14
- to supply a home name when looking for data for most class initializers
15
15
- to use the new station name set by Netatmo (which is not your previously set value)
16
+
17
+
18
+
>BREAKING CHANGE: Netatmo seems no longer (july 2023) to allow grant_type "password", even for an app credentials that belong to the same account than the home. They have added the capability of creating access_token/refresh_token couple from the dev page (the location where app are created). As a consequence, the username/password credentials can no longer be used and you must replace them with a new parameter REFRESH_TOKEN that you will get from the web interface. To get this token, you are required to specify the scope you want to allow to this token. Select all that apply for your library use.
16
19
17
-
>Note: Authentication tokens obtained using ClientAuth will always expires after 3 hours. If you are using long lasting sessions, you must renew this tokens by calling again ClientAuth periodically.
20
+
>SHORT VERSION TO UPGRADE: If you where using a netatmo_credentials file, juste remove USERNAME and PASSWORD fields and add a REFRESH_TOKEN field which value is the one you will obtain from the https://dev.netatmo.com in MyApps selecting you app and using "Token Generator" after selecting required scopes.
Copy file name to clipboardExpand all lines: usage.md
+10-22Lines changed: 10 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,15 @@ Python Netatmo API programmers guide
13
13
14
14
>2020-12-07, Breaking changes due to removal of direct access to devices, "home" being now required (Netatmo redesign)
15
15
16
+
>2023-07-12, Breaking changes due to deprecation of grant_type "password" for ALL apps
17
+
16
18
No additional library other than standard Python library is required.
17
19
18
20
Both Python V2.7x and V3.x.x are supported without change.
19
21
20
22
More information about the Netatmo REST API can be obtained from http://dev.netatmo.com/doc/
21
23
22
-
This package support only user based authentication.
24
+
This package support only preauthenticated scoped tokens created along apps.
23
25
24
26
25
27
@@ -32,6 +34,7 @@ Before being able to use the module you will need :
32
34
33
35
* A Netatmo user account having access to, at least, one station
34
36
* An application registered from the user account (see http://dev.netatmo.com/dev/createapp) to obtain application credentials.
37
+
* Create a couple access_token/refresh_token at the same time with your required scope (depending of your intents on library use)
35
38
36
39
In the netatmo philosophy, both the application itself and the user have to be registered thus have authentication credentials to be able to access any station. Registration is free for both.
37
40
@@ -52,24 +55,19 @@ Authentication data can be supplied with 4 different methods (each method overri
52
55
{
53
56
"CLIENT_ID" : "`xxx",
54
57
"CLIENT_SECRET" : "xxx",
55
-
"USERNAME" : "xxx",
56
-
"PASSWORD" : "xxx"
58
+
"REFRESH_TOKEN" : "xxx"
57
59
}
58
60
$
59
61
60
62
3. Some or all values can be overriden by environment variables. This is the easiest method if your are packaging your application with Docker. It also allow you to do some testing with other accounts without touching your current ~/.netatmo.credentials file
61
63
62
-
$ export USERNAME=newUsername
63
-
$ export PASSWORD=password
64
+
$ export REFRESH_TOKEN="yyy"
64
65
$ python3 MyCodeUsingLnetatmo.py
65
66
...
66
67
67
-
**Note to windows users:**
68
-
> If you are running on Windows platform, take care to the **USERNAME** environment variable that is automatically set with the windows login user name. This is likely to conflict with the user name you are using for your Netatmo account and will result in an unexpected authentication failure. In such case, take care to "unset" the default **USERNAME** env variable before running your code (or set it with your actual Netatmo account ID).
69
-
70
68
4. Some or all values can be overriden by explicit call to initializer of ClientAuth class
71
69
72
-
# Example: USERNAME and PASSWORD supposed to be defined by one of the previous methods
70
+
# Example: REFRESH_TOKEN supposed to be defined by one of the previous methods
0 commit comments