Yes. I firstly convert the power reading (watts) into energy units (joules), then using context create a running total, which is set to zero at midnight.
It's easily done with node-red-contrib-watt2kwh
, but not hard to code in a function node.
I built a device probably 5 years ago, that uses Current Transformer clamps on the power feeds (non-invasive) to measure usage, solar generation, diversion & mains voltage.
The device uses a ATmega328p processor, runs constantly and feeds data to my Pi via RF.
I have created my dashboards in node-RED, and then imported the Grafana charts into it, so I never have to touch Grafana as all the queries are controlled from within node-RED. See Contextmenu location - #45 by Paul-Reed