fabian-lauer / dbus-shelly-3em-smartmeter

Integrate Shelly 3EM smart meter into Victron Energies Venus OS
128 stars 56 forks source link

value for total_returned are wrong because 3EM not "saldierend" #8

Closed DietmarHoch closed 1 year ago

DietmarHoch commented 2 years ago

Hi, as in forums discussed the 3EM builds no SUM over L1, L2 and L3. so values for total returned are wrong if your PV inverter is only on one phase. please compare the values with your meter from the distributor. my suggustion: at midnight set all values to zero and build your own sum over the day. i made this for an ESP32 that reads my data from the 3EM and sends it to the solax X1 over RS485. it works and the values in the solax portal looks rigth for me. here is a bit of my code:

_//saldierung shelly
unsigned long time_now = millis(); unsigned long time_diff = time_now - last_time_Returned_energy_saldo; last_time_Returned_energy_saldo = time_now; if (power_gesamt_shelly_EM3 < 0) { energy_returned_saldiert_Wattmillisekunde = energy_returned_saldiert_Wattmillisekunde + ((power_gesamt_shelly_EM3 -1) time_diff); }

and dont forget:

  day_of_month = timeinfo.tm_mday;
  if (day_of_month != last_day){
  Serial.println("neuer tag: " + String(timeinfo.tm_mday));
  last_day = timeinfo.tm_mday;

  energy_returned_saldiert_Wattmillisekunde = 0; //returned energy um mitternacht zuruecksetzen,_
fabian-lauer commented 1 year ago

Hi @DietmarHoch ,

sorry for late reply - not much time to take care of this project any more. I guess you are right - we had a problem with the calculation also on VRM wrong values where shown.

A fix was applied - but only for the Forward/Reverse totals not on each L1-L3 level: image

For VRM that fixes everything - do you think that this is sufficient or also needed on L1-L3 level?

DietmarHoch commented 1 year ago

Hi Fabian,

this Fix is working for me, for the energy calculation a sum over all phases are right.

thanks

fabian-lauer commented 1 year ago

Ok - great - will close this issue here