florianbeer / grafana-netatmo Goto Github PK
View Code? Open in Web Editor NEWNetatmo Weather Station dashboard for Grafana
Netatmo Weather Station dashboard for Grafana
Are there any plans to support rain and wind gauge?
After the last upgrade of lnetatmo package, it seems that there is no way to get the info for the weather station anymore. I do not know which change broke the authentication:
Traceback (most recent call last):
File "/usr/local/bin/netatmo_influx.py", line 31, in <module>
station_name = station['station_name']
TypeError: 'NoneType' object is not subscriptable
Method lastData no longer accepts argument station starting lnetatmo version 2 see the release
Traceback (most recent call last):
File "./netatmotest.py", line 36, in <module>
for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items():
TypeError: lastData() got an unexpected keyword argument 'station'
Error received:
vt100@grafana:/usr/local/bin$ ./netatmo_influx.py
Traceback (most recent call last):
File "/usr/local/bin/./netatmo_influx.py", line 36, in <module>
for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items():
TypeError: lastData() got an unexpected keyword argument 'station'
Station name at this time was "Außendienst". I renamed it, error went away.
Python 3.9.2 on Debian 11.3
Hi Florian,
thanks for updating the script as the old authentification stopped working just a few days ago. However I get the following errormessage and do not know what to do next...
Just out of a curiosity: The new script implements the refresh token, but doesnt the access token needs to be used aswell?
Using Grafana 7.0.6, the station name doesn't appear centered (as it is in your screenshot). I tried tinkering around myself but couldn't get it to work. I'm not sure if this is an issue with the panel or possibly something in this version of Grafana.
Obviously this is a purely cosmetic issue. In the attached screenshot I've turned transparency off to highlight the size of the panel.
(I've also converted to US units for us heathens that still don't use metric)
Yesterday the old authentication procedure stopped working, so I had to update to the latest version of lnetatmo
, however this version has a new definition for lastData
so the following no longer works:
for module, moduleData in weatherData.lastData(station=station, exclude=0).items():
The parameter station
no longer exists. It throws a type error:
Traceback (most recent call last):
File "./netatmo_influx.py", line 46, in <module>
for module, moduleData in weatherData.lastData(station=station, exclude=0).items():
TypeError: lastData() got an unexpected keyword argument 'station'
I got it back working by just dropping that station
agrument.
This was working until 5 day ago, now I get this error (nothing in my environment changed):
Traceback (most recent call last):
File "netatmo_influx.py", line 36, in
for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items():
AttributeError: 'NoneType' object has no attribute 'items'
I haven't touched a thing in months. All worked until mitnight last night, now here is what I get:
code=400, reason=, body=b'{"error":"invalid_grant"}'
Traceback (most recent call last):
File "/home/xxx/new_netatmo/./netatmo_influx.py", line 25, in <module>
weatherData = lnetatmo.WeatherStationData(authorization)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxx/new_netatmo/lnetatmo.py", line 282, in __init__
self.getAuthToken = authData.accessToken
^^^^^^^^^^^^^^^^^^^^
File "/home/xxx/new_netatmo/lnetatmo.py", line 181, in accessToken
if self.expiration < time.time() : self.renew_token()
^^^^^^^^^^^^^^^^^^
File "/home/xxx/new_netatmo/lnetatmo.py", line 192, in renew_token
if self.refreshToken != resp['refresh_token']:
~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Has anything changed on netatmos side?
Hi, trying to execute the script, I am facing this error:
Traceback (most recent call last):
File "netatmo_influx.py", line 39, in
for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items():
TypeError: lastData() got an unexpected keyword argument 'station'
Any idea, what causes this error message?
Thanks and Regards,
Torsten
Netatmo has apparently changed their API as explained here. This had the unfortunate side-effect of changing the station name. For example, if the name of the station was previously "David" the new station name looks like "David (Indoor Module)". As a result, there are now two different tags with one that has data up to the change and one has data after it. At first glance at least a temporary fix would be to change any query that includes
station =~/^$Station$/
to
station =~/^$Station$*/
adding the '*' on the end.
This is a workaround, since they say that station_name is deprecated in favor of home_name. The API documentation doesn't seem to spell this out but you can see the new (?) fields when playing with the API at https://dev.netatmo.com/apidocumentation/weather#getstationsdata
hi
I get this error message
Traceback (most recent call last):
File "netatmo_influx.py", line 33, in
for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items():
TypeError: lastData() got an unexpected keyword argument 'station'
I just upgraded the script to latest and provided all needed authentication information but when running script, I get the following error:
pi@raspberry:/usr/local/bin $ ./netatmo_influx.py
Traceback (most recent call last):
File "/usr/local/bin/./netatmo_influx.py", line 11, in
authorization = lnetatmo.ClientAuth(
TypeError: init() got an unexpected keyword argument 'refreshToken'
My python version is: 3.9.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.