Query about white-list/black-list - specifically how to remove devices from the lists, or to fully clear the lists

Hi all,

Having set up my BLE gateway on an ESP32, everything is working as expected apart from the white-list or black-list, when I want to remove devices from them or clear them fully.

The last test I have done was (fully ignoring retaining messages for the time being, until I figure this out :slight_smile:

Add one device to the white-list, so as to only get messages from it

send: {"white-list":["XX:XX:XX:XX:XX:XX"]}

Great, only device XX:XX:XX:XX:XX:XX gets reported, while the monitoring log also shows all other devices present, which don’t get reported.

Then I send an extended white-list

send: {"white-list":["XX:XX:XX:XX:XX:XX","YY:YY:YY:YY:YY:YY"]}

Perfect, from now on, both devices, XX:XX:XX:XX:XX:XX and YY:YY:YY:YY:YY:YY get reported by MQTT, and in the monitoring log as expected.

Now if I want to go back to only one device I tried setting the white-list again to

send: {"white-list":["YY:YY:YY:YY:YY:YY"]}

and the monitoring log correctly shows the new white-list command is being received, but still both previously defined devices get reported.

Ideally I would want to be able to clear devices from the white-list, or fully clear the white-list completely and use a black-list instead at certain times of the day, but currently I’m stuck with the above unexpected behaviour.

I haven’t really gone through the code yet, to see where this deletion of devices might be prevented. Is this the current expected behaviour or is it a known issue?

Any help is greatly appreciated.

Currently, it is only possible to add device(s) to the white or black list. Not to remove them. So as to remove them you may trigger a restart as a bypass.

This is the expected behaviour. We may adapt it depending on the needs.

Thanks for the clarification. That’s what I have done so far, triggering a restart to be able to set a white-/black-list again from scratch.

Just to explain my thinking behind this.

E.g. I have a white-list set with few devices which I use for detecting presence. When those two/three devices are out of range, i.e. no poeple resent, the security system kicks in. During the security alarm state I would clear the white-list and set a black-list with all other know devices around the house, excluding the presensce detection devices. This would not register the know devices in the house, but would register any other devices which might appear in the vicinity during the absence. Once one of the known presence devices shows up again the black-list would be cleared, and only the presence devices in the white-list are registred again, until all of them leave the house again :wink:

Maybe a possibility in some of the future updates, without having to always trigger restarts.

Thanks

Just as an afterthought …

  • Deleting individual devices from white-list/black-list is not really that important
  • But it would be great, that when sending an empty array to the white-list/black-list these get fully cleared, and can then be set afresh with the currently existing commands.
2 Likes