diff --git a/src/EnergyAccounting.cpp b/src/EnergyAccounting.cpp index 720de4c6..e4e34d21 100644 --- a/src/EnergyAccounting.cpp +++ b/src/EnergyAccounting.cpp @@ -202,10 +202,6 @@ uint8_t EnergyAccounting::getCurrentThreshold() { return config->thresholds[currentThresholdIdx]; } -uint8_t EnergyAccounting::getCurrentHour() { - return currentHour; -} - float EnergyAccounting::getMonthMax() { return data.maxHour / 100.0; } diff --git a/src/EnergyAccounting.h b/src/EnergyAccounting.h index 333db494..f873df1b 100644 --- a/src/EnergyAccounting.h +++ b/src/EnergyAccounting.h @@ -35,7 +35,6 @@ public: float getMonthMax(); uint8_t getCurrentThreshold(); - uint8_t getCurrentHour(); EnergyAccountingData getData(); void setData(EnergyAccountingData&); diff --git a/src/mqtt/JsonMqttHandler.cpp b/src/mqtt/JsonMqttHandler.cpp index b1c67c0f..590953f4 100644 --- a/src/mqtt/JsonMqttHandler.cpp +++ b/src/mqtt/JsonMqttHandler.cpp @@ -23,6 +23,7 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou hw->getTemperature(), data->getActiveImportPower(), ea->getUseThisHour(), + ea->getUseToday(), ea->getCurrentThreshold() ); return mqtt->publish(topic, json); @@ -49,6 +50,7 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou data->getL2Voltage(), data->getL3Voltage(), ea->getUseThisHour(), + ea->getUseToday(), ea->getCurrentThreshold() ); return mqtt->publish(topic, json); @@ -80,6 +82,7 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou data->getReactiveExportCounter(), data->getMeterTimestamp(), ea->getUseThisHour(), + ea->getUseToday(), ea->getCurrentThreshold() ); return mqtt->publish(topic, json); @@ -115,6 +118,7 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou data->getReactiveExportCounter(), data->getMeterTimestamp(), ea->getUseThisHour(), + ea->getUseToday(), ea->getCurrentThreshold() ); return mqtt->publish(topic, json); diff --git a/src/mqtt/RawMqttHandler.cpp b/src/mqtt/RawMqttHandler.cpp index 3843deb3..37db447e 100644 --- a/src/mqtt/RawMqttHandler.cpp +++ b/src/mqtt/RawMqttHandler.cpp @@ -73,6 +73,7 @@ bool RawMqttHandler::publish(AmsData* data, AmsData* meterState, EnergyAccountin } } mqtt->publish(topic + "/realtime/import/hour", String(ea->getUseThisHour(), 3)); + mqtt->publish(topic + "/realtime/import/day", String(ea->getUseToday(), 2)); mqtt->publish(topic + "/realtime/import/threshold", String(ea->getCurrentThreshold(), 10), true, 0); return true; } diff --git a/web/json1.json b/web/json1.json index 83c6ffca..26c77431 100644 --- a/web/json1.json +++ b/web/json1.json @@ -11,6 +11,7 @@ }, "realtime" : { "h" : %.2f, + "d" : %.1f, "t" : %d } } diff --git a/web/json2.json b/web/json2.json index c28a9793..40ee037b 100644 --- a/web/json2.json +++ b/web/json2.json @@ -23,6 +23,7 @@ }, "realtime" : { "h" : %.2f, + "d" : %.1f, "t" : %d } } diff --git a/web/json3.json b/web/json3.json index 081ba293..5e82251d 100644 --- a/web/json3.json +++ b/web/json3.json @@ -28,6 +28,7 @@ }, "realtime" : { "h" : %.2f, + "d" : %.1f, "t" : %d } } diff --git a/web/json4.json b/web/json4.json index 6d1a5e72..0e57e2b4 100644 --- a/web/json4.json +++ b/web/json4.json @@ -32,6 +32,7 @@ }, "realtime" : { "h" : %.2f, + "d" : %.1f, "t" : %d } }