Code Monkey home page Code Monkey logo

docker-telegraf-netatmo's People

Contributors

benningm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-telegraf-netatmo's Issues

Error in plugin: (NoMethodError)

It seems like I am experiencing a similar error to that issue linked. Could you describe, how you could solved this problem, @jostrasser?

This is my error message:

E! Error in plugin [inputs.exec]: exec: exit status 1 for command '/usr/local/bin/netatmo': /usr/local/bin/netatmo:81:in `filter_data': private method `select' called for nil:NilClass (NoMethodError)...

Ruby 2.3.3 is installed.

Best,
AlfaJackal

Originally posted by @jostrasser in #2 (comment)

Netatmo API changes: new auth method - customization needed

Starting October, current way to connect to Netatmo server will be removed and a new one introduced. We will need to find an other way to connect and keep the script working.


To improve the security of our products, we inform you that the Client Credentials grant type method will be completely removed. It will no longer be possible to authenticate with the username and password of the user.

The effective date of this update is October 2022.

How can you authenticate with Netatmo API ?
From this date, the OAuth2 authorization code flow must be followed for authentication.

Source: mail information I received from Netatmo


Documentation from mail: https://dev.netatmo.com/apidocumentation/oauth#authorization-code

data no more imported in influxdb

Hi,

since yesterday no data will be imported into my influxdb. No idea if netatmo has changed anything on their end.
Last data at 4:45pm CET.

Any idea?

Thanks JO!

Editing telegraf.conf results in a crashing docker

Managed to start the docker via:

docker run \
  --name telegraf-netatmo \
  -e 'NETATMO_CLIENT_ID=xxx' \
  -e 'NETATMO_CLIENT_SECRET=xxx' \
  -e '[email protected]' \
  -e 'NETATMO_PASSWORD=1234' \
  -e 'NETATMO_DEVICE_ID=xx:xx:xx:xx:xx:xx' \
  --link influxdb \
  benningm/telegraf-netatmo:latest

Adding the volume mount results in a crash after booting the container -v /etc/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro \

I ssh'd into the docker file and edited /etc/telegraf/telegraf.conf with the correct ip and port - I left everything else commented out like it is:

[[outputs.influxdb]]
  urls = ["http://10.10.0.6:32784"]
  database = "telegraf"

Unfortunately it is still http://localhost:8086:
2020-01-13T21:45:40Z E! [outputs.influxdb]: when writing to [http://localhost:8086]: Post http://localhost:8086/write?db=telegraf: dial tcp 127.0.0.1:8086: getsockopt: connection refused

Also, using a telegraf.conf with only this content doesn't work - the container crashes:

[[outputs.influxdb]]
  urls = ["http://10.10.0.6:32784"]
  database = "telegraf"
  username = "telegraf"
  password = "telegraf"

[[inputs.exec]]
  commands = ["/usr/local/bin/netatmo"]
  interval = "10m"
  timeout = "15s"
  data_format = "json"
  name_suffix = "_netatmo"

What am I doing wrong? Any help is much appreciated!

Error in plugin [inputs.exec]: exec: exit status 1

Hi Markus,

First of all, thanks for the script / docker.

However, I have an issue making it run, here is the output of the docker-compose up command:

docker-compose up
Creating netatmo ... 
Creating netatmo ... done
Attaching to netatmo
netatmo    | 2018/02/26 11:08:03 I! Using config file: /etc/telegraf/telegraf.conf
netatmo    | 2018-02-26T11:08:04Z I! Starting Telegraf (version 1.3.5)
netatmo    | 2018-02-26T11:08:04Z I! Loaded outputs: influxdb
netatmo    | 2018-02-26T11:08:04Z I! Loaded inputs: inputs.exec
netatmo    | 2018-02-26T11:08:04Z I! Tags enabled: host=256a9033364d
netatmo    | 2018-02-26T11:08:04Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"256a9033364d", Flush Interval:10s 
netatmo    | 2018-02-26T11:08:10Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command '/usr/local/bin/netatmo'

and the output when running "manually", the script from within the container:

ruby ./netatmo 
 (RuntimeError) `refresh_token': login failed: <html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>
	from ./netatmo:18:in `initialize'
	from ./netatmo:114:in `new'
	from ./netatmo:114:in `<main>'

or

./netatmo 
./netatmo:31:in `refresh_token': login failed: {"error":"invalid_client"} (RuntimeError)
	from ./netatmo:18:in `initialize'
	from ./netatmo:114:in `new'
	from ./netatmo:114:in `<main>'

I am not sure why I get this error... I am already using the the same telegraf.conf on several servers and it works OK. I am pretty sure my credentials are all good. I triple checked them.

Telegraf conf:

 [[outputs.influxdb]]
   urls = ["http://xxxxx.yyyy.com:8086"] # required
   database = "telegraf" # required
   username = "telegraf"
   password = "xxxxxx"
 
 [[inputs.exec]]
   commands = ["/usr/local/bin/netatmo"]
   interval = "10m"
   timeout = "15s"
   data_format = "json"
   name_suffix = "_netatmo"
 

And finally docker-compose.yml file:

version: '2'
services:
    netatmo:
        container_name: netatmo
        image: benningm/telegraf-netatmo
        restart: unless-stopped
        volumes:
          - ./conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
        environment:
          - NETATMO_CLIENT_ID=
          - NETATMO_CLIENT_SECRET=
          - NETATMO_USERNAME=
          - NETATMO_PASSWORD=
          - NETATMO_DEVICE_ID=

Trying to change "urls" in the telegraf config with and without httpS didn't changed anything.

Thanks a lot for your help.

Rain values are not accurate enough

Hi @benningm

If I compare the values between the my.netatmo.com portal and my self hosted Grafana which is getting the data via the netatmo data porter script from my InfluxDB I can see that the data on Grafana does not match them on the official Netatmo App / Web Portal.

Example:
Daily Rain (sum today)
On Netatmo: 10.4 mm
On Grafana: 7.5 mm

rain_official

rain_grafana

Also the hourly data is not identical, that's the reason why the daily sum cannot be correct.

hourly_official

hourly_grafana

Any ideas?

Thanks JO!

error (NoMethodError)

Hi,

I think the script is broken since a few days:

./netatmo:81:in filter_data': private method select' called for nil:NilClass (NoMethodError)
from ./netatmo:75:in process_data' from ./netatmo:102:in measurements'
from ./netatmo:120:in `

'

Stopped working without any changes on the linux-side.

Any ideas?

Thanks JO

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.