diff --git a/README.md b/README.md index 30d89fb2d..8f1809370 100644 --- a/README.md +++ b/README.md @@ -156,31 +156,32 @@ Topics for 3 phases of a power meter is configurable. Given is an example for th | Topic | R / W | Description | Value / Unit | | --------------------------------------- | ----- | ---------------------------------------------------- | -------------------------- | -| battery/settings/chargeVoltage | R | Voltage | Volt (V) | -| battery/settings/chargeCurrentLimitation | R | | | -| battery/settings/dischargeCurrentLimitation | R | | | -| battery/stateOfCharge | R | | | -| battery/stateOfHealth | R | | | -| battery/voltage | R | | | -| battery/current | R | | | -| battery/temperature" | R | | | -| battery/alarm/overCurrentDischarge | R | | | -| battery/alarm/underTemperature | R | | | -| battery/alarm/overTemperature | R | | | -| battery/alarm/underVoltage | R | | | -| battery/alarm/overVoltage | R | | | -| battery/alarm/bmsInternal | R | | | -| battery/alarm/overCurrentCharge | R | | | -| battery/warning/highCurrentDischarge | R | | | -| battery/warning/lowTemperature | R | | | -| battery/warning/highTemperature | R | | | -| battery/warning/lowVoltage | R | | | -| battery/warning/highVoltage | R | | | -| battery/warning/bmsInternal | R | | | -| battery/manufacturer | R | | | -| battery/charging/chargeEnabled | R | | | -| battery/charging/dischargeEnabled | R | | | -| battery/charging/chargeImmediately | R | | | +| battery/settings/chargeVoltage | R | Voltage | Volt (V) | +| battery/settings/chargeCurrentLimitation | R | BMS requested max. charge current | Ampere (A) | +| battery/settings/dischargeCurrentLimitation | R | BMS requested max. discharge current | Ampere (A) | +| battery/stateOfCharge | R | State of Health | % | +| battery/stateOfHealth | R | State of Charge | % | +| battery/dataAge | R | How old the data is | Seconds | +| battery/voltage | R | Actual voltage | Volt (V) | +| battery/current | R | Actual current | Ampere (A) | +| battery/temperature" | R | Actual temperature | °C | +| battery/alarm/overCurrentDischarge | R | Alarm: High discharge current | 0 / 1 | +| battery/alarm/underTemperature | R | Alarm: Low temperature | 0 / 1 | +| battery/alarm/overTemperature | R | Alarm: High temperature | 0 / 1 | +| battery/alarm/underVoltage | R | Alarm: Low voltage | 0 / 1 | +| battery/alarm/overVoltage | R | Alarm: High voltage | 0 / 1 | +| battery/alarm/bmsInternal | R | Alarm: BMS internal | 0 / 1 | +| battery/alarm/overCurrentCharge | R | | | +| battery/warning/highCurrentDischarge | R | Warning: High discharge current | 0 / 1 | +| battery/warning/lowTemperature | R | Warning: Low temperature | 0 / 1 | +| battery/warning/highTemperature | R | Warning: High temperature | 0 / 1 | +| battery/warning/lowVoltage | R | Warning: Low voltage | 0 / 1 | +| battery/warning/highVoltage | R | Warning: High voltage | 0 / 1 | +| battery/warning/bmsInternal | R | Warning: BMS internal | 0 / 1 | +| battery/manufacturer | R | Manufacturer | String | +| battery/charging/chargeEnabled | R | Charge enabled flag | 0 / 1 | +| battery/charging/dischargeEnabled | R | Discharge enabled flag | 0 / 1 | +| battery/charging/chargeImmediately | R | Charge immediately flag | 0 / 1 | ## Huawei AC charger topics | Topic | R / W | Description | Value / Unit | diff --git a/docs/MQTT_Topics.md b/docs/MQTT_Topics.md index 715fd0220..a7ac749c8 100644 --- a/docs/MQTT_Topics.md +++ b/docs/MQTT_Topics.md @@ -132,6 +132,7 @@ cmd topics are used to set values. Status topics are updated from values set in | battery/settings/dischargeCurrentLimitation | R | BMS requested max. discharge current | Ampere (A) | | battery/stateOfCharge | R | State of Health | % | | battery/stateOfHealth | R | State of Charge | % | +| battery/dataAge | R | How old the data is | Seconds | | battery/voltage | R | Actual voltage | Volt (V) | | battery/current | R | Actual current | Ampere (A) | | battery/temperature" | R | Actual temperature | °C | @@ -141,6 +142,7 @@ cmd topics are used to set values. Status topics are updated from values set in | battery/alarm/underVoltage | R | Alarm: Low voltage | 0 / 1 | | battery/alarm/overVoltage | R | Alarm: High voltage | 0 / 1 | | battery/alarm/bmsInternal | R | Alarm: BMS internal | 0 / 1 | +| battery/alarm/overCurrentCharge | R | | | | battery/warning/highCurrentDischarge | R | Warning: High discharge current | 0 / 1 | | battery/warning/lowTemperature | R | Warning: Low temperature | 0 / 1 | | battery/warning/highTemperature | R | Warning: High temperature | 0 / 1 | diff --git a/src/PylontechCanReceiver.cpp b/src/PylontechCanReceiver.cpp index 4cb35c431..7522b04fa 100644 --- a/src/PylontechCanReceiver.cpp +++ b/src/PylontechCanReceiver.cpp @@ -118,6 +118,7 @@ void PylontechCanReceiverClass::mqtt() MqttSettings.publish(topic + "/settings/dischargeCurrentLimitation", String(Battery.dischargeCurrentLimitation)); MqttSettings.publish(topic + "/stateOfCharge", String(Battery.stateOfCharge)); MqttSettings.publish(topic + "/stateOfHealth", String(Battery.stateOfHealth)); + MqttSettings.publish(topic + "/dataAge", String((millis() - Battery.lastUpdate) / 1000)); MqttSettings.publish(topic + "/voltage", String(Battery.voltage)); MqttSettings.publish(topic + "/current", String(Battery.current)); MqttSettings.publish(topic + "/temperature", String(Battery.temperature));