How do I disable auto-reverse?

How do I disable the auto-reverse function for CTs? - I only want to measure current moving in one direction and get zero when it is moving in the reverse direction.


I have 3 phase incoming and 3 phase solar.

I would like to be able to calculate:

  • Consumption
  • Export
  • Import

I have two CT’s on each incoming phase and one CT on each solar phase. If my arithmetic/algorithm is right then.

  • Export = what is measured in the outbound direction on the main incoming cables on each phase (just add up the phases to get the total)
  • Import = What is measured in the inbound direction on each phase (we often are exporting on two phases and importing on one as the washing machine, well pump etc. operate)
  • Consumption = generated + import - export

For the import CT I have ‘allow negative power value’ unchecked and ‘reverse’ unchecked. When we are exporting on that phase IoTaWatt shows the ‘reverse current arrow ring’ icon and gives a positive reading. I would like/expect the import CT to say zero when we are exporting.

Is there a config setting somewhere that forces reverse current to record zero?

Take a look at this Tracking separate solar Feed In Tariff and get back if it doe#nt answer your question.

Thank you @overeasy for the pointer, I had found that thread but couldn’t get my head around the algorithm - it helps to realise that rather than reporting zero when exporting, the CT ‘flips’ and gives a positive reading when the current changes direction.

That thread (to save others having to go there) suggests having two CT on the main cable, one set to allow negative readings, the other set to only allow positive readings.

  • CT ‘A’ - is set to allow negative. So when importing electricity it is positive, when exporting it is negative.
  • CT ‘B’ - is positive only. So when importing electricity it reads the same as ‘A’, but when exporting electricity the reading is ‘flipped’ and reports the same number as ‘A’ but positive rather than negative.

The algorithm given in the linked thread is:

Import - export + import + export = 2 x import.
2 x import divided by 2 = import.

For the benefit of others here are a couple of worked examples.

Scenario 1 = Consuming more electricity than is generated (IMporting electricity)

  • A reads 200 Watt.
  • B reads 200 Watt
  • (200 + 200)/2 = 400 / 2 = 200
  • This matches the imported only reading :slight_smile:

Scenario 2 = Generating more electricity than is consumed (EXporting electricity)

  • A reads negative 400 Watt (exporting),
  • B reads positive 400 Watt (result has been flipped because of the positive only setting on the CT)
  • ( -400 + 400 ) / 2 = Zero / 2 = Zero
  • We are exporting so Zero is what we should have as the imported figure. :+1:

In reality there are a few watts difference between the two CTs. Calibration might reduce the gap but in my case, good enough is good enough, a few watts isn’t important.

It would be helpful if, in a future software version, the CT setup could have an option to ‘Report Zero if negative’ similar to the ‘allow negative’ setting. In the meantime this is a viable workaround to get a reasonably accurate ‘Imported’ figure - similar maths will allow consumption to be calculated and with the generation CTs the amount exported.

The earlier discussion on that thread talks about how 5 second (or 10 for that matter) resolution reporting to influx or Emoncms can sort out the import and export information.

The Only reason I can’t do more to resolve this in the firmware is that the structure of the datalog doesn’t leave me anyplace to actually save the results. So using a second channel effectively solves that because it has a place to store the results from that extra channel. I’m ruminating about allowing configuration the second input but having it use the same CT. That is actually possible right now with some deep under the hood config parameters, but I’d rather not publish that detail level in the event it causes more problems than it solves.

If I offered the ability to specify a different physical input for any given logical input, that would eliminate any calibration differences and help the two to be the same. It might also make sense, if two logical inputs are sharing the same physical input, to have one record import and the other export.

As with all such changes, I have to consider how it complicates the user interface and how to minimize how much these options intimidate users who don’t understand or need them. Even PVoutput users, with 5 minute live resolution, seem to be OK with the import/export that they get from there.

I was overcomplicating things.

I can get what I want (I think) using a single CT on each incoming phase using the Min and Max functions - also eliminating minor calibration differences.

Incoming Phases are L1, L2, L3 (electricity company have labelled them that way so no ambiguity - I have called my principal CTs the same)

CT on each incoming phase is set to allow negative readings.

I know (thanks to IoTaWatt) that I can be exporting on some phases at the same time as importing on others.

Export = (L1 min 0) + (L2 min 0) + (L3 min 0)
Import = (L1 max 0) + (L2 max 0) + (L3 max 0)
Generation = L1_Solar + L2_Solar + L3_Solar

L1 min 0 effectively says that if I am importing and L1 is positive then report 0, if I am exporting and L1 is negative then report the negative number. If I wanted a positive number I could put the whole expression in brackets and add ABS to the end. ABS turns negative numbers positive but leaves positive numbers unchanged.

L1 max 0 is the opposite of min, if Positive give the number if negative report zero.

The expressions need to go into the feed to EmonCMS as well as an output for the status monitor.