Counter Log - Help with kWh calculation

Avatar
  • updated

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

Avatar
Fabien Fuster

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...

Avatar
Ricardo Pinto

Interesting approach... So basically the calculation is done every second, and I need to care of the sum of the values.


Great, thanks for the tips. Will think about it over the weekend, I'll keep you posted.

Btw, I think the counter log should be doing this...


Avatar
Fabien Fuster

Just created a fake entry of constant 250 and run it through a calculation before logging... I'll keep you informed of the result.

In parallel I've made a second test logger with my real consumption entry though a similar calculation node....lets see.

Regards,

Avatar
Ricardo Pinto

Hi Fabien,

I decided to investigate some ways to do the calculation every second, and unfortunately the General timer doesn't have any seconds, just hour and minutes, so I'll have to work with something like Operating time or Timer to count the seconds.

Meanwhile, I've discovered a bug on those functions, 5 seconds missing in each minute.

Until then, there goes the precision calculation. I will try it anyway, to do an approximate calculation, but it will never be 100% accurate until the 5s missing per minute is fixed.

Best regards

Avatar
Fabien Fuster

Hi Ricardo,

Sorry for my late feedback, but I had an unplanned business trip..

My tests are also not fully satisfactory. The fake device is not recording anything at all, and I don't understand why. I'm sending this 250 value every second on the LAN, the calculation node seems to get it, but the log stay desperately empty....

Regarding the ream consumption node, I get my graph, but seems not to be correct. Either my theoretical solution doesn't work, or there is another issue I don't get with the log.

real and accurate consumption :

Associated energy consumption test log (to be compared to the blue line above) :

Not only the value has a "scaling" issue, but also the shape is wrong. So clearly, it need some more research...

Regards,

Avatar
Ricardo Pinto

Hi Fabien,

I've also faced problems with my tests, so I have no good results either.

I really don't understand the Counter Log. Wasn't it supposed to accept a simple kW value, log how much it consumed during one hour and spit it out?

Even the Analog Log looks like it gets the values better than the Counter Log. When I created a Counter Log to log the kW values, I also created an Analog Log with the same input, and even tough the Analog Log is not for this purpose, it actually looks better logging values.

So bOS team, please help us out here.

I have a kW value coming from KNX in real time (not kWh), I just want to use bOS to log the consumption. And so far, none of the options worked. The KNX module software sucks, so I just want to take my realtime kW value and calculate the consumption on bOS.

The Counter Log register values every hour, so if I give a kW value as an input, wasn't it suppose to log how much I consumed every hour? Do I need anything eles?

HELP please.

Best regards

Avatar
Fabien Fuster

Can only add the same request here .... after all these unsuccessful test, help wanted bOS team !

Best regards

Avatar
Maarten Van Parijs

I'm also interested in this, actually surprised the counter log does't work with kW and gives back kWh, seems a basic function to me in bOS.

Also as info, the formula to calculate Wh from Amps in the beginning of this thread is wrong, you need to take in account for the power factor (cos φ). Without it you are calculating VA (Volt-Amps), the energie company can't read this value with the standard power meters. Take it as free electricity.

https://en.wikipedia.org/wiki/Power_factor

V * Cos φ * A = W

Example: 230 * 0.8 * 2 = 368W

Without cos φ: 230 * 2 = 460VA

If you have a three phase + neutral installation you need to add Square root of 3, √(3) = 1.73

V * √(3) * Cos φ * A = W

Example: 230 * 1.73 * 0.8 * 2 = 636.64

Avatar

Hello everybody,

I see, that there is a bit of confusion about counter log and energy consumption.

First let me explain how Counter Log works...

Input value of the Counter log should always be consumption (e.g. electrical energy - kWh, gas, water - m3) and not power! 

When we first link the input value to Counter log, it remembers the value. Let's say that when we link our electrical energy meter to counter log it's current value is 100 kWh and counter logs starting value will be 100. However this value is not saved in database, because counter log stores only difference in values in interval of 1 hour so it will actually start with 0. 

Let say that in next hour our energy meter value will be 110 kWh, that means that consumption in that hour was 10 kWh and Counter log will save value 10 in the database. Then after another hour the energy meter value would be 115 kWh and counter log will add 5 to previous database entry and the new entry would be 15 and so on...


Example with power:

Lets say that we have a device that is measuring only active power P (W) and we would like to calculate energy consumption (kWh). 

In this case we first need to calculate energy consumption (kWh) from Power (W) and we can use Calculation task for that.

The formula for energy is E = cos Fi * P * t (let's say cos Fi = 1)


Basically energy is calculated as integration of power:

E(kWh) = Int(P)dt * 1/3600 / 1000

  1. Set Calculus to: Integral.
  2. set Constant Factor to: 1/3600 (Ws -> Wh)  / 1000 (Wh -> kWh) = 2,7778e-7.
  3. Add new operation and select Power as input value in W.
  4. Now you can use Value output in tasks (Counter Log) or make a Double user interface control for it. A Run Function control linked to the Reset function can be used to enable resetting of the counter value.

More examples can be found here:

https://www.comfortclick.com/BOS/KnowledgeBase/Calculation

https://www.comfortclick.com/BOS/KnowledgeBase/CounterLog

Regards

Avatar
Ricardo Pinto


Thanks Matias, for the extensive explanation, we were trying to find solutions, and honestly we were a bit confused about how the counter log works.

As for step 4, resetting the counter value, what's the use for? Is there any advantage in resetting the counter?

Best regards