You are a bit mixed up there! Let me start with the c.t itself and work my way up the chain to the point where you have a meaningful number.

A current transformer does what it says on the label - it transforms a large current - 100 A is the number you mentioned - into a much smaller current, in the case of the one used with the emonTx V3, 50 mA. *[I’m an electrical engineer so I always use rms values unless I say differently.]* Inside the emonTx V3 is a “burden” resistor (‘burden’ because it’s a load the c.t. needs to work) and it’s that resistor which changes the current into a voltage. By changing the value of the burden, you can choose the voltage to suit the ADC you’re using. For the emonTx V3, that’s about 1.1 V; for the emonTx Shield, about 1.6 V.

In the case of the emonTx4, we use a c.t. which has the burden incorporated within it. We don’t know the current the c.t. outputs, and neither do we care because the values of the current and burden are chosen together by the manufacturer to give 0.333 V output for your 100 A mains current.

Inside the emonTx (every emonTx), the ADC samples the current and voltage around 20 times, usually more, per mains cycle. Those instantaneous samples are multiplied together to give the instantaneous power, these power values are added up and averaged over time to give the average power (the ‘real’ power) in watts. At the same time, individual voltage samples and current samples are squared and averaged to give the rms (**r**oot **m**ean **s**quare) average voltage and current.

There are of course scaling and calibration constants that turn the pure numbers out of the ADC into engineering values: volts, amps, watts & watt-hours.

So the answer to your problem is, the current is already available within the sketch running inside your emonTx4. The bad news is historically, it’s never been made available to the user by default.

Your two approaches are both correct. The first involves getting the source code for the sketch and changing it to send out the current as well as or instead of the power. The second is quite tricky, because no formula is involved *while it is measuring the voltage* - the power is derived from current and voltage for each and every sample - it knows nothing about power factor, and in fact it calculates the power factor from those three averages: power factor is **defined** as the average real power divided by the apparent power (the product of rms voltage and current).

If it doesn’t have the voltage to measure, emonLibCM is capable of running without, and in this case the sketch assumes a constant voltage and multiplies current by a number to give the apparent power, stated in watts but it’s really only a best guess and it’s in VA (volt-amperes). If you’re using the emonVs with your emonTx4, it’s almost certainly not doing this but giving you true real power in watts.

Incidentally, the ESP8266 takes no part in this, all it does is transmit the output by Wi-Fi.

Have you looked in ‘Learn’, because most of the above it written up in there?