Correct power calculation for both single and 3-phase

Thanks for the reply.

No, it was actually the second contactor I wanted to do. My Skoda can accept single / 3 phase changes while charging. I get the rapi confirmations, both in the GUI and via MQTT ok but nothing happens to the state of the relay output.

even changing;

uint8_t relay2Enable = 1; //default to both relays enabled

to

uint8_t relay2Enable = 0; //default to both relays disabled

didn’t turn it off.

I tried adapting energyMeter.ccp to

#ifdef THREEPHASE
      // Multiply calculation by 3 to get 3-phase energy.
      // Typically you'd multiply by sqrt(3), but because voltage is measured to
      // ground (230V) rather than between phases (400 V), 3 is the correct multiple.
      if (relay2Enable){mws *= 3;}
      else {mws *= 1;}      
#endif // THREEPHASE

but the reading in the GUI doesn't change.

I'm somewhat baffled.

I’ll take a look at the code again. I assume you replaced the contactor to 3 individual ones, and used /rewired the GPIO on the board to drive the 2/3rd phase contactors ? I’ll have to dig out my test board which is still running this code to see what I did to try to guide you in detail as it’s been a long time and I can’t remember how I did it. If I recall I took the GPIOs through a dual relay board to drive the contactors.

Thank you.

I’ve not actually got to the stage of adding contactors, just trying to get the code working. I still have the single 4 pole one as I’m using the charger. I have put an SSR on the 2nd DC relay output as that has an LED which lights when energised so I can see if the code works.

What I was thinking of doing was to leave the 4 phase contactor in as normal and then take either one phase or two phases from that output and run those through an SSR. That way the stuck contact checks would still work.

My car has to be either single phase or 3 phase you can’t use just 2 phases but I don’t know what happens if you only switch 1 phase off, room is tight in the housing, so a single single phase SSR would be an easier fit.

Unsure what was wrong, but now working including changing relay states while actually charging.

I realised why altering energyMeter.ccp didn’t work- it’s now calculated within the WiFi firmware! Will now have to figure a way to get the right calculation depending on which relays are energised. I guess I could do it within energyMeter.ccp by #def THREEPHASE but then the UI three phase switch is redundant (wrong). EDIT- is that file in the evse controller firmware used now though?

How can I get the state of relay2Enable into the wifi file energyMeter.ccp ?

Well, actually, I’ve found that if you only have 2 phases connected the car will actually use those 2 phases. So if you set the openEVSE at the minimum 6A you will actually get about 2.9kW charging. So depending on the relay settings, using both DC1 and DC2 you can actually have 1.4, 2.8 or 4.2kW at a 6A setting.

Car doesn’t like the SSR- probably because of the leakage current so may have to put a load resistor in or use contactors. It works ok if charging is turned on initially with the SSR off. Then if you turn the SSR on it’s ok, but it then doesn’t like it being turned off.

I have found a way to get the GUI to show the correct current- it’s a bit of a work round as my coding skills aren’t good enough, but will do for now.