diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 9b65f6a..fa45287 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -388,12 +388,30 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) char * subItem = NULL; // in Retaining status - trying to restore previous state from retained output topic. Retained input topics are not relevant. -if (lanStatus == RETAINING_COLLECTING) pfxlen=inTopic(topic,T_OUT); +if (lanStatus == RETAINING_COLLECTING) +{ + pfxlen=inTopic(topic,T_OUT); + if (!pfxlen) // There is not status topic + { + if (mqttClient.isRetained()) + { + pfxlen=inTopic(topic,T_BCST); + if (!pfxlen) pfxlen = inTopic(topic,T_DEV); + if (!pfxlen) return; // Not command topic ever + itemName=topic+pfxlen; + if (itemName[0]=='$') return;// -6; //Skipping homie stuff + debugSerial<