From 48c00d9d2a3117f0432bf73457a3958a4f040347 Mon Sep 17 00:00:00 2001 From: SW-Nico Date: Mon, 18 Nov 2024 16:50:49 +0100 Subject: [PATCH] Process "FWE" and use "mdi:electric-switch" for relay state --- lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp | 7 +++++++ src/MqttHandleVedirectHass.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp b/lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp index 9de8151df..dd3cd07af 100644 --- a/lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp +++ b/lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp @@ -253,6 +253,13 @@ void VeDirectFrameHandler::processTextData(std::string const& name, std::stri return; } + // According "VE.Direct-Protocol-3.33.pdf" for "Phoenix Charger" and "Smart BuckBoost". + // But it seems also some MPPT deliver FWE. + if (name == "FWE") { + _msgOut->printf("%s FWE ignored. We use FE to process the firmware version (value '%s')\r\n", _logId, value.c_str()); + return; + } + if (name == "V") { _tmpFrame.batteryVoltage_V_mV = atol(value.c_str()); return; diff --git a/src/MqttHandleVedirectHass.cpp b/src/MqttHandleVedirectHass.cpp index 4002d656c..0683c130c 100644 --- a/src/MqttHandleVedirectHass.cpp +++ b/src/MqttHandleVedirectHass.cpp @@ -89,7 +89,7 @@ void MqttHandleVedirectHassClass::publishConfig() // optional info, provided only if the charge controller delivers the information if (optMpptData->relayState_RELAY.first != 0) { - publishBinarySensor("MPPT error relay state", "mdi:export", "RELAY", "ON", "OFF", *optMpptData); + publishBinarySensor("MPPT error relay state", "mdi:electric-switch", "RELAY", "ON", "OFF", *optMpptData); } if (optMpptData->loadOutputState_LOAD.first != 0) { publishBinarySensor("MPPT load output state", "mdi:export", "LOAD", "ON", "OFF", *optMpptData);