The figure below shows a graph of four items, where the red line is the sum of three of the others. In fact, the blue line is the output of my solar panels, the yellow line is electricity demand from the grid, the orange is electricity supplied back to the grid. The red line (calculated) indicates the total power consumption of our house.
I have the following rule to calculate the red line:
energy = (SMA_TotalPac.state as Number) + (MEMAP.state as Number * 1000) - (MEMPP.state as Number * 1000) TOTPowerUse.postUpdate( energy )
The problem arises with the “postUpdate”, as the calculated TOTPowerUse appears 1 minute after it was posted (sample frequency of the rule trigger). You can see the delay in the red line.
Is there a way to fix this problem? Eg, update TOTPowerUse now, rather than post an update?