Energy daily consumption

Hello, our energy meter is connected to our scada via opc kepserver. The KWh from meter is cumulative. Not instantaneous. We need instantaneous value to calculate daily consumption. We apply some code to get daily. The reset it from 00.00 start time. but exactly 18.08 its reseting. and again as the code it reset to 00.00. so we are getting reading for 18 hour. not for 24 hour. can somebody help us why its reset at 18.08. I shared the flow. thanks
flows (1).json (20.0 KB)
image

Add debug nodes and warn() statements to find out which bit of code is resetting it.
Set the debug nodes to output to the console so that they will appear in the node-red log, then you will be able to look back through the log and work out what has gone wrong.

What timezone are you in?
What OS/hardware are you running on?
How did you install node-red?

I have moved this to the General category as it is not about sharing a useful project.