[breaking] Refactor the BLE devices identification (#720)

* [breaking] Refactor the BLE devices identification

generalize the use of the mac address with : for the lists, white, black and internal identification
Move structures from config_BT.h to ZgatewayBT.ino
update doc

* Move minRssi to INO and optimizations

change Minrssi name to match other variable convention
Optimize the add of : to mac address
Reduce the use of abs()

Note: I cannot move BLEinterval to the ZgatewayBT.ino due to its use on main.ino
This commit is contained in:
Florian authored and GitHub committed 2020-08-04 12:03:22 -05:00
1 parent d4457f817a
commit 8d79bebab8
3 files changed
+67 -82

No files matched your search

+3 -3
View File
@@ -60,17 +60,17 @@ OpenMQTTGateway publish the servicedata field of your BLE devices, with HM10 thi
## Setting a white or black list
A black list is a list of mac adresses that will never be published by OMG
to set black list
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"black-list":["012314551615","4C6577889C79","4C65A6663C79"]}'`
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"black-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`
A white list is a list of mac adresses permitted to be published by OMG
to set white list
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["012314551615","4C65A5553C79","4C65A6663C79"]}'`
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`
Note: if you want to filter (white or black list) on BLE sensors that are auto discovered, you need to wait for the discovery before applying the white or black list
::: tip
So as to keep your white/black list persistent you can publish it with the retain option of MQTT (-r with mosquitto_pub or retain check box of MQTT Explorer)
`mosquitto_pub -r -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["012314551615","4C65A5553C79","4C65A6663C79"]}'`
`mosquitto_pub -r -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`
:::
## Setting the time between scans and force a scan