From d9bac3be448e0d849edc90677f789ccff6212118 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 6 Mar 2023 14:18:05 -0600 Subject: [PATCH] [Discovery] Re-add the discovery switch (#1506) revert #1365, indeed the switch may be usefull to avoid non desirable discovery of RTL_433 or BT devices #1487 --- main/ZmqttDiscovery.ino | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/ZmqttDiscovery.ino b/main/ZmqttDiscovery.ino index 30a46a5..cfb0b37 100644 --- a/main/ZmqttDiscovery.ino +++ b/main/ZmqttDiscovery.ino @@ -516,6 +516,15 @@ void pubMqttDiscovery() { "", "", "", "", false, // device name, device manufacturer, device model, device ID, retain stateClassNone //State Class ); + createDiscovery("switch", //set Type + "", "SYS: Auto discovery", (char*)getUniqueId("discovery", "").c_str(), //set state_topic,name,uniqueId + will_Topic, "", "", //set availability_topic,device_class,value_template, + "{\"discovery\":true}", "{\"discovery\":false}", "", //set,payload_on,payload_off,unit_of_meas, + 0, //set off_delay + Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic + "", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain, + stateClassNone //State Class + ); # endif # ifdef ZboardM5STACK createDiscovery("sensor", //set Type