Calculating with emoncms

hoi,

i like to have this example (cant find the calculation)

so , i have readouts of bmv700 in seconds
but this value resets everytime the battery is full loaded.
but i like to store the value even when it is resetted and starts over with counting.

bmv value seconds = 700
resets when my battery is full BUT
old bmv value = bmv value seconds
realsecondsfull value = bmv value seconds + old bmv value
( counting ) + 700
the only time my realsecondsfull value can reset is when the grid value >=1

is there a way to make this?
i think i have to make something in my gridfeed and if >=1
skip next thing…but i really doesnt understand it…i dont find a way to calculate it…

OR is there a way to count ( in days ) the gridwatts when they stay 0 and reset when its >1?

thanks kristof