Skip to content

Commit

Permalink
Add Active Power Total
Browse files Browse the repository at this point in the history
Add Active Power Total if multiple phases AND both positive and negative values (#19141)
  • Loading branch information
arendst committed Oct 13, 2023
1 parent 32cbd33 commit 5cee525
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 12 deletions.
1 change: 1 addition & 0 deletions tasmota/include/i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ const char HTTP_SNS_POWER[] PROGMEM = "{s}" D_POWERUSAGE_ACTIVE
const char HTTP_SNS_IMPORT_POWER[] PROGMEM = "{s}" D_IMPORT_POWER "{m}%s " D_UNIT_WATT "{e}";
const char HTTP_SNS_EXPORT_POWER[] PROGMEM = "{s}" D_EXPORT_POWER "{m}%s " D_UNIT_WATT "{e}";
const char HTTP_SNS_MAX_POWER[] PROGMEM = "{s}" D_MAX_POWER "{m}%s " D_UNIT_WATT "{e}";
const char HTTP_SNS_POWER_TOTAL[] PROGMEM = "{s}" D_POWERUSAGE_ACTIVE_TOTAL "{m}%s " D_UNIT_WATT "{e}";
const char HTTP_SNS_POWERUSAGE_APPARENT[] PROGMEM = "{s}" D_POWERUSAGE_APPARENT "{m}%s " D_UNIT_VA "{e}";
const char HTTP_SNS_POWERUSAGE_REACTIVE[] PROGMEM = "{s}" D_POWERUSAGE_REACTIVE "{m}%s " D_UNIT_VAR "{e}";
const char HTTP_SNS_POWER_FACTOR[] PROGMEM = "{s}" D_POWER_FACTOR "{m}%s {e}";
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/af_AF.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Krag faktor"
#define D_POWERUSAGE "Krag"
#define D_POWERUSAGE_ACTIVE "Regte krag"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Oënskynlike krag"
#define D_POWERUSAGE_REACTIVE "reaktiewe krag"
#define D_PRESSURE "Druk"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/bg_BG.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Фактор на мощността"
#define D_POWERUSAGE "Мощност"
#define D_POWERUSAGE_ACTIVE "Активна мощност"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Пълна мощност"
#define D_POWERUSAGE_REACTIVE "Реактивна мощност"
#define D_PRESSURE "Налягане"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ca_AD.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Factor de poténcia"
#define D_POWERUSAGE "Poténcia"
#define D_POWERUSAGE_ACTIVE "Poténcia Activa"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Poténcia Aparent"
#define D_POWERUSAGE_REACTIVE "Poténcia Reactiva"
#define D_PRESSURE "Pressió"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/cs_CZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Účiník"
#define D_POWERUSAGE "Příkon"
#define D_POWERUSAGE_ACTIVE "Činný příkon"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Zdánlivý příkon"
#define D_POWERUSAGE_REACTIVE "Jalový příkon"
#define D_PRESSURE "Tlak"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/de_DE.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Leistungsfaktor"
#define D_POWERUSAGE "Leistung"
#define D_POWERUSAGE_ACTIVE "Wirkleistung"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Scheinleistung"
#define D_POWERUSAGE_REACTIVE "Blindleistung"
#define D_PRESSURE "Luftdruck"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/el_GR.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Συντελεστής Ισχύος"
#define D_POWERUSAGE "Ισχύς"
#define D_POWERUSAGE_ACTIVE "Ενεργός ισχύς"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Φαινόμενη ισχύς"
#define D_POWERUSAGE_REACTIVE "Άεργη ισχύς"
#define D_PRESSURE "Πίεση"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/en_GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Power Factor"
#define D_POWERUSAGE "Power"
#define D_POWERUSAGE_ACTIVE "Active Power"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Apparent Power"
#define D_POWERUSAGE_REACTIVE "Reactive Power"
#define D_PRESSURE "Pressure"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/es_ES.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Factor de Potencia"
#define D_POWERUSAGE "Potencia"
#define D_POWERUSAGE_ACTIVE "Potencia Activa"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Potencia Aparente"
#define D_POWERUSAGE_REACTIVE "Potencia Reactiva"
#define D_PRESSURE "Presión"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/fr_FR.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Fact de puiss"
#define D_POWERUSAGE "Puissance"
#define D_POWERUSAGE_ACTIVE "Puiss active"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Puiss apparente"
#define D_POWERUSAGE_REACTIVE "Puiss réactive"
#define D_PRESSURE "Pression"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/fy_NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Krêftfaktor"
#define D_POWERUSAGE "Krêft"
#define D_POWERUSAGE_ACTIVE "Eigentlike krêft"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Skynber krêft"
#define D_POWERUSAGE_REACTIVE "Blynde krêft"
#define D_PRESSURE "Luchtdruk"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/he_HE.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "גורם כוח"
#define D_POWERUSAGE "כוח"
#define D_POWERUSAGE_ACTIVE "כוח פעיל"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "כוח לכאורה"
#define D_POWERUSAGE_REACTIVE "כוח תגובתי"
#define D_PRESSURE "לחץ"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/hu_HU.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Teljesítménytényező"
#define D_POWERUSAGE "Energiafelhasználás"
#define D_POWERUSAGE_ACTIVE "Aktív teljesítmény"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Látszólagos teljesítmény"
#define D_POWERUSAGE_REACTIVE "Reaktív teljesítmény"
#define D_PRESSURE "Nyomás"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/it_IT.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Fattore di potenza"
#define D_POWERUSAGE "Potenza"
#define D_POWERUSAGE_ACTIVE "Potenza attiva"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Potenza apparente"
#define D_POWERUSAGE_REACTIVE "Potenza reattiva"
#define D_PRESSURE "Pressione"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ko_KO.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Power Factor"
#define D_POWERUSAGE "전원"
#define D_POWERUSAGE_ACTIVE "Active Power"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Apparent Power"
#define D_POWERUSAGE_REACTIVE "Reactive Power"
#define D_PRESSURE "기압"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/nl_NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Arbeidsfactor"
#define D_POWERUSAGE "Vermogen"
#define D_POWERUSAGE_ACTIVE "Werkelijk vermogen"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Schijnbaar vermogen"
#define D_POWERUSAGE_REACTIVE "Blindvermogen"
#define D_PRESSURE "Luchtdruk"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pl_PL.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Cosinus fi"
#define D_POWERUSAGE "Moc"
#define D_POWERUSAGE_ACTIVE "Moc czynna"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Moc pozorna"
#define D_POWERUSAGE_REACTIVE "Moc bierna"
#define D_PRESSURE "Ciśnienie"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pt_BR.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Fator de potência"
#define D_POWERUSAGE "Potência"
#define D_POWERUSAGE_ACTIVE "Potência ativa"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Potência aparente"
#define D_POWERUSAGE_REACTIVE "Potência reativa"
#define D_PRESSURE "Pressão"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pt_PT.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Factor de Potência"
#define D_POWERUSAGE "Potência"
#define D_POWERUSAGE_ACTIVE "Potência Ativa"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Potência Aparente"
#define D_POWERUSAGE_REACTIVE "Potência Reativa"
#define D_PRESSURE "Pressão"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ro_RO.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Factor de Putere"
#define D_POWERUSAGE "Putere"
#define D_POWERUSAGE_ACTIVE "Putere Activă"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Putere Aparentă"
#define D_POWERUSAGE_REACTIVE "Putere Reactivă"
#define D_PRESSURE "Presiune"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ru_RU.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
#define D_POWER_FACTOR "Коэффициент мощности"
#define D_POWERUSAGE "Мощность"
#define D_POWERUSAGE_ACTIVE "Активная мощность"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Полная мощность"
#define D_POWERUSAGE_REACTIVE "Реактивная мощность"
#define D_PRESSURE "Давление"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/sk_SK.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Účinník"
#define D_POWERUSAGE "Príkon"
#define D_POWERUSAGE_ACTIVE "Činný príkon"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Zdanlivý príkon"
#define D_POWERUSAGE_REACTIVE "Jalový príkon"
#define D_PRESSURE "Tlak"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/sv_SE.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Spänningsfaktor"
#define D_POWERUSAGE "Spänning"
#define D_POWERUSAGE_ACTIVE "Aktiv spänning"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Skenbar spänning"
#define D_POWERUSAGE_REACTIVE "Responsiv spänning"
#define D_PRESSURE "Tryck"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/tr_TR.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Güç Faktörü"
#define D_POWERUSAGE "Güç"
#define D_POWERUSAGE_ACTIVE "Aktif Güç"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Görünen Güç"
#define D_POWERUSAGE_REACTIVE "Reaktif Güç"
#define D_PRESSURE "Basınç"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/uk_UA.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Коефіцієнт потужності"
#define D_POWERUSAGE "Потужність"
#define D_POWERUSAGE_ACTIVE "Активна потужність"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Загальна потужність"
#define D_POWERUSAGE_REACTIVE "Реактивна потужність"
#define D_PRESSURE "Тиск"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/vi_VN.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "Hệ số công suất"
#define D_POWERUSAGE "Công suất"
#define D_POWERUSAGE_ACTIVE "Công suất hoạt động"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "Công suất biểu kiến"
#define D_POWERUSAGE_REACTIVE "Công suất phản kháng"
#define D_PRESSURE "Áp suất"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/zh_CN.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "功率因数"
#define D_POWERUSAGE "功率"
#define D_POWERUSAGE_ACTIVE "有功功率"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "视在功率"
#define D_POWERUSAGE_REACTIVE "无功功率"
#define D_PRESSURE "气压"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/zh_TW.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define D_POWER_FACTOR "功率因數"
#define D_POWERUSAGE "用電量"
#define D_POWERUSAGE_ACTIVE "有功功率"
#define D_POWERUSAGE_ACTIVE_TOTAL "Active Power Total"
#define D_POWERUSAGE_APPARENT "視在功率"
#define D_POWERUSAGE_REACTIVE "虛功率"
#define D_PRESSURE "氣壓"
Expand Down
17 changes: 11 additions & 6 deletions tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ char* WebEnergyFmt(float* input, uint32_t resolution, uint32_t single) {
// single = 0 - Energy->phase_count - xx / xx / xx or multi column
// single = 1 - Energy->voltage_common or Energy->frequency_common - xx or single column using colspan (if needed)
// single = 2 - Sum of Energy->phase_count if SO129 0 - xx or single column using colspan (if needed) or if SO129 1 - xx / xx / xx or multi column
// single = 3 - Sum of Energy->phase_count xx or single column using colspan (if needed)

if (!EnergyFmtMalloc()) { return EmptyStr; }

float input_sum = 0.0f;
if (single > 1) { // Sum and/or Single column
if (!Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information
if (single > 1) { // Sum and/or Single column
if ((3 == single) || !Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information
for (uint32_t i = 0; i < Energy->phase_count; i++) {
if (!isnan(input[i])) {
input_sum += input[i];
Expand All @@ -221,8 +222,8 @@ char* WebEnergyFmt(float* input, uint32_t resolution, uint32_t single) {
single = 0;
}
}
ext_snprintf_P(Energy->value, GUISZ, PSTR("</td>")); // Skip first column
if ((Energy->phase_count > 1) && single) { // Need to set colspan so need new columns
ext_snprintf_P(Energy->value, GUISZ, PSTR("</td>")); // Skip first column
if ((Energy->phase_count > 1) && single) { // Need to set colspan so need new columns
// </td><td colspan='3' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
// </td><td colspan='5' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
// </td><td colspan='7' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
Expand Down Expand Up @@ -1258,12 +1259,13 @@ void EnergyShow(bool json) {
}
}

float active_power_sum = 0.0f;
float energy_yesterday_ph[Energy->phase_count];
float active_power_sum = 0.0f;
int negative_phases = 0;
for (uint32_t i = 0; i < Energy->phase_count; i++) {
energy_yesterday_ph[i] = (float)Settings->energy_kWhyesterday_ph[i] / 100000;

active_power_sum += Energy->active_power[i];
negative_phases += (Energy->active_power[i] < 0) ? -1 : 1;
}

bool energy_tariff = false;
Expand Down Expand Up @@ -1435,6 +1437,9 @@ void EnergyShow(bool json) {
WSContentSend_PD(HTTP_SNS_POWER_FACTOR, WebEnergyFmt(power_factor, 2));
}
}
if (abs(negative_phases) != Energy->phase_count) { // Provide total power if producing power (PV) and multi phase
WSContentSend_PD(HTTP_SNS_POWER_TOTAL, WebEnergyFmt(Energy->active_power, Settings->flag2.wattage_resolution, 3));
}
WSContentSend_PD(HTTP_SNS_ENERGY_TODAY, WebEnergyFmt(Energy->daily, Settings->flag2.energy_resolution, 2));
WSContentSend_PD(HTTP_SNS_ENERGY_YESTERDAY, WebEnergyFmt(energy_yesterday_ph, Settings->flag2.energy_resolution, 2));
WSContentSend_PD(HTTP_SNS_ENERGY_TOTAL, WebEnergyFmt(Energy->total, Settings->flag2.energy_resolution, 2));
Expand Down
17 changes: 11 additions & 6 deletions tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,13 @@ char* WebEnergyFmt(float* input, uint32_t resolution, uint32_t single) {
// single = 0 - Energy->phase_count - xx / xx / xx or multi column
// single = 1 - Energy->voltage_common or Energy->frequency_common - xx or single column using colspan (if needed)
// single = 2 - Sum of Energy->phase_count if SO129 0 - xx or single column using colspan (if needed) or if SO129 1 - xx / xx / xx or multi column
// single = 3 - Sum of Energy->phase_count xx or single column using colspan (if needed)

if (!EnergyFmtMalloc()) { return EmptyStr; }

float input_sum = 0.0f;
if (single > 1) { // Sum and/or Single column
if (!Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information
if (single > 1) { // Sum and/or Single column
if ((3 == single) || !Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information
for (uint32_t i = 0; i < Energy->phase_count; i++) {
if (!isnan(input[i])) {
input_sum += input[i];
Expand All @@ -454,8 +455,8 @@ char* WebEnergyFmt(float* input, uint32_t resolution, uint32_t single) {
single = 0;
}
}
ext_snprintf_P(Energy->value, GUISZ, PSTR("</td>")); // Skip first column
if ((Energy->gui_count > 1) && single) { // Need to set colspan so need new columns
ext_snprintf_P(Energy->value, GUISZ, PSTR("</td>")); // Skip first column
if ((Energy->gui_count > 1) && single) { // Need to set colspan so need new columns
// </td><td colspan='3' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
// </td><td colspan='5' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
// </td><td colspan='7' style='text-align:right'>1.23</td><td>&nbsp;</td><td>
Expand Down Expand Up @@ -1493,12 +1494,13 @@ void EnergyShow(bool json) {
}
}

float active_power_sum = 0.0f;
float energy_yesterday_kWh[Energy->phase_count];
float active_power_sum = 0.0f;
int negative_phases = 0;
for (uint32_t i = 0; i < Energy->phase_count; i++) {
energy_yesterday_kWh[i] = Energy->Settings.energy_yesterday_kWh[i];

active_power_sum += Energy->active_power[i];
negative_phases += (Energy->active_power[i] < 0) ? -1 : 1;
}

bool energy_tariff = false;
Expand Down Expand Up @@ -1716,6 +1718,9 @@ void EnergyShow(bool json) {
WSContentSend_PD(HTTP_SNS_POWER_FACTOR, WebEnergyFmt(power_factor, 2));
}
}
if (abs(negative_phases) != Energy->phase_count) { // Provide total power if producing power (PV) and multi phase
WSContentSend_PD(HTTP_SNS_POWER_TOTAL, WebEnergyFmt(Energy->active_power, Settings->flag2.wattage_resolution, 3));
}
WSContentSend_PD(HTTP_SNS_ENERGY_TODAY, WebEnergyFmt(Energy->daily_kWh, Settings->flag2.energy_resolution, 2));
WSContentSend_PD(HTTP_SNS_ENERGY_YESTERDAY, WebEnergyFmt(energy_yesterday_kWh, Settings->flag2.energy_resolution, 2));
WSContentSend_PD(HTTP_SNS_ENERGY_TOTAL, WebEnergyFmt(Energy->total, Settings->flag2.energy_resolution, 2));
Expand Down

0 comments on commit 5cee525

Please sign in to comment.