Calculate energy usage
Posted: Sun Apr 08, 2012 3:38 pm
I measure my energy usage using a wattson which is polled every 10 seconds using openwattson. Since openwattson cannot write to the database directly I use a txt file to gather the readings and parse that with a php script which is called every minute.
I want to store the readings in a mysql db per hour, but I'm unsure how to calculate the usage per hour. Do I just sum up the readings per 20 seconds?
Below is a sample of the readings:
I want to store the readings in a mysql db per hour, but I'm unsure how to calculate the usage per hour. Do I just sum up the readings per 20 seconds?
Below is a sample of the readings:
Code: Select all
20120408151506 2012-Apr-08 15:15:06 248
20120408151518 2012-Apr-08 15:15:18 226
20120408151527 2012-Apr-08 15:15:27 226
20120408151547 2012-Apr-08 15:15:47 228
20120408151608 2012-Apr-08 15:16:08 228
20120408151621 2012-Apr-08 15:16:21 234
20120408151628 2012-Apr-08 15:16:28 234
20120408151649 2012-Apr-08 15:16:49 226
20120408151709 2012-Apr-08 15:17:09 225
20120408151721 2012-Apr-08 15:17:21 232
20120408151730 2012-Apr-08 15:17:30 232