FYI, I have setup my development environment and I am getting my feet wet on lua development. Coming from a strongly typed language (C), it makes me feel insecure to dynamically define structures and arrays and trust the LUA interpreter to clean up after me, but I think I can get used to that.
So far, debugging has been fun and I have only scratched the surface with the following code
print(_G.dmDB_handler (“”, {id=“lr_dmDB”,device=“43”,name=“Watts”,format=“csv”,dt=“week”}, “”))
I changed the way csv works for me since I want to be able to import that directly into excel and have the dates formatted appropriately.
Next on my list is to understand how the graph is generated and possibly improve it. When I try to generate a certain graph, onle one scale is used (where dataMine defines 2). See how the graph looks like:
http://i.imgur.com/6a44Psj.png
By using a visualisation code like this:
var w = new google.visualization.ChartWrapper(
{
chartType:'LineChart',
options:{
height:600,
title:'Energie VS Temperature',
legend:'bottom',
vAxes :{
0: {format: '#'},
1 : {format: '#,###'}
},
series: {
0:{ type: "lineChart", targetAxisIndex: 0 },
1: { type: "lineChart", targetAxisIndex: 1}
}
},
containerId:'gVizDiv'
}
);
I can get a graph like this
http://i.imgur.com/7mFJK62.png
Also, I’ll try to to pull the raw data from defined graphics and export them in CSV… e.g. support a line similar to this:
http://192.168.10.199:3480/data_request?id=lr_dmDB&graph=2&interval=week&format=csv
This is to allow plotting multiple values in Excel with multiple Y axis scales (for example Watts in 1000s and outside temperature (10s of C)) and have a moving average of power over temperature.
For example the graph below is a starting point without temperature for now:
http://i.imgur.com/3SyPPyt.png (this is a URL, as I didn’t know how to embed the picture)
On a side note, I just found another plugin visualization that can be used with gViz and that natively does moving average to remove spikes…
http://dygraphs.com/tutorial.html