Skip to content

Commit

Permalink
Add absorption and float voltage to live view, MQTT and HASS
Browse files Browse the repository at this point in the history
  • Loading branch information
SW-Niko authored and schlimmchen committed Oct 24, 2024
1 parent 52fdc7e commit 6a5b129
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MqttHandleVedirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ void MqttHandleVedirectClass::publish_mppt_data(const VeDirectMpptController::da

PUBLISH_OPT(NetworkTotalDcInputPowerMilliWatts, "NetworkTotalDcInputPower", currentData.NetworkTotalDcInputPowerMilliWatts.second / 1000.0);
PUBLISH_OPT(MpptTemperatureMilliCelsius, "MpptTemperature", currentData.MpptTemperatureMilliCelsius.second / 1000.0);
PUBLISH_OPT(BatteryAbsorptionMilliVolt, "BatteryAbsorption", currentData.BatteryAbsorptionMilliVolt.second / 1000.0);
PUBLISH_OPT(BatteryFloatMilliVolt, "BatteryFloat", currentData.BatteryFloatMilliVolt.second / 1000.0);
PUBLISH_OPT(SmartBatterySenseTemperatureMilliCelsius, "SmartBatterySenseTemperature", currentData.SmartBatterySenseTemperatureMilliCelsius.second / 1000.0);
#undef PUBLILSH_OPT
}
6 changes: 6 additions & 0 deletions src/MqttHandleVedirectHass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ void MqttHandleVedirectHassClass::publishConfig()
if (optMpptData->MpptTemperatureMilliCelsius.first != 0) {
publishSensor("MPPT temperature", "mdi:temperature-celsius", "MpptTemperature", "temperature", "measurement", "°C", *optMpptData);
}
if (optMpptData->BatteryAbsorptionMilliVolt.first != 0) {
publishSensor("Battery absorption voltage", "mdi:battery-charging-90", "Absorption", "voltage", "measurement", "V", *optMpptData);
}
if (optMpptData->BatteryFloatMilliVolt.first != 0) {
publishSensor("Battery float voltage", "mdi:battery-charging-100", "Float", "voltage", "measurement", "V", *optMpptData);
}
if (optMpptData->SmartBatterySenseTemperatureMilliCelsius.first != 0) {
publishSensor("Smart Battery Sense temperature", "mdi:temperature-celsius", "SmartBatterySenseTemperature", "temperature", "measurement", "°C", *optMpptData);
}
Expand Down
10 changes: 10 additions & 0 deletions src/WebApi_ws_vedirect_live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ void WebApiWsVedirectLiveClass::populateJson(const JsonObject &root, const VeDir
output["SBSTemperature"]["u"] = "°C";
output["SBSTemperature"]["d"] = "0";
}
if (mpptData.BatteryAbsorptionMilliVolt.first > 0) {
output["AbsorptionVoltage"]["v"] = mpptData.BatteryAbsorptionMilliVolt.second / 1000.0;
output["AbsorptionVoltage"]["u"] = "V";
output["AbsorptionVoltage"]["d"] = "2";
}
if (mpptData.BatteryFloatMilliVolt.first > 0) {
output["FloatVoltage"]["v"] = mpptData.BatteryFloatMilliVolt.second / 1000.0;
output["FloatVoltage"]["u"] = "V";
output["FloatVoltage"]["d"] = "2";
}

const JsonObject input = values["input"].to<JsonObject>();
if (mpptData.NetworkTotalDcInputPowerMilliWatts.first > 0) {
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
"V": "Spannung",
"I": "Strom",
"E": "Effizienz (berechnet)",
"AbsorptionVoltage": "Absorptionsspannung",
"FloatVoltage": "Erhaltungsspannung",
"SBSTemperature": "SBS Temperatur"
},
"section_input": "Eingang (Solarpanele)",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
"V": "Voltage",
"I": "Current",
"E": "Efficiency (calculated)",
"AbsorptionVoltage": "Absorption voltage",
"FloatVoltage": "Float voltage",
"SBSTemperature": "SBS temperature"
},
"section_input": "Input (Solar Panels)",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
"V": "Voltage",
"I": "Current",
"E": "Efficiency (calculated)",
"AbsorptionVoltage": "Absorption voltage",
"FloatVoltage": "Float voltage",
"SBSTemperature": "SBS temperature"
},
"section_input": "Input (Solar Panels)",
Expand Down

0 comments on commit 6a5b129

Please sign in to comment.