Announcement

Collapse
No announcement yet.

AprilBeacon iBeacons/BLE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Hi AllanMar,

    Is it possible to share your hs script for the Aprilbeacon receiver ?

    Comment


      #17
      Yeah, I would appreciate the script too!


      Some good news: After I asked, it should now be possible to scan for all BLE devices, not just beacons. I'm just waiting for the hardware needed...
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


        #18
        Originally posted by Moskus View Post
        Yeah, I would appreciate the script too!


        Some good news: After I asked, it should now be possible to scan for all BLE devices, not just beacons. I'm just waiting for the hardware needed...
        I havent bothered much with the script, it just parsed the JSON and updated a device. I started making a plugin mainly to attempt to better learn that (using your sample plugin, thanks!). Its still a mess, but I don't know when i'll ever finish it so i'll try and post what I have on github soon.

        What's your plan for using it as a sniffer? I've got some USB BLE sniffers i've thought about interfacing. Ever since I updated the firmware on mine I find Wifi disconnects alot.... I'm still not using these for any real application though.

        Comment


          #19
          Originally posted by AllanMar View Post
          I havent bothered much with the script, it just parsed the JSON and updated a device.
          That's enough for me at the moment.

          Which JSON are we talking about here? I thought it was MQTT? Do they give JSON results too?



          Originally posted by AllanMar View Post
          I started making a plugin mainly to attempt to better learn that (using your sample plugin, thanks!). Its still a mess, but I don't know when i'll ever finish it so i'll try and post what I have on github soon.
          Great!

          Originally posted by AllanMar View Post
          What's your plan for using it as a sniffer? I've got some USB BLE sniffers i've thought about interfacing. Ever since I updated the firmware on mine I find Wifi disconnects alot.... I'm still not using these for any real application though.
          Me and my wife are always wearing Fitbit Ones, and they are continously broadcasting. With several Wireless Recievers the idea is to triangulate our position in the house, for more "user specific" events.
          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
          Running on Windows 10 (64) virtualized
          on ESXi (Fujitsu Primergy TX150 S8).
          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

          Comment


            #20
            The messages are sent via MQTT but the message itself is basic JSON.

            I don't have fitbits but triangulation is tricky. Your main issue will be with how often they transmit a packet. You need to average several packets to get a reliable reading so if it only sends one every few seconds it would take a long time to get a reasonable fix.

            Comment


              #21
              Originally posted by AllanMar View Post
              The messages are sent via MQTT but the message itself is basic JSON.
              Ah, yes, then I understand.

              But if you would share the JSON (or string) parsing script I would appreciate it, as it reduces the amount of work I have to do.

              Originally posted by AllanMar View Post
              I don't have fitbits but triangulation is tricky. Your main issue will be with how often they transmit a packet. You need to average several packets to get a reliable reading so if it only sends one every few seconds it would take a long time to get a reasonable fix.
              I know, it might take several seconds for a new location to be registered. And there are other issues: RSSI triangulation is tricky, as RSSI is log-based, and therefore more unreliable the lower signal strength you have.

              This won't even be remotely close to a motion detector, but that's not the point. The point is to route messages differently and make the house behave different if we are both (or all, inkluding the kids) in the kitchen, in our beds, or outside. Say at night, if we all are upstairs during the night (detected by triangulation) and there's movement in the living room, then please alert us!

              Perhaps sew a few Beacons in to the kids clothes to make me the ultimate "hide and go seek" champion.
              HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
              Running on Windows 10 (64) virtualized
              on ESXi (Fujitsu Primergy TX150 S8).
              WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

              Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

              Comment


                #22
                Any of you have a HS3 script to use with the Aprilbeacon receiver?

                I received mine and it's now working but I have to integrate it with Homeseer.

                I tried with Node-red but I'm unable to extract the data correctly.

                Comment


                  #23
                  I use the MQTT-plugin, if that's what you're asking.
                  HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                  Running on Windows 10 (64) virtualized
                  on ESXi (Fujitsu Primergy TX150 S8).
                  WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                  Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                  Comment


                    #24
                    Originally posted by Mario from Spain View Post
                    Any of you have a HS3 script to use with the Aprilbeacon receiver?

                    I received mine and it's now working but I have to integrate it with Homeseer.

                    I tried with Node-red but I'm unable to extract the data correctly.
                    I started on a plugin to interface them, you can use MQTT plugin + script to decode the values also. My plugin is a bit of a mess, with too many hardcoded values currently. My plan was to clean it up and put it on github (I don't intend to sell/support it), but it may be some time before i get to that.

                    I use the following with Node-red to parse the beacons (in my case to log them to EmonCMS for testing).
                    Code:
                    [{"id":"9646a260.9b6558","type":"function","z":"76b7035.1a2c8fc","name":"Extract Beacons","func":"var bJSON = JSON.parse(msg.payload);\nvar msgArr = [];\nvar id = bJSON.id;\nvar rawBeacons = bJSON.raw_beacons_data.split(\";\")\nfor (var b in rawBeacons) {\n    if (rawBeacons[b].length !== 58)\n        continue;\n    msgArr.push({payload:rawBeacons[b], id:id})\n}\nreturn [msgArr,{payload:{id:id, beacons:msgArr.length}}];","outputs":"2","noerr":0,"x":484,"y":228,"wires":[["5b8b6b04.bcceec"],["d843eff1.23061"]]},{"id":"5b8b6b04.bcceec","type":"function","z":"76b7035.1a2c8fc","name":"Decode Beacon","func":"var raw = msg.payload;\nmsg.length = raw.length;\nmsg.raw = raw;\nvar data = {};\ndata.mac = raw.substring(0,12);\ndata.uuid = raw.substring(12,44);\ndata.major = parseInt(raw.substring(44,48));\ndata.minor = parseInt(raw.substring(48,52));\ndata.power =  parseInt(raw.substring(52,54),16)-255;\ndata.battery = parseInt(raw.substring(54,56),16);\ndata.rssi = parseInt(raw.substring(56,58),16) -255;\nreturn {reciever: msg.id, payload: data};","outputs":1,"noerr":0,"x":728,"y":221,"wires":[["4eb67324.41c76c","3bdcb613.faf0c2"]]}]
                    You can select Import->clipboard in node-red to import them. You feed the MQTT topic into the left and the output of the second node will be payload.rssi payload.mac, etc.
                    Attached Files

                    Comment


                      #25
                      Originally posted by AllanMar View Post
                      I started on a plugin to interface them, you can use MQTT plugin + script to decode the values also. My plugin is a bit of a mess, with too many hardcoded values currently. My plan was to clean it up and put it on github (I don't intend to sell/support it), but it may be some time before i get to that.

                      I use the following with Node-red to parse the beacons (in my case to log them to EmonCMS for testing).
                      Code:
                      [{"id":"9646a260.9b6558","type":"function","z":"76b7035.1a2c8fc","name":"Extract Beacons","func":"var bJSON = JSON.parse(msg.payload);\nvar msgArr = [];\nvar id = bJSON.id;\nvar rawBeacons = bJSON.raw_beacons_data.split(\";\")\nfor (var b in rawBeacons) {\n    if (rawBeacons[b].length !== 58)\n        continue;\n    msgArr.push({payload:rawBeacons[b], id:id})\n}\nreturn [msgArr,{payload:{id:id, beacons:msgArr.length}}];","outputs":"2","noerr":0,"x":484,"y":228,"wires":[["5b8b6b04.bcceec"],["d843eff1.23061"]]},{"id":"5b8b6b04.bcceec","type":"function","z":"76b7035.1a2c8fc","name":"Decode Beacon","func":"var raw = msg.payload;\nmsg.length = raw.length;\nmsg.raw = raw;\nvar data = {};\ndata.mac = raw.substring(0,12);\ndata.uuid = raw.substring(12,44);\ndata.major = parseInt(raw.substring(44,48));\ndata.minor = parseInt(raw.substring(48,52));\ndata.power =  parseInt(raw.substring(52,54),16)-255;\ndata.battery = parseInt(raw.substring(54,56),16);\ndata.rssi = parseInt(raw.substring(56,58),16) -255;\nreturn {reciever: msg.id, payload: data};","outputs":1,"noerr":0,"x":728,"y":221,"wires":[["4eb67324.41c76c","3bdcb613.faf0c2"]]}]
                      You can select Import->clipboard in node-red to import them. You feed the MQTT topic into the left and the output of the second node will be payload.rssi payload.mac, etc.
                      Thank you!

                      A adapted this code to my system and it's working now. :-)

                      Now I have to find some small BLE tracker devices that doesn't turn off by them selves and that keeps transmitting beacons.

                      Comment


                        #26
                        Originally posted by Mario from Spain View Post
                        Thank you!

                        A adapted this code to my system and it's working now. :-)

                        Now I have to find some small BLE tracker devices that doesn't turn off by them selves and that keeps transmitting beacons.
                        I've had good luck so far with the AprilBrother ones (cheap) which this topic was started for. Are these not working for you?

                        Comment


                          #27
                          Originally posted by AllanMar View Post
                          I've had good luck so far with the AprilBrother ones (cheap) which this topic was started for. Are these not working for you?
                          I tried with these: http://bbs.aprbrother.com/uploads/de..._1_500x500.jpg

                          Really cheap but they turn off after some minutes if not paired. :-(

                          A shame as they cost about $3 only.

                          Comment


                            #28
                            Originally posted by Mario from Spain View Post
                            I tried with these: http://bbs.aprbrother.com/uploads/de..._1_500x500.jpg



                            Really cheap but they turn off after some minutes if not paired. :-(



                            A shame as they cost about $3 only.


                            Are these not beacons? I've never used a beacon paired? I don't have those but I've used the larger ap brother beacons without issues.

                            Comment


                              #29
                              I'm not very sure. I bought these thinking theory where beacons.

                              I think I'll have to do some more research in all this.

                              Comment

                              Working...
                              X