Calculating kwh using arduino, doesn't match utility meter

Welcome, Mike, to the OEM forum.

How much slower? Are you chasing a 1% error or a 100% error? What are the numbers you get?

and

but did you also calibrate the PHASECAL for each c.t?

There’s one potential problem I’ve spotted: you’ll be suffering integer truncation in that line (and the other one like it): it will do the multiplication and division OK, but then throw away any fractional part. Depending on how fast you do the main loop - and because you have no delays in the loop, it might be repeated in less than 1 second, the missing fraction could be significant.

[Edit]
I’m also not sure about the first expression in the for loop: it’s equivalent to the assignment
wattseconds1 = ;
and I’m not sure how the compiler will handle it. All the expressions in the for statement are optional. This might be the error you’re looking for. You can make the whole statement more succinct too:

for( ; wattseconds1 >= 3600; wattseconds1 -= 3600, watthours1++) ;

but my preference - it just “reads better” to me - would be

while (wattseconds1 >= 3600)
{
  wattseconds1 -= 3600;
  watthours1++;
}

[/Edit]

You might want to look at emonLibCM - this calculates energy for you, but it’s not a direct substitute for emonLib. I don’t own an Arduino, so it’s not been tested on one; but with correct initialisation (notably ADCCal) and calibration, it ought to work. The latest version is here: EmonLibCM - Version 2.2.2
Even with emonLibCM, my experience is you’ll never get a perfect match all the time on all loads - at least with our default 100 A c.t’s., and that’s because the c.t’s phase error changes according to the current. You may fare better with different c.t’s.

[emonLibCM carries over the integer truncation into the next report.]