You’ll find the download in Github. It’s NOT the “obvious” file that claims to be the “official latest”, but the Continuous Monitoring one further down the page: EmonTxV3CM.
The bits you’ll need to change are (possibly - depending on what you want to send) the definition of the data structure to transmit the data around line 70, and the place where that’s filled with the numbers around line 273.
I guess all you’ll probably want to do is something along the lines of
emontx.P1 = EmonLibCM_getRealPower(0) + EmonLibCM_getRealPower(1);
etc.
but if you want the powers etc for each leg separately as well, then you need to create (say) P12 inside that struct and then assign the sum to that.
Having done that, if you change the struct, then you must change the entry in emonhub.conf accordingly. If you don’t, it’s going to throw it out as corrupt data.
If you only use 1 c.t, then (assuming it’s channel 1 that you’re using and it’s Node 15), then the emonhub.conf entry becomes
[[15]]
nodename = emontx3cm15
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,2,1,1,1,2,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[Note the ‘2’ twice in scales = …]