EmonPi + EmonTx - input calculations not in sync

Hi there,

I have an emonPi which logs import/export from the grid and solar generation (Type 2 installation as per the documentation).
I also have an emonTx which logs EV charging consumption and diversion to the hot water tank.

I am trying to configure multiple feeds that will allow me to monitor all this in a meaningful way:

  • Grid (balance) = power1
  • Solar (generation) = power2
  • Import = power1 if >= 0
  • Export = power1 when <= 0
  • Use (total consumption) = Grid + Solar
  • House (consumption) = Grid + Solar - EV - Diverter

It seems to all be working fine, apart from the fact that the emonTx and emonPi obviously don’t log at the exact same time. I therefore get some noise in the data with sudden drops for use and house when the EV or diverter start/stop working.
Any recommendation as to how to take the time delta into account?

Unfortunately I can’t put anything “hard-coded” in there as my emonTx stops working every few days, and therefore gets rebooted (through a node-red intervention), meaning the log time delta keeps changing…

There is no easy way to do it.

Many years ago, Martin R wrote a set of sketches for three emonTx V2s, which were stacked and communicated with each other serially, so that the master (one of the three) triggered readings at the same time as itself (Full-fat 3-phase monitor | Archived Forum) .

I think you would be looking to recreate an arrangement similar to that, but there are many practical difficulties to overcome if you have a modern emonPi and emonTx.