Feature: add VE.Direct "RELAY" to live view, MQTT, and HASS

This commit is contained in:
SW-Nico
2024-11-07 11:29:07 +01:00
committed by Bernhard Kirchen
parent 1d5816d57f
commit 4beea357e7
8 changed files with 17 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ bool VeDirectMpptController::processTextDataDerived(std::string const& name, std
_tmpFrame.loadOutputState_LOAD.first = millis();
return true;
}
if (name == "RELAY") {
_tmpFrame.relayState_RELAY.second = (value == "ON");
_tmpFrame.relayState_RELAY.first = millis();
return true;
}
if (name == "CS") {
_tmpFrame.currentState_CS = atoi(value.c_str());
return true;
@@ -130,6 +135,7 @@ void VeDirectMpptController::loop()
// Check if optional TEXT-Data is outdated
resetTimestamp(_tmpFrame.loadOutputState_LOAD);
resetTimestamp(_tmpFrame.loadCurrent_IL_mA);
resetTimestamp(_tmpFrame.relayState_RELAY);
// Third we check if HEX-Data is outdated
if (!isHexCommandPossible()) { return; }