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 = âŚ]