I hope you’ll be able to help me, because I’m completely confused about getting the right calculation.
I’d like to know the electricity power consumption of my equipment per day by mode. Okay, that sounds basic, but…
The context: Every 10 seconds, my equipment provides the cumulative energy counter info and the consumption mode. The consumption mode is a tag (see my extract file and the query below).
Because the mode can change multiple times during the day, I’m unable to use a simple difference calculation, and I don’t know how to build my query.
I need to calculate the consumption by mode period and cumulate the value per day (e.g., I’ve consumed X kW for COOL mode and Y kW for FAN_ONLY mode).
That’s something I don’t know how to do.
Thanks a lot for your support on it.
Franck
Basic Query to extract my data and to show the data structure
This will not work because I can get multiple periode mode in the same day, difference will provide wrong result.
I need to identify each mode periode and calculate difference for each mode periode but I do not know how to do it.
Of course as soon as periodes calculation are accomplished, need to do a sum by day
Hope my explanations are getting more good input to find the solution
Oops, sorry, I misunderstood the problem. If you have multiple modes running on the same day (e.g., switching from HEAT to COOL to OFF), calculating the difference on the cumulative value across different modes will give incorrect results.