Publish limit_absolute for known models

This commit is contained in:
Thomas Basler 2022-10-06 18:51:03 +02:00
parent e1690e8f74
commit 9e907b0ca7
2 changed files with 6 additions and 0 deletions

View File

@ -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. | % |

View File

@ -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()));