🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    BLE motion sensor via BTHome

    UiFlow 2.0
    2
    3
    439
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      OscarE
      last edited by

      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/motion

      Info on BTHome: https://bthome.io/format/

      1 Reply Last reply Reply Quote 0
      • C
        Calvorotas
        last edited by

        Hello Oscar...

        For connect M5stack to Shelly BLU:

        2cd939a7-3d8e-43fb-924e-7fb51cdbfda4-image.png

        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.

        O 1 Reply Last reply Reply Quote 0
        • O
          OscarE @Calvorotas
          last edited by

          @Calvorotas

          Thanks a lot!

          I'll give it a try right away :)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post