node-red-contrib-xiaomi-ble icon indicating copy to clipboard operation
node-red-contrib-xiaomi-ble copied to clipboard

How data is retrieved from the sensors?

Open 0xgrm opened this issue 5 years ago • 8 comments

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.

0xgrm avatar Mar 15 '19 16:03 0xgrm

Plugin connects to sensors and requests data from them

eschava avatar Mar 15 '19 16:03 eschava

Is there a way you could possibly scan the data passively, as in the homebridge hygrothermograph plugin?

0xgrm avatar Mar 15 '19 16:03 0xgrm

Sorry, what do you mean by "passively"? AFAIS, Homebridge uses similar code for requesting data from sensors

eschava avatar Mar 15 '19 16:03 eschava

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.

0xgrm avatar Mar 15 '19 16:03 0xgrm

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

eschava avatar Mar 15 '19 16:03 eschava

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.

0xgrm avatar Mar 15 '19 16:03 0xgrm

@uryupinsk I've implemented a pair of nodes that do it in this manner:

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.

sjroe avatar Oct 27 '19 22:10 sjroe

This has never been implemented, right? Passive scan is much more battery friendly.

dingausmwald avatar Nov 22 '21 13:11 dingausmwald