Reading realtime data: Water consumption

Hi all,

I'm currently writing my own solution to get the data in a monitoring system. (more on this later)
I'm doing this by populating a mysql dbase with the data and then go from there.

The one thing I still didn't figure out yet is how to correctly retrieve the water data.
I'm using the solution of peterj: https://docs.google.com/file/d/13wB85cPx_5nykBq3ZShnClHa1rpkRE5edNEluMqx...
but this doesn't have the water option I'm afraid.
in the manual I've found:
icarus75@cirrus:~$ curl -v "http://192.168.255.1:8080/sensor/
c1411c6b4f9910bbbab09f145f8533b9?version=1.0&interval=minute&
unit=watt&callback=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

But this clearly is just for watt => electricity

Things I already did:
1. modified the script to install the dbase to use a separate column
2. declared the new sensor in the install.php

The one thing I can't figure out is what format I need to use. I get readings of 9 up until 14000 when I just do a small test with a bucket of water.

Any pointers would be greatly appreciated.

adamcowin's picture

Whilst I dont have any helpful answers for you, i'm interested in getting a similar outcome as you. Will keep watching this thread and will post any helpful info I find

Cheers
Adam

dieterwijckmans's picture

Thanks Gebhardm.

I'm just so close in figuring this out and also made an interface based on this route. The only thing I can't figure out is how to get the water data in correctly.
So if someone could point me in that direction it would be greatly appreciated.

dieterwijckmans's picture

Ok so I have the unit lperday.

I'll go from there and see what I can do. I'll probably have to recalculate this to get the actual liter consumption from the last minute.

I know 1 pulse is 0,5 so I'll probably have to get a formula in place to get this going.

I'll check out the MQTT process as well! Thanks Gebhardm for the support!

gebhardm's picture

You are welcome - actually it is also described in the manual https://www.flukso.net/files/flm02/manual.pdf - see the table just below the chapter 3.6 headline; the row "query params" would have told also what valid values are ;-)

dieterwijckmans's picture

wow cooli! How could I have missed this :)

If I've made the writeup I'll link to my blog on the forum.

adamcowin's picture

Would love to see how you've done this and what you're using to do this too - including what kind of monitoring system you're using?

Good luck and hope you get it working - please do put up a link to your blog

Cheers
Adam

dieterwijckmans's picture

hmmm I've located the l/minute but still no luck.
I think there's a calculation needed to get it graphed in liter.

Can anyone give me pointers on the calculations behind the "liters" graph?

gebhardm's picture

To reach [l] from [l/min] you have to integrate over time; this is easiest approximated with the trapezoidal rule: (value_at_time1 + value_at_time2) * (time2 - time1) / 2 with time2 > time1; in units [l/min] * [min] = [l]; be sure to have the right time unit when multiplying, for example [min] = 60 * [sec]
See http://en.wikipedia.org/wiki/Trapezoidal_rule - Numerics, first semester ;-)

dieterwijckmans's picture

Wow thanks for the explanation of the formula.
I'll see whether I can get it in PowerShell :)

Never had numerics so it will be a challenge :)

bertc's picture

Hi Dieter,
I see that you mention powershell. I'm in the middle of writing a powershell script to fetch the data available through the API and convert it to CSV file (or database).

Is this something where we maybe can work together? what exactly is your goal?

dieterwijckmans's picture

Hi BertC

I indeed did what you are trying to do.
Although my setup is a little bit different.
I'm using a php class + script to get the data from the flukso and get it in a mysql dbase on a synology NAS.
The powershell script will read out the data out of the dbase and pass it on to my monitoring system.

I'm currently writing up the setup and posting it on my blog in a couple of days: http://scug.be/dieter

Feel free to use the script I post there as a base to get your script running. If you want to use just a powershell script you need to invoke the API.
More info can be found here: http://stackoverflow.com/questions/3574723/call-rest-api-from-powershell...