node-red-contrib-xiaomi-ble
node-red-contrib-xiaomi-ble copied to clipboard
How data is retrieved from the sensors?
Hi,
I'd want to know if the values are red passively from the sensors or if the plugin explicitly connect to them for updating values.
Thanks.
Plugin connects to sensors and requests data from them
Is there a way you could possibly scan the data passively, as in the homebridge hygrothermograph plugin?
Sorry, what do you mean by "passively"? AFAIS, Homebridge uses similar code for requesting data from sensors
By passively, I mean not to connect to the BLE devices. Just:
-
Scan for BLE devices.
-
Check the broadcast advertisement packet.
-
Look for the Service Data UUID to check the sensor type and all data.
By doing this, there is no need to connect directly to the BLE devices, thus greatly improve efficiency and battery life of the sensors. I unfortunately don't have the skills to do it correctly.
I like the idea and have found this information at the link you mentioned OK, will try to implement this as an additional option at the nearest time
Glad you find this interesting! This is by far the best method but only the homebridge plugin I mentioned seems to do it, and only for the temperature sensors, not MiFlora.
Please let me informed of your avancements here. Me and a friend would love to try and help you add this functionality.
@uryupinsk I've implemented a pair of nodes that do it in this manner:
-
node-red-contrib-ble-scan - this is a generic noble based node that simply continuously scans and presents the discovered peripherals as the
msg.payload
-
node-red-contrib-mijia-filter - this utilises the parser from the homebridge-mi-hygrothermograph plugin that you referenced to present the broadcast package in the
msg.payload
Simply link the above two nodes. In my flows I then have the output of the filter node going into a switch node to split the outputs by MAC address.
This has never been implemented, right? Passive scan is much more battery friendly.