Giter VIP home page Giter VIP logo

netatmo-influxdb's Introduction

  • 👋 Hi, I’m @turbosnute
  • 💞️ I’m looking to collaborate on stuff around Powershell, Docker, InfluxDB and PHP.
  • 📫 [email protected]
  • 🔵 Linkedin

netatmo-influxdb's People

Contributors

eirikaho avatar turbosnute avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

eirikaho dbsqp

netatmo-influxdb's Issues

Call API : HTTP Error 400

Hello,
I've got some troubles to have your image working on my Docker.
I successfully build the container in my Docker instance (on a Synology DS920+).
I've got a running influxDB (and Telegraf + Grafana + Chronograf) containers. I create a database on influxDB named netatmo.
When I run the netatmo-influxdb container, I've got this :

Thu Oct 29 18:11:33 UTC 2020
--- Start Call API
Traceback (most recent call last):
  File "netatmo2influxdb.py", line 35, in <module>
    authorization = lnetatmo.ClientAuth(clientId=netatmo_clientId,
  File "/lnetatmo.py", line 83, in __init__
    resp = postRequest(_AUTH_REQ, postParams)
  File "/lnetatmo.py", line 508, in postRequest
    resp = urllib.request.urlopen(req, params).read(body_size).decode("utf-8")
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400:
Exit status not 0
Sleep 120
Thu Oct 29 18:13:33 UTC 2020
Sleep 60

I tried to change the database user / password to those I defined to admin, but I still have this :

Thu Oct 29 18:19:37 UTC 2020,
--- Start Call API,
Traceback (most recent call last):,
  File "netatmo2influxdb.py", line 35, in <module>,
    authorization = lnetatmo.ClientAuth(clientId=netatmo_clientId,,
  File "/lnetatmo.py", line 83, in __init__,
    resp = postRequest(_AUTH_REQ, postParams),
  File "/lnetatmo.py", line 508, in postRequest,
    resp = urllib.request.urlopen(req, params).read(body_size).decode("utf-8"),
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen,
    return opener.open(url, data, timeout),
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open,
    response = meth(req, response),
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response,
    response = self.parent.error(,
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error,
    return self._call_chain(*args),
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain,
    result = func(*args),
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default,
    raise HTTPError(req.full_url, code, msg, hdrs, fp),
urllib.error.HTTPError: HTTP Error 400: ,
Exit status not 0,

0,

I see that Netatmo has changed their API to grab the data since the last time I worked on a different project using this API.
Maybe your app use an old API no more working...

Thanks for your help.

[Errno 111] Connection refused

Hello,
Thanks for your work!
I have recently decided to track temperatures coming from my weather station and keep datas locally :).
I have tested your docker image. Even if I have checked and confirm that my credentials are ok, logs always give me the error "[Errno 111] Connection refused". It seems that it manages to establish a first connection since it gets some datas from my weather station but then the connection is closed.
Any idea?
Thanks in advance for your help.

2021-09-01 14:02:02 | stdout | ConnectionRefusedError: [Errno 111] Connection refused
2021-09-01 14:02:02 | stdout | sock.connect(sa)
2021-09-01 14:02:02 | stdout | File "/usr/local/lib/python3.8/dist-packages/urllib3/util/connection.py", line 86, in create_connection
2021-09-01 14:02:02 | stdout | raise err
2021-09-01 14:02:02 | stdout | File "/usr/local/lib/python3.8/dist-packages/urllib3/util/connection.py", line 96, in create_connection
2021-09-01 14:02:02 | stdout | conn = connection.create_connection(
2021-09-01 14:02:02 | stdout | File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 169, in _new_conn
2021-09-01 14:02:02 | stdout | Traceback (most recent call last):
2021-09-01 14:02:02 | stdout | }
2021-09-01 14:02:02 | stdout | }
2021-09-01 14:02:02 | stdout | "value": 46
2021-09-01 14:02:02 | stdout | "fields": {
2021-09-01 14:02:02 | stdout | },
2021-09-01 14:02:02 | stdout | "hardware": "70:ee:50:32:ab:76"
2021-09-01 14:02:02 | stdout | "host": "Salon",
2021-09-01 14:02:02 | stdout | "source": "Netatmo",
2021-09-01 14:02:02 | stdout | "tags": {
2021-09-01 14:02:02 | stdout | "time": "2021-09-01T13:58:44Z",
2021-09-01 14:02:02 | stdout | "measurement": "Signal",
2021-09-01 14:02:02 | stdout | {
2021-09-01 14:02:02 | stdout | INFLUX: netatmo
2021-09-01 14:02:02 | stdout | Station: Appartement (Salon) - 70:ee:50:32:ab:76
2021-09-01 14:02:00 | stdout | --- Start Call API
2021-09-01 14:02:00 | stdout | Wed Sep  1 14:02:00 UTC 2021

urllib.error.HTTPError: HTTP Error 400: after Netatmo Authentication update

Hi, after the Netatmo authentication update I'm unable to get a successfull connection to Netatmo. I'll get "urllib.error.HTTPError: HTTP Error 400:"

Authentication update

Dear Netatmo developer,
As of today, when you refresh an Access Token using the associated endpoint https://api.netatmo.com/oauth2/token, Netatmo servers respond with a couple of tokens : an Access Token and a Refresh Token.If the previous Access Token is still valid, the newly returned access token is identical but its expiration time is extended for 3 hours.In any case, the refresh token is not renewed.

Starting from the 17/04/2023, this behavior will change to to be compliant with the recommendations of the RFC of the OAuth2 Authorization Framework (section 10.4) and improving the security of the data of our users.When refreshing tokens, Access Token and Refresh Token will be automatically renewed and former tokens invalidated.

What does it means for me ? If you were already updating the tokens provided when refreshing your tokens, this change will not impact you.If you do not update the refresh token when refreshing your Access Token, your users will be disconnected after 3 hours as the former tokens will become invalidated.To fix it, you need to update the tokens as soon as you get the newly generated ones.
Sincerely,Legrand - Netatmo - Bticino

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.