On Sun, Sep 02, 2007 at 01:41:43PM +0100, Piers Kittel wrote: > Alex, > > On 2 Sep 2007, at 13:12, Alex van den Bogaerdt wrote: > > >The way you set it up means that the database stores ticks per second, > >not kWh or similar. > > Yes.
It's getting complicated, it's early and I'm still on my first cup of coffee. In other words: check my calculations and reasoning! 1 Wh is 1 W during 3600 seconds is 1 Joule per second during 3600 seconds is 3600 Joule. Each 800 ticks is 1 kWh so each tick is 1.25 Wh is 4500 Joule. Earlier I talked about watt per second but this is wrong. That was because you wrote kW instead of kWh. In your database you have 1/4500 Joule per second, aka 1/4500 W. If you want to see kWh you need to: - multiply by 4500 to get W - multiply by 3600 to get Wh - divide by 1000 to get kWh If you don't mind seeing mWh, kWh, hWh, MWh and such, you can skip dividing by 1000 and let GPRINT handle this: GPRINT:x:%6.2lf%sWh. If you don't use %s, you will see numbers like 0.000003 kWh: GPRINT:x:%0.6lfkWh. If you want to see W instead of Wh, don't multiply by 3600. Showing W may be a way to check your setup. Power up any device with a known power consumption (a vacuum cleaner, a microwave oven) and notice the graph go up by (e.g.) 650 W. At 650 W, you should see 1 tick every 4500/650=7(rounded) seconds. About your interface: instead of counting pulses and periodically calling RRDtool (e.g. every 5 minutes) it may be better to let those same pulses trigger an RRDtool update. This will improve accuracy dramatically or so I think. cheers, -- Alex van den Bogaerdt http://www.vandenbogaerdt.nl/rrdtool/ _______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
