This flow will use noBLE node to scan LE devices and activate a switch (or a variable) in Domoticz server using MQTT topic domoticz/in
There is a context array containing the tag devices Mac Addr and configuration. For each tag you can choose:
- Activate a switch
- Change a variable value (HOME/AWAY)
- Put in a variable the RSSI value (rssi/AWAY)
#CONFIGURATION
the configuration context array (included in the InitialConfig node) should be populated with these info:
- [0] MAC Address
- [1] Friendly (flow Context display) Name
- [2] Domoticz MQTT switch IDX
- [3] Domoticz Switch Update (true or false) On/Off
- [4] Domoticz MQTT Variable IDX
- [5] Domoticz Variable Update (true or false) HOME/AWAY
- [6] Domoticz Variable RSSI Update rssi/AWAY add as many tags as you need just remember that:
- BLE devices normally stop to be discoverable if paired
- default BLE interface (hci0) should NOT be used in any other scripts or ssh/terminal usage, it became unstable and unusable until next reboot
On starting the flow the configuration array is created then another input will toggle between true and fase and activate/deactivate the scan LE node Timer is set to 1min, this works fine, you can change it, but be aware that values less than 40secs gave me some false results during the ON-scan window the LE node will gater all available mac address in the air. if it match with the configuration array then a mqtt telegram is created and sent to domoticz accordingly to the configuration, plut it sets a context variable to TRUE to notify the tag has been found
During the OFF-scan window the context variable are scrolled: if they are setted to FALSE (le not found) it pack an AWAY telegram to the MQTT server
On top of all there is a RBE node to prevent multiple messages with the same content (ie: it is useless to send an AWAY telegram every minute....) the RBE is reseted every day
Tested with NutSpace nutMini and Tile ble devices