Counter Log - Help with kWh calculation
Hi people,
May I ask a little help about counter log?
I have a power sensor on an electric board. On ETS, I get an Instantaneous Power object (2 bytes), which comes in kW format. Like, if the house is consuming 1200W, I get 1,2 value on ETS, if it's consuming 250W, I get 0,25 value, and so on. I have the correct instant values showing on visualization.
I've tried to create counter logs, to get an approximate daily consumption, etc. The problem is that the values on the counter log don't make any sense.
For example, if the house is consuming constant 250W during 24hour, I should get 6 kWh by the end of the day, but the values don't make sense. On one day, it showed something like 138kWh on one day, which is impossible. I deleted all data now.
Either I'm configuring all wrong the counter log, or there's something I'm missing.
Thanks for any help


Well.... not sure at all my approach will be correct here, but lets start somewhere.
If you are able to get the power consumption in W per second, the the following calculation could match (if not mistaking):
We can suppose 1 Watt / 1 second = 0.001 KW / 1 second.
So for 1 Hrs we should have 0.001/3600 = 2,777777777777778e-7 KWh
Now if you multiply this value per the instant consumption value and sum it up you will get the correct value.
ie. 250W * 2,777777777777778e-7 * 3600 seconds * 24 Hrs = 6 kWh.
Now, my only doubt is how to force the counter log to do the calculation every seconds, but maybe you have the answer...