3) A practical q:- given the way that the data rates reduce with additional sensor lines, what is the correct/best/most accurate way to calculate the power for a sensor from the live sensor readings. Is it still, as cc recommend, to multiply the sensor reading in xml by the interval in secs since last reading, bearing in mind that maybe readings are lost between clamp/transmitter (by collisions) and pc, or is it better add up the readings and to scale according to the average no of readings received in an hour somehow? Or what. [/quote]
Well this is the crux of it. Usability depends on the Mission. So if I want an estimate of Energy used each hour or 30 minutes, a single sample in each minute will probably suffice (This is what Techtonic Energy Station does). Assuming the samples are normally distributed a sample of 30 will give an approximation of the mean +/- 2SD ie about 99.5% confidence. (N.B. If you average the 6 second readings in each minute you can be certain that it is normally distributed).
On the other hand, if my mission is to identify appliances in use at any particular time I would need to pattern match the instantaneous power at a high frequency. so 6 second intervals is probably the outside of what is acceptable. (Doesn't negate the approach, but reduces confidence in result).
Wow! that was a bit esoteric wasn't it?
I didn't delete it cos I put a lot of thought into it
.
In practical terms the difference in the average value between your two approaches is marginal though the second approach is likely to have more variance.
In my home-brew system reading the inverter (CC not involved), i read the inverter each minute multiply the average reading before and after the interval by the interval length and sum over 10 minutes. I have special handling if I miss a reading on the minute boundary.
No not too esoteric at all imo - to quote the great man 'as simple as possible, but not simpler'. I'm always pleased to see someone quoting the 'central limit' theory - one of the most amazing theories in stats IMO.
My 'mission' in live_sol is to do the best estimate for a house with solar, of the power saved and 'wasted' (ie going back to grid at 0 credit) wrt the user, and to get the best estimate of the billable power each day.
The system is non linear because of the threshold effect ie if solar-house > 0 then some saving & waste else saving only, so I concluded that I need to do the calc in realtime every 6 (or so secs) to get best estimates and potentially just sampling might be a good deal less accurate imo. Of course there are still errors, only some of which cancel via averaging, eg the time is only to nearest sec, plus PF & clamp errors, potential data losses as above, and of course we are doing the difference of nos with errors hence some error magnification. Given all of this, and with testing I've done vs my meter (SteveH has also done these, and I hope to do them on your data too soon), I'm mostly getting the billable power estimate to within (+ or -) < 5kwh + about (+ or -) <5% in my house power of 15-20kwh per day, so not too bad, and better than is reported many others using other apps...but I'd like to improve it if possible, so all ideas welcome.
John