BLE motion sensor via BTHome
-
I'm trying to connect a Shelly BLU Motion sensor to an M5StickCPlus (as a BLE server). I'd like to trigger GPIO events on the M5 as well as send commands to another BLE device (BLE relay and/or BLE light) when motion is detected.
I managed to pair the sensor to my phone and get info from it using the app nrf Connect, but I'm kind of stuck on how to incorporate it in UIFLOW2. I guess I would need to initiate some kind of pairing between the two?
I think BTHome would be easiest to implement, since it's standardized and not encrypted,I guess it would be enough to read the UUID for the unencrypted BTHome data: "d52246df-98ac-4d21-be1b-70d5f66a5ddb"
An example of the data received for that UUIDis: "(0x) 44-00-71-01-64-05-A4-32-01-21-00", where two last bytes seem to be the motion sensor (21) and it's status (00 for not active). So, then if that data is parsed and only the last byte used, I guess i would know the status.Has anyone managed to pair a BLE sensor to an M5Stack product?
Info on Shelly BLU Motion: https://shelly-api-docs.shelly.cloud/docs-ble/common
and https://shelly-api-docs.shelly.cloud/docs-ble/Devices/motionInfo on BTHome: https://bthome.io/format/
-
Hello Oscar...
For connect M5stack to Shelly BLU:
And you can see an example in: https://community.m5stack.com/topic/6737/receiving-response-from-ble-server
I hope it can be of use to you.
Best regards.
-