diff --git a/sources/led-drivers/net/DriverNetZigbee2mqtt.cpp b/sources/led-drivers/net/DriverNetZigbee2mqtt.cpp index a072cf536..e8070fd0c 100644 --- a/sources/led-drivers/net/DriverNetZigbee2mqtt.cpp +++ b/sources/led-drivers/net/DriverNetZigbee2mqtt.cpp @@ -75,12 +75,18 @@ bool DriverNetZigbee2mqtt::powerOnOff(bool isOn) if (isOn) { + emit GlobalSignals::getInstance()->SignalMqttSubscribe(true, topic); + row["state"] = "OFF"; doc.setObject(row); lastWill.push_back(topic); lastWill.push_back(doc.toJson(QJsonDocument::Compact)); } + else + { + emit GlobalSignals::getInstance()->SignalMqttSubscribe(false, topic); + } } if (_zigInstance.lamps.size() > 0)