There is another problem I can see.
Say you charge the car in the morning. Say from 06:00 to ..... 08:00.
You've used power.
You drive to work and then home.
Then put it on charge when you get home at.... 18:00.
Does this new charge cycle add to the morning's charge power used?
All good if that is how it works.
The only time my flow resets is at MIDNIGHT.
You can use that signal to then (after a short delay) send yesterday's values to somewhere.
And I haven't sent a 0 to wipe stuff. Sorry. But that would be done in this part of the node:
global.set("a",0);
global.set("b",0);
global.set("c",0);
return; // Exit with nothing.
You would construct a message to send a 0 in which ever part you need.
Sorry. I missed that when I wrote it. I am trying to keep it at/in the bigger picture and not micromanage how you do it.