Flukso Power/Gas/Water meter

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Flukso Power/Gas/Water meter

Post by brononi »

Hey,

I've got a flukso sensor that tracks my power usuage, water and gas. Works great. The only down side is that the results are send to an internetserver. And of course, I would like to put it in my cacti setup. I'm wondering now what the best way will be to do this. I don't have snmp functionality on it. But with following command, I can read the realtime data:

[quote="curl -v "http://192.168.255.1:8080/sensor/c1411c ... k=realtime""]> GET /sensor/c1411c6b4f9910bbbab09f145f8533b9?version=1.0&interval=minute&unit=watt&callback=realtime HTTP/1.1
> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: 192.168.255.1:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: application/json
<
realtime([[1310047446,124],[1310047447,125],[1310047448,125],[1310047449,125],[1310047450,125],[1310047451,125],[1310047452,125], ..[1310047501,124],[1310047502,124],[1310047503,124],[1310047504,"nan"],[1310047505,"nan"]])
[/quote]

So for each sensor (in above example c1411c6b4f9910bbbab09f145f8533b9, I should have a graph...
Any suggestion how I should create graphs in cacti for this??
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Re: Flukso Power/Gas/Water meter

Post by brononi »

I've made a small script that cleans out all junk of the file.

Code: Select all

curl -v "http://192.168.255.1:8080/sensor/c1411c6b4f9910bbbab09f145f8533b9version=1.0&interval=minute&unit=watt&callback=realtime" > sensor1.data
sed -n '/</!p' sensor1.data | sed -n '/>/!p' | sed 's/\(.\{10\}\)//' | sed 's/.$//' | sed 's/\[/\m/g' | sed 's/\]/\m/g' | sed s/m,m/\ /g | sed 's/m//g' | sed 's/\"//g' | sed 's/,/:/g' > sensor1.clean
And this gives me following file
more sensor1.clean wrote: 1310047446:124 1310047447:125 1310047448:125 1310047449:125 1310047450:125 1310047451:125 1310047452:125 1310047501:124 1310047502:124 1310047503:124 1310047504:nan 1310047505:nan
So if I could put this sensor1.clean (unixtime and value) in a graph, it would be nice.

The only thing I'm worry about: will the graph be able to handle 'double' timings? since the unix time in the file comes from the buffers of the sensors. So cacti will read from time to time the same values....
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests