diff --git a/tasmota/settings.h b/tasmota/settings.h index 3b8ef9306..05ab83922 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -150,7 +150,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t mqtt_info_retain : 1; // bit 8 (v9.3.0.1) - CMND_INFORETAIN uint32_t wiegand_hex_output : 1; // bit 9 (v9.3.1.1) - SetOption123 - (Wiegand) switch tag number output to hex format (1) uint32_t wiegand_keypad_to_tag : 1; // bit 10 (v9.3.1.1) - SetOption124 - (Wiegand) send key pad stroke as single char (0) or one tag (ending char #) (1) - uint32_t spare11 : 1; // bit 11 + uint32_t zigbee_hide_bridge_topic : 1; // bit 11 (v9.3.1.1) - SetOption125 - (Zigbee) Hide bridge topic from zigbee topic (use with SetOption89) (1) uint32_t spare12 : 1; // bit 12 uint32_t spare13 : 1; // bit 13 uint32_t spare14 : 1; // bit 14 diff --git a/tasmota/xdrv_23_zigbee_2a_devices_impl.ino b/tasmota/xdrv_23_zigbee_2a_devices_impl.ino index 775621ffa..1c2b04b63 100644 --- a/tasmota/xdrv_23_zigbee_2a_devices_impl.ino +++ b/tasmota/xdrv_23_zigbee_2a_devices_impl.ino @@ -557,9 +557,17 @@ void Z_Device::jsonPublishAttrList(const char * json_prefix, const Z_attribute_l char stemp[TOPSZ]; strlcpy(stemp, friendlyName, sizeof(stemp)); MakeValidMqtt(0, stemp); - snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%s"), TasmotaGlobal.mqtt_topic, stemp); + if (Settings.flag5.zigbee_hide_bridge_topic) { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s"), stemp); + } else { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%s"), TasmotaGlobal.mqtt_topic, stemp); + } } else { - snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%04X"), TasmotaGlobal.mqtt_topic, shortaddr); + if (Settings.flag5.zigbee_hide_bridge_topic) { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%04X"), shortaddr); + } else { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%04X"), TasmotaGlobal.mqtt_topic, shortaddr); + } } if (Settings.flag5.zb_topic_endpoint) { if (attr_list.isValidSrcEp()) {