Skip to content

Commit

Permalink
main.cpp: output API MainsMeter currents in dA instead of A
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo35 committed Oct 4, 2024
1 parent 3a59ad9 commit 73e8274
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sensorbox2_ESP/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,10 +963,10 @@ bool handle_URI(struct mg_connection *c, struct mg_http_message *hm) {
doc["mains_meter"]["import_active_energy"] = round((float)MainsMeter.Import_active_energy / 100)/10; //in kWh, precision 1 decimal
doc["mains_meter"]["export_active_energy"] = round((float)MainsMeter.Export_active_energy / 100)/10; //in kWh, precision 1 decimal
*/
doc["phase_currents"]["TOTAL"] = MainsMeterIrms[0] + MainsMeterIrms[1] + MainsMeterIrms[2];
doc["phase_currents"]["L1"] = MainsMeterIrms[0];
doc["phase_currents"]["L2"] = MainsMeterIrms[1];
doc["phase_currents"]["L3"] = MainsMeterIrms[2];
doc["phase_currents"]["TOTAL"] = (MainsMeterIrms[0] + MainsMeterIrms[1] + MainsMeterIrms[2]) * 10;
doc["phase_currents"]["L1"] = MainsMeterIrms[0] * 10;
doc["phase_currents"]["L2"] = MainsMeterIrms[1] * 10;
doc["phase_currents"]["L3"] = MainsMeterIrms[2] * 10;
doc["phase_currents"]["last_data_update"] = phasesLastUpdate;

String json;
Expand Down

0 comments on commit 73e8274

Please sign in to comment.