BLE Scanner for only 1 MAC Adress

Hello everybody,

the program works very well, but I have a problem, when the scan is performed it reports all MAC address / ID / RSSI / etc. to the same items. Is there a way that it only filters a specific MAC address (from a g-tag / iBeacon) and sends its information to MQTT?

Something like a whitelist for MAC-Adress?

At the Moment i get every scan:

home/presence/BLEGateway {“id”:“52:f4:d0:6a:89:e4”,“manufacturerdata”:“L”,“rssi”:-85,“distance”:15.12852}
home/presence/BLEGateway {“id”:“c0:28:8d:55:80:90”,“manufacturerdata”:“”,“rssi”:-93,“distance”:30.15532}
home/presence/BLEGateway {“id”:“45:1b:2f:d6:7d:f2”,“manufacturerdata”:“L”,“rssi”:-87,“distance”:18.07764}
home/presence/BLEGateway {“id”:“78:3e:e4:77:2b:27”,“manufacturerdata”:“L”,“rssi”:-84,“distance”:13.81901}
home/presence/BLEGateway {“id”:“c4:7c:8d:6a:36:a8”,“rssi”:-81,“distance”:10.46739}
home/presence/BLEGateway {“id”:“7c:2f:80:8e:xx:xx”,“manufacturerdata”:“▒4▒▒▒Ȼ▒”,“rssi”:-75,“distance”:5.832737}

but i only need this one:

home/presence/BLEGateway {“id”:“7c:2f:80:8e:xx:xx”,“manufacturerdata”:“▒4▒▒▒Ȼ▒”,“rssi”:-75,“distance”:5.832737}

regards Daniel

Hello,

I’m planning to add this feature to the next release, wait a little bit and you will have it :wink:

Is this still in the queue? I’m guessing this option is the whitelist option. But I’m not sure how to implement. My ultimate goal is to set only MAC addresses in the whitelist to publish to MQTT. I understand that using a retained message will make the whitelist sticky. What I don’t understand is how to block all other devices. Will a single addition of a MAC to the whitelist block all other MACs from publish? Then, later if needed, I add another MAC , i.e. 2 MACs, in the retained command, only those 2 MACs are published?
TY

Hi jdabramson,

Yes, with the white-list (since 0.9.1) you can define only the MAC addresses which you want published to MQTT messages. All non white-list MAC addresses will not be published to MQTT, if that’s what you mean by being blocked. And yes, if you want to extend the white-list you can just add MAC addresses at a later stage.

Have a look at the relevant section in the docs

All the best.

2 Likes

How does one clear the black-list and/or the white-list? That is, how does one revert back to initial behaviour of no filtering at all, ideally without having to power cycle/reset the Gateway hardware?

Hi, for the moment restarting the gateway is the only way, and making sure you haven’t set the retain flag on the white-list command, as it’ll be applied again after the restart.

2 Likes

I am not able to get the whitelist working. My config node looks like this:
{
“white-list”: [
“7C:2F:80:C7:F7:43”,
“FF:FF:10:09:52:BE”,
“FF:FF:10:09:47:62”
]
}

But OMG does still publish data for all devices it sees.

The devices are published unter \BTtoMQTT and the config is published under \commands\MQTTtoBT\config

What do I miss?

Hi @Jan_Gatzke,

Could you put your white-list into Preformatted Text quotes, so that we can see exactly how they look, especially with the quotation marks. In your posting they look curly, this could be because of pasting here without putting it in Preformatted Text, or it could actually be your problem, that you have *curly quotes when you try sending the white-list, as they need to be straight double quotation marks.

vs. "

Also not too sure if the extra space between the colon and the first square bracket matters. I somehow doubt it, but all best seen when you show us the text in Preformatted Text.

Hope this helps.

Thanks for your replay. This is how it looks:

{
  "white-list": [
    "7C:2F:80:C7:F7:43",
    "FF:FF:10:09:52:BE",
    "FF:FF:10:09:47:62"
  ]
}

I habe copied the command from the OMG website. My MQTT broker is iobroker. Could this be a problem?

The space works fine for me here, but I don’t know what (invisible) line breaks or possible tabs you might have. So try with it all on one line - no spaces.

{"white-list":["7C:2F:80:C7:F7:43","FF:FF:10:09:52:BE","FF:FF:10:09:47:62"]}

What are you using to send the command, command line, MQTT Explorer…?

I am using MQTTLense.
I just checked my settings again and as it seems the whitelist started to work. This is strange because I did not change the config, yet. Is just deleted the unwanted notes and this time they were not recreated.

Glad to hear it is working for you now :slight_smile: