[rrd-users] counting pellets with rrd

Simon Hobson linux at thehobsons.co.uk
Sat Dec 10 21:32:45 CET 2011


Matthias Lemke wrote:

>I connected my eta pellets heating unit via webservices to my home
>server. I am interesting in counting the amount of pellets per day (warm
>weather days should have low counts of pellets). The unit has a counter
>that counts from zero up forever... The unit sends the value in "kg".
>normally I have around 15...20 kg / day.
>I want to have a graph that shows me the kg/day. So I thought that I can
>write one data per day to the rrd. But, after two nights of testing and
>testing, I have no idea for the correct rrd setup...
>
>Do You have any hints for that challenge :) ?
>
>I want to have two RRAs:
>
>one vor 400 days, one data per day (kg/day).
>second one for kw/weeks for 500 weeks...

Firstly, remember that RRD stores <things> per second. No matter what 
you feed it, that's what it stores.
So lets say you feed it a value once per day, and the value is 15kg - 
then rrd will convert that to 15/86400 = 1.736e-4 (or 0.0001736) 
kg/s. Your options are really to multiply by 86400 before storing the 
value, or on extracting the data.

Another issue is that rrd works in UTC, so the "days" it will work 
with are not the same as your local days. You just need to be aware 
of that.

You will want a counter data type since you conveniently have a 
counter to feed it with.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list