diff --git a/docs/MQTT_Topics.md b/docs/MQTT_Topics.md index 6d9243c..7ee2866 100644 --- a/docs/MQTT_Topics.md +++ b/docs/MQTT_Topics.md @@ -61,6 +61,7 @@ cmd topics are used to set values. Status topics are updated from values set in | Topic | R / W | Description | Value / Unit | | ----------------------------------------- | ----- | ---------------------------------------------------- | -------------------------- | | [serial]/status/limit_relative | R | Current applied production limit of the inverter | % of total possible output | +| [serial]/status/limit_absolute | R | Current applied production limit of the inverter | Watt (W) | | [serial]/status/reachable | R | Indicates whether the inverter is reachable | 0 or 1 | | [serial]/status/producing | R | Indicates whether the inverter is producing AC power | 0 or 1 | | [serial]/cmd/limit_persistent_relative | W | Set the inverter limit as a percentage of total production capability. The value will survive the night without power. The updated value will show up in the web GUI and limit_relative topic immediatly. | % | diff --git a/src/MqttPublishing.cpp b/src/MqttPublishing.cpp index 9d56901..fc74b78 100644 --- a/src/MqttPublishing.cpp +++ b/src/MqttPublishing.cpp @@ -65,6 +65,11 @@ void MqttPublishingClass::loop() if (inv->SystemConfigPara()->getLastUpdate() > 0) { // Limit MqttSettings.publish(subtopic + "/status/limit_relative", String(inv->SystemConfigPara()->getLimitPercent())); + + uint16_t maxpower = inv->DevInfo()->getMaxPower(); + if (maxpower > 0) { + MqttSettings.publish(subtopic + "/status/limit_absolute", String(inv->SystemConfigPara()->getLimitPercent() * maxpower / 100)); + } } MqttSettings.publish(subtopic + "/status/reachable", String(inv->isReachable()));