4
4
# 2014-01 : philippelt@users.sourceforge.net
5
5
6
6
# Just connect to a Netatmo account, and print all last informations available for
7
- # station and modules of the user account
7
+ # station(s) and modules of the user account
8
8
# (except if module data is more than one hour old that usually means module lost
9
9
# wether out of radio range or battery exhausted thus information is no longer
10
10
# significant)
@@ -20,19 +20,24 @@ user = weather.user
20
20
print ("Station owner : " , user .mail )
21
21
print ("Data units : " , user .unit )
22
22
23
- print ()
23
+ # For each station in the account
24
+ for station in weather .stations :
24
25
25
- # For each available module in the returned data that should not be older than one hour (3600 s) from now
26
- for module , moduleData in weather .lastData (exclude = 3600 ).items () :
27
-
28
- # Name of the module (or station embedded module), the name you defined in the web netatmo account station management
29
- print (module )
30
-
31
- # List key/values pair of sensor information (eg Humidity, Temperature, etc...)
32
- for sensor , value in moduleData .items () :
33
- # To ease reading, print measurement event in readable text (hh:mm:ss)
34
- if sensor == "When" : value = time .strftime ("%H:%M:%S" ,time .localtime (value ))
35
- print ("%30s : %s" % (sensor , value ))
26
+ print ("\n STATION : %s\n " % weather .stations [station ]["station_name" ])
27
+
28
+ # For each available module in the returned data of the specified station
29
+ # that should not be older than one hour (3600 s) from now
30
+ for module , moduleData in weather .lastData (station = station , exclude = 3600 ).items () :
31
+
32
+ # Name of the module (or station embedded module)
33
+ # You setup this name in the web netatmo account station management
34
+ print (module )
35
+
36
+ # List key/values pair of sensor information (eg Humidity, Temperature, etc...)
37
+ for sensor , value in moduleData .items () :
38
+ # To ease reading, print measurement event in readable text (hh:mm:ss)
39
+ if sensor == "When" : value = time .strftime ("%H:%M:%S" ,time .localtime (value ))
40
+ print ("%30s : %s" % (sensor , value ))
36
41
37
42
38
43
# OUTPUT SAMPLE :
@@ -43,6 +48,8 @@ for module, moduleData in weather.lastData(exclude=3600).items() :
43
48
#Data units : metric
44
49
#
45
50
#
51
+ #STATION : TEST-STATION-1
52
+ #
46
53
#Office
47
54
# AbsolutePressure : 988.7
48
55
# CO2 : 726
0 commit comments