Added month max to mqtt

This commit is contained in:
Gunnar Skjold
2022-04-01 20:39:22 +02:00
parent e009b4e54e
commit 191d9fa562
6 changed files with 17 additions and 8 deletions

View File

@@ -24,7 +24,8 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou
data->getActiveImportPower(),
ea->getUseThisHour(),
ea->getUseToday(),
ea->getCurrentThreshold()
ea->getCurrentThreshold(),
ea->getMonthMax()
);
return mqtt->publish(topic, json);
} else if(data->getListType() == 2) {
@@ -51,7 +52,8 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou
data->getL3Voltage(),
ea->getUseThisHour(),
ea->getUseToday(),
ea->getCurrentThreshold()
ea->getCurrentThreshold(),
ea->getMonthMax()
);
return mqtt->publish(topic, json);
} else if(data->getListType() == 3) {
@@ -83,7 +85,8 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou
data->getMeterTimestamp(),
ea->getUseThisHour(),
ea->getUseToday(),
ea->getCurrentThreshold()
ea->getCurrentThreshold(),
ea->getMonthMax()
);
return mqtt->publish(topic, json);
} else if(data->getListType() == 4) {
@@ -119,7 +122,8 @@ bool JsonMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccou
data->getMeterTimestamp(),
ea->getUseThisHour(),
ea->getUseToday(),
ea->getCurrentThreshold()
ea->getCurrentThreshold(),
ea->getMonthMax()
);
return mqtt->publish(topic, json);
}

View File

@@ -75,6 +75,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);
mqtt->publish(topic + "/realtime/import/monthmax", String(ea->getMonthMax(), 3), true, 0);
return true;
}