Giter Club home page Giter Club logo

grafana-netatmo's People

Contributors

dkozinn avatar florianbeer avatar mnin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-netatmo's Issues

Unexpexted keyword error with refreshToken

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

Lnetatmo package broke netatmo_influx.py

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

philippelt/netatmo-api-python@v3.0.0...v3.2.0

OAuth2 Token stopped working at midnight 2023-12-04

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?

Error executing scfript

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'

Station name not centered

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.
2020-07-11_16-00-50

(I've also converted to US units for us heathens that still don't use metric)

Fetching data fails when having special characters in station names

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

Access Token/ Refresh Token // Script not working for me

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...
grafik

Just out of a curiosity: The new script implements the refresh token, but doesnt the access token needs to be used aswell?

TypeError: lastData() got an unexpected keyword argument 'station'

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

lastData() got an unexpected keyword argument 'station'

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'

Script fails with wrong argument keyword

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'

grafana-netatmo.py no longer works with updated lnetatmo module

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.

API change breaks station selection

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.