Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Presence check with BLE tags, beacons


Recommended Posts

Hi! 

 

I wanted to share my solution for presence check using BLE tags or beacons, whatever you name it. 

 

I have Raspberry Pi 3 B+ (built-in bluetooth). I've written Node.js script using Noble (https://github.com/noble/noble) and Node Fibaro API (https://github.com/leeroybrun/node-fibaro-api). 

 

Noble is responsible for searching for the beacons. 

Please login or register to see this code.

foundBeacon provides some useful information such as RSSI or mac address of the beacon. 

 

Node Fibaro API is responsible for communicating with HC2. Current version of the Node Fibaro API module gives you only the tools to send GET request to the HC2. And I couldn't find a way to pass parameters to my HC2 presence scene with scan results with GET and I found the scene solution most convenient for me. So I implemented my solution for POST request support.

Please login or register to see this code.

The pull request with my solution is waiting for approval from the author to be merged. 

 

Here you've got a little proof of concept that it works.

Beacon in my pocket, Wall Plug with a lamp plugged in and a simple scene - if I am (my beacon) at home then turn on the light. Otherwise turn it off. 

Please login or register to see this link.

 

You can see that this solution is extremely responsive. I've never achieved that kind of responsiveness and stability from ARP table check or open port ping on my iPhone. 

For testing purposes I set RSSI level a bit low so Pi can find the beacon only when I am close to it. Normally when Pi is approximately in the center of the house the Pi is able to find the beacon in the 160 meters squared home (including first floor). 

 

Another important thing... The Pi find the beacon in range almost instantly. To make sure that there are no false away states I set the "exit grace period" for 30 seconds for normal use. It's enough to make sure that Pi will have the time to find the beacon constantly when you're at home. I didn't get a single away state for the whole day and night when I tested it. 

 

Feel free to ask me any questions about that topic! I would be more than happy to help. 

  • Like 1
Link to comment
Share on other sites

@Jacławiciel

Yeap, BLE is extremely accurate as long as the beacon is in range.  But for huge house this solution may not work.

I am following below solution with iNode ibeacon which can be configured its power, RSSI etc via its windows app.

 

 

Edited by Sirhideo
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...