diff --git a/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino b/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino index 5e85a7841..8b04993da 100644 --- a/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino +++ b/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino @@ -117,6 +117,7 @@ struct { uint32_t showRSSI:1; uint32_t ignoreBogusBattery:1; uint32_t minimalSummary:1; // DEPRECATED!! + uint32_t onlyAliased:1; // only include sensors that are aliased } option; } MI32; @@ -922,6 +923,13 @@ int MI32advertismentCallback(BLE_ESP32::ble_advertisment_t *pStruct) const uint8_t *addr = pStruct->addr; if(MI32isInBlockList(addr) == true) return 0; + if (MI32.option.onlyAliased){ + const char *alias = BLE_ESP32::getAlias(p->MAC); + if (!alias || !(*alias)){ + return; + } + } + int svcdataCount = advertisedDevice->getServiceDataCount(); if (svcdataCount == 0) { @@ -2120,6 +2128,9 @@ void CmndMi32Option(void){ case 4:{ MI32.option.ignoreBogusBattery = onOff; } break; + case 5:{ + MI32.option.onlyAliased = onOff; + } break; } ResponseCmndDone(); }