MySQL Forums
Forum List  »  Newbie

Re: Average 16 rows back?
Posted by: Ralph Höglund
Date: October 24, 2016 02:57AM

Thanks for reply Peter!
I'll try to explain more. From my kWh meter I catch pulses from a led,
1000 pulses every kWh. So during 5 minutes there comes between
150-200 pulses, sometimes up to 550.600 and down to 100.
I load from database the whole days data and present it on the
diagram. So x-scale is 5 minute ticks. So yes, it's the trend I'm
looking for.
Here you can see a picture of the diagram:
https://dl.dropboxusercontent.com/u/71076525/Sk%C3%A4rmklipp%202016-10-24%2010.39.23.png
So what I want is a smoother curve then the sawtooth shape.
This is my query in http://jpgraph.net/ php-program:

$watt = mysql_query(
"SELECT * FROM `digitemp`
WHERE `SerialNumber`
LIKE '105C0EE5000800B4'
AND time LIKE '$datenow'
ORDER BY time");

SerialNumber is from one of the temperature sensors,
so from $watt I extract all the data to the diagram.
Every five minutes I am getting four readings, one from
each temp. sensor and on each row the wh value, same
on each row. I thought it was easier that way instead
of a separate db-table.

Options: ReplyQuote


Subject
Written By
Posted
October 23, 2016 08:09AM
October 23, 2016 09:10AM
October 23, 2016 09:46AM
Re: Average 16 rows back?
October 24, 2016 02:57AM
October 24, 2016 10:30AM
October 25, 2016 02:30AM
October 25, 2016 06:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.