Hi Maxx,
First, thanks for clearing up the Power vs Energy topic.
Zitat
no shelly i would know of sums up energy values from all 3 phases internally, even though this has been requested often here.
By the looks of it Shelly Pro 3EM API does provide the values total_act and total_act_ret but unfortunately not based on the momentary power of all 3 phases combined.
I will try to extend my explanation a bit more:
Pa - Power Phase A
Pb - Power Phase B
Pc - Power Phase C
P = Pa + Pb + Pc; - cumulative momentary power of the installation
Eia = ∫ Pa(t) dx; (Pa(t) > 0) - Energy imported (positive value) over time period of Phase A - a_total_act_energy
Eib = ∫ Pb(t) dx; (Pb(t) > 0) - Energy imported (positive value) over time period of Phase B - b_total_act_energy
Eic = ∫ Pc(t) dx; (Pc(t) > 0) - Energy imported (positive value) over time period of Phase C - c_total_act_energy
Eea = ∫ Pa(t) dx; (Pa(t) < 0) - Energy exported (negative value) over time period of Phase A - a_total_act_ret_energy
Eeb = ∫ Pb(t) dx; (Pb(t) < 0) - Energy exported (negative value) over time period of Phase B - b_total_act_ret_energy
Eec = ∫ Pc(t) dx; (Pc(t) < 0) - Energy exported (negative value) over time period of Phase C - c_total_act_ret_energy
Ea = EIa - Eea; a_total_act_energy - a_total_act_ret_energy
Eb = EIb - Eeb; b_total_act_energy - b_total_act_ret_energy
Ec = EIc - Eec; c_total_act_energy - c_total_act_ret_energy
E = ∫ P(t) dx - Energy imported/exported (positive/negative value) over time period of Combined Power - total_act - total_act_ret;
Due to sum rule of Integration ∫ P(t) dx = ∫ Pa(t) dx + ∫ Pb(t) dx + ∫ Pc(t) dx = ∫ (Pa(t) + Pb(t) + Pc(t)) dx; E = Ea + Eb + Ec;
Shelly Pro 3EM API provides all of the mentioned values.
Hope it is clear up until this point.
The problem I am having is that values total_act and total_act_ret although together reflect the correct total amount of energy for the installation, separately they represent sums of energies of individual phases and not the imported and exported values of energy for the momentary power of the installation.
Ei = ∫ P(t) dx (P(t) > 0) - Energy imported (positive value) over time period of the installation;
Ee = ∫ P(t) dx (P(t) < 0) - Energy exported (negative value) over time period of the installation;
total_act = Eia + Eib + Eic;
total_act_ret = Eea + Eeb + Eec;
E = Eia + Eib + Eic - Eea - Eeb - Eec = Ei - Ee;
BUT
Ei <> Eia + Eib + Eic;
Ee <> Eea + Eeb + Eec;
What I was hoping total_act ("Total active energy on all phases, Wh") and total_act_ret ("Total active returned energy on all phases, Wh") will represent ∫ P(t) dx (P(t) > 0) and ∫ P(t) dx (P(t) < 0), but not simply Eia + Eib + Eic and Eea + Eeb + Eec
Example:
Pa = 100W
Pb = 200W
Pc = -300W
P = 0W
After an hour with this load:
Eia = 100Wh
Eea = 0Wh
Eib = 200Wh
Eeb = 0Wh
Eic = 0Wh
Eeb = 300Wh
E = Eia + Eib + Eic - Eea - Eeb - Eec = 100Wh + 200Wh + 0Wh - 0Wh - 300Wh = 0Wh
BUT
Ei = Eia + Eib + Eic = 100Wh + 200Wh + 0Wh = 300Wh; current value returned in total_act
Ee = Eea + Eeb + Eec = 0Wh + 0Wh + 300Wh = 300Wh; current value returned in total_act_ret
Instead of Ei = 0Wh and Ee = 0Wh since P never left 0W during this hour.
Hope this helps to understand my point.
Alex