Compare commits

...

3 Commits

Author SHA1 Message Date
Gunnar Skjold
d777040c0a Fixed loading error from previous version energy accounting 2023-01-29 17:04:04 +01:00
Gunnar Skjold
a5636a60f8 Some changes after testing 2023-01-28 20:24:18 +01:00
Gunnar Skjold
6f817b2ed5 Some changes after testing 2023-01-28 20:19:06 +01:00
2 changed files with 13 additions and 3 deletions

View File

@@ -362,7 +362,9 @@ bool EnergyAccounting::load() {
} else if(buf[0] == 4) {
EnergyAccountingData4* data = (EnergyAccountingData4*) buf;
this->data = { 5, data->month,
(uint16_t) (data->costYesterday / 10), (uint16_t) (data->costThisMonth / 100), (uint16_t) (data->costLastMonth / 100),
data->costYesterday,
data->costThisMonth,
data->costLastMonth,
0,0,0, // Income from production
data->peaks[0].day, data->peaks[0].value,
data->peaks[1].day, data->peaks[1].value,

View File

@@ -240,12 +240,20 @@ void AmsWebServer::sysinfoJson() {
UiConfig ui;
config->getUiConfig(ui);
String meterModel = meterState->getMeterModel();
meterModel.replace("\\", "\\\\");
String meterId = meterState->getMeterId();
meterId.replace("\\", "\\\\");
int size = snprintf_P(buf, BufferSize, SYSINFO_JSON,
VERSION,
#if defined(CONFIG_IDF_TARGET_ESP32S2)
"esp32s2",
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
"esp32c3",
#elif defined(CONFIG_FREERTOS_UNICORE)
"esp32solo",
#elif defined(ESP32)
"esp32",
#elif defined(ESP8266)
@@ -272,8 +280,8 @@ void AmsWebServer::sysinfoJson() {
dns2.toString().c_str(),
#endif
meterState->getMeterType(),
meterState->getMeterModel().c_str(),
meterState->getMeterId().c_str(),
meterModel.c_str(),
meterId.c_str(),
ui.showImport,
ui.showExport,
ui.showVoltage,