diff --git a/src/MqttHandleInverter.cpp b/src/MqttHandleInverter.cpp index 67196fe..daba917 100644 --- a/src/MqttHandleInverter.cpp +++ b/src/MqttHandleInverter.cpp @@ -126,9 +126,12 @@ void MqttHandleInverterClass::publishField(std::shared_ptr inv return; } - MqttSettings.publish(topic, String( + String value = String( inv->Statistics()->getChannelFieldValue(type, channel, fieldId), - static_cast(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId)))); + static_cast(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId))); + value.trim(); + + MqttSettings.publish(topic, value); } String MqttHandleInverterClass::getTopic(std::shared_ptr inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId)