NightMan-1 / netatmo-munin-go

Display NetAtmo data at Munin graphs
MIT License
2 stars 0 forks source link

Feature Request #1

Closed Shizzlebix closed 6 years ago

Shizzlebix commented 7 years ago

Hello,

first THANK you for this plugin.

Now i have a question. So i have 2 more sensors in house and outdoor a wind and a rain sensor. Is there a way to build this also in this great tool, so i can draw it with munin?

NightMan-1 commented 7 years ago

Hello! New version ready :)

2.3 (October 28, 2017)

Warning! Configuration format changed!

Shizzlebix commented 7 years ago

thank you....


./install.sh
compilling...# command-line-arguments
./netatmo-munin-plugin.go:102: module.Info undefined (type *netatmo.Device has n                                             o field or method Info)
ok

it this ok?

Shizzlebix commented 7 years ago

btw i dont see any infos about battery or something in cgf i set it to true

NightMan-1 commented 7 years ago

make go get -u github.com/exzz/netatmo-api-go ... you use old API version...

Shizzlebix commented 7 years ago

OK thanks that did it. Now compiling works without error.

BUT :(

/usr/share/munin/plugins/netatmo-munin-plugin oauth2: cannot fetch token: 400 Bad Request Response: {"error":"invalid_client"}

i have look into netatmo.cfg ... alll is set right as i see

NightMan-1 commented 7 years ago

add quotes to configuration file

ClientID = "ClientID"
ClientSecret = "ClientSecret"
Username = "Username"
Password = "Password"
Shizzlebix commented 7 years ago

i had this :(

go https://dev.netatmo.com

ClientID = "xxxxxxxxxxxxxx"
ClientSecret = "xxxxxxxxxxxxxxxxxxx"
Username = "xxxxxxxxx"
Password = "xxxxxxxxx"

[sensors]
CO2 = true
Noise = true
Pressure = true
Humidity = true
Temperature = true
WindStrength = true
Rain = true
WindAngle = true
BatteryPercent = true
RFStatus = true
WifiStatus = true
NightMan-1 commented 7 years ago

do you change "ClientID" to your real ClientID? .... netatmo-munin-plugin app look for configuration file (netatmo.cfg) in current folder and, then, in /etc/munin folder...

Shizzlebix commented 7 years ago

i copy the netatmo.cfg to /etc/munin/netatmo.cfg then i change all data in "" to mine and set all sensors to true

NightMan-1 commented 7 years ago

uploaded new app with better error info

Shizzlebix commented 7 years ago

Do not forget change example configuration settings :)

Why? it is my config copied and changed

ahh i see the problem

i had moved NOW your netatmo.cfg mv /netatmo-munin-go/netatmo.cfg /netatmo-munin-go/netatmo.weg

and now it work!!!

NightMan-1 commented 7 years ago

ok :)

Shizzlebix commented 7 years ago

But i don´t understand... why it check your netatmo.cfg and not the /etc/munin/netatmo.cfg?

NightMan-1 commented 7 years ago

i use netatmo.cfg in current folder for debug ...

Shizzlebix commented 7 years ago

a i see but this data i never filled up because your script copy this data to /etc/munin/ and open nano to change it .... :)

actual i see rain daily "nan" rain hourly "0.00"

NightMan-1 commented 7 years ago

https://www.dropbox.com/s/looxowb37isbsdt/netatmo_rain-pinpoint%3D1509105383%2C1509213383.png?dl=0

Shizzlebix commented 7 years ago

http://pd-network.de/here.jpg

Shell: multigraph netatmo_rain rain_daily_0.value 0.202 rain_hourly_0.value 0

I think i forgott to restart munin-node :(

NightMan-1 commented 7 years ago

"nan" at graph is "no data" ... yet ... try wait 5-10 min...

Shizzlebix commented 7 years ago

hmm all data are right there just rain not work :( can .... i will restart my raspberry

NightMan-1 commented 7 years ago

hm ... how about add some sensors (temperature and etc) directly to raspberry and display data in munin? :)

Shizzlebix commented 7 years ago

You mean sensors directly at the raspi? there is one :) is look for temp and humidity but my raspi is not here :)

So now i had delete all monitoring files from munin with name like rain....

again: daily: nan hourly: 0.00

NightMan-1 commented 7 years ago

eh ... not have time for my sensors :( ... want make my own gui for munin at golang ... just for fun :)

Shizzlebix commented 7 years ago

for this sensor i use a plugin named dht22

btw my munin say now rain daily nan hourly 0

shell: multigraph netatmo_rain
rain_daily_0.value 0.303
rain_hourly_0.value 0.101

because it is rain here

All data are nice but rain not :(

2017/10/28 20:00:13 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:05:14 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:20:19 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:35:22 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:40:25 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:50:21 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 20:55:25 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 21:05:28 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 21:15:26 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.101'
2017/10/28 21:15:26 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.303'
2017/10/28 21:25:25 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.101'
2017/10/28 21:25:25 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.303'
2017/10/28 21:30:21 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.101'
2017/10/28 21:30:21 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.303'
2017/10/28 21:40:21 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.303'
2017/10/28 21:40:21 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.101'
2017/10/28 21:50:11 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.404'
2017/10/28 21:50:11 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.202'
2017/10/28 21:55:10 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_daily_0-c.rrd: not a simple unsigned integer: '0.505'
2017/10/28 21:55:10 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.303
Shizzlebix commented 7 years ago

BTW:

// Rain : Last rain measured (in mm)
// Rain1Hour : Amount of rain in last hour
// Rain1Day : Amount of rain today

I have test.... // fmt.Printf("raindaily%v.type COUNTER\n", key) // fmt.Printf("rainhourly%v.type COUNTER\n", key)

now it shows data and draw graphs.

http://munin-monitoring.org/ticket/1193

NightMan-1 commented 7 years ago

2017/10/28 21:55:10 [ERROR] In RRD: Error updating /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: /var/lib/munin/monitor/monitor-netatmo_rain-rain_hourly_0-c.rrd: not a simple unsigned integer: '0.303

It's bug in rrdtool, you probably have very old version, all work fine for me ...

http://munin-monitoring.org/ticket/1193 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543631

ps "// Rain : Last rain measured (in mm)" - will test this soon ...

Shizzlebix commented 7 years ago

old version of rrd? rrdtool 1.6.0-1+b1

this is the actaly version with debian 9

NightMan-1 commented 7 years ago

see url ... can not help with this right now :(

Shizzlebix commented 7 years ago

i know :( what version u have?

at the link (from 2012) it say

  | Version: | 1.4.6

without counter all is fine... hmmm

NightMan-1 commented 7 years ago

RRDtool 1.6.0 Copyright by Tobias Oetiker tobi@oetiker.ch Compiled 2016-04-25 07:23:34

debian 9.x

NightMan-1 commented 7 years ago

go to sleep, continue tomorrow :)

Shizzlebix commented 7 years ago

i wish you good night, i am on work to 6 o clock.

so your rrd is the same as mine :)

i comment out the three counter lines..... it shows and draw all fine...

what do this counter flags?

NightMan-1 commented 6 years ago

Hello Shizzlebix!

I'm testing new graphic for rain, what do you think?

https://www.dropbox.com/s/gr44yd88y7na0z6/netatmo_rain-pinpoint%3D1510314961%2C1510422961.png?dl=0

Shizzlebix commented 6 years ago

Hey,

very nice. But can you tell me what the counterlines do? because sind a had comment it out all works. so what do this lines?

NightMan-1 commented 6 years ago

Hi! We have 3 counters, first ("last rain measured") - its current rain amount, its work only when rain do right now. Second ("hourly") - you can have 1-2-10 rain at hour and this counter summary all in one, "daily" - something like "hourly" ... not sure, that all counters really usable ...

NightMan-1 commented 6 years ago

Hew app uploaded, for update: 1) compile and install plugin 2) run "su - munin --shell=/bin/bash -c /usr/share/munin/munin-update" for update munin global config 3) delete old munin rain data (3 file) 3) run "su - munin --shell=/bin/bash -c /usr/share/munin/munin-update" again for creating data files ... 4) wait for rain :)

Shizzlebix commented 6 years ago

2) su - munin --shell=/bin/bash -c /usr/share/munin/munin-update [FATAL ERROR] Lock already exists: /var/run/munin/munin-update.lock. Dying. at /usr/share/perl5/Munin/Master/Update.pm line 128.

3) this one? netatmo_rain-day.png netatmo_rain.html netatmo_rain-month.png netatmo_rain-week.png netatmo_rain-year.png

NightMan-1 commented 6 years ago

2 - munin already running, try again in one min 3 - no, rrd files in /var/lib/munin ....

Shizzlebix commented 6 years ago

monitor-netatmo_munin_rain_sh-rain_day-g.rrd monitor-netatmo_munin_rain_sh-rain_hour-g.rrd monitor-netatmo_munin_rain_sh-rain_rain-g.rrd monitor-netatmo_rain_daily-rain_daily_0-g.rrd monitor-netatmo_rain-rain_0-g.rrd monitor-netatmo_rain-rain_daily_0-c.rrd monitor-netatmo_rain-rain_daily_0-g.rrd monitor-netatmo_rain-rain_hourly_0-c.rrd monitor-netatmo_rain-rain_hourly_0-g.rrd monitor-netatmo_rain-rain_rain_0-d.rrd monitor-netatmo_rain-rain_rain_0-g.rrd

a i see now it work an no more errors 💃

NightMan-1 commented 6 years ago

yes

NightMan-1 commented 6 years ago

yes