The emonPi comprises two parts, a Raspberry Pi and a cut-down emonTx. The emonTx sends the data it collects to the RPi via a serial link.

The “emon” part runs a sketch that’s very similar to the Discrete Sample sketch for the emonTx, which uses emonLib to make the calculations. EmonLib calculates all the quantities you require except for phase angle and reactive power - but you do get apparent power, and you can derive phase angle from real and apparent power (but you cannot know whether it is leading or lagging).

In order to make these available, you need to download the firmware for the analogue part from emonpi/firmware/src at master · openenergymonitor/emonpi · GitHub, add the variables you need to the declaration of the data structure PayloadTX, then
assign values to the new variables like in line 286.
The names of all the quantities available are:

  realPower,
  apparentPower,
  powerFactor,
  Vrms,
  Irms;

You must then compile and load the new sketch. Instructions for that are here: EmonPi - OpenEnergyMonitor Wiki

Having done that, you must modify the entry in emonhub.conf to match the data that you are sending in PayloadTX. If you compare the existing PayloadTX and the section to decode it in the existing emonhub.conf, you’ll see what is required.

1 Like