diff --git a/include/BatteryStats.h b/include/BatteryStats.h index 94da35d78..c3b0c6314 100644 --- a/include/BatteryStats.h +++ b/include/BatteryStats.h @@ -18,7 +18,7 @@ class BatteryStats { uint32_t getAgeSeconds() const { return (millis() - _lastUpdate) / 1000; } bool updateAvailable(uint32_t since) const; - uint8_t getSoC() const { return _soc; } + float getSoC() const { return _soc; } uint32_t getSoCAgeSeconds() const { return (millis() - _lastUpdateSoC) / 1000; } uint8_t getSoCPrecision() const { return _socPrecision; } diff --git a/src/PowerLimiter.cpp b/src/PowerLimiter.cpp index 93f027b07..c4f5382ea 100644 --- a/src/PowerLimiter.cpp +++ b/src/PowerLimiter.cpp @@ -266,7 +266,7 @@ void PowerLimiterClass::loop() _batteryDischargeEnabled = getBatteryPower(); if (_verboseLogging && !config.PowerLimiter.IsInverterSolarPowered) { - MessageOutput.printf("[DPL::loop] battery interface %s, SoC: %d %%, StartTH: %d %%, StopTH: %d %%, SoC age: %d s, ignore: %s\r\n", + MessageOutput.printf("[DPL::loop] battery interface %s, SoC: %f %%, StartTH: %d %%, StopTH: %d %%, SoC age: %d s, ignore: %s\r\n", (config.Battery.Enabled?"enabled":"disabled"), Battery.getStats()->getSoC(), config.PowerLimiter.BatterySocStartThreshold, diff --git a/src/PylontechCanReceiver.cpp b/src/PylontechCanReceiver.cpp index 517a6a230..d835c2f21 100644 --- a/src/PylontechCanReceiver.cpp +++ b/src/PylontechCanReceiver.cpp @@ -31,7 +31,7 @@ void PylontechCanReceiver::onMessage(twai_message_t rx_message) _stats->_stateOfHealth = this->readUnsignedInt16(rx_message.data + 2); if (_verboseLogging) { - MessageOutput.printf("[Pylontech] soc: %d soh: %d\r\n", + MessageOutput.printf("[Pylontech] soc: %f soh: %d\r\n", _stats->getSoC(), _stats->_stateOfHealth); } break; diff --git a/src/PytesCanReceiver.cpp b/src/PytesCanReceiver.cpp index 81c7c85cc..3e877cef3 100644 --- a/src/PytesCanReceiver.cpp +++ b/src/PytesCanReceiver.cpp @@ -32,7 +32,7 @@ void PytesCanReceiver::onMessage(twai_message_t rx_message) _stats->_stateOfHealth = this->readUnsignedInt16(rx_message.data + 2); if (_verboseLogging) { - MessageOutput.printf("[Pytes] soc: %d soh: %d\r\n", + MessageOutput.printf("[Pytes] soc: %f soh: %d\r\n", _stats->getSoC(), _stats->_stateOfHealth); } break;