Homey Community

Beacon - An app for presence detection using BLE beacons

app
tools

#1

image

Beacon

Links:

https://apps.athom.com/app/com.koktail.beacon

Introduction

This app integrate the basic flows for BLE beacons into Homey. Once the app is installed it will do a discovery of BLE devices, after a short adjustable timeout it wil keep discovering. After each discovery the app compares the found devices with the one paired. If the beacon is not found within the new “discovered list” the beacon is changed in state.

For filtering out false positives there is a verification amount inside or outside the range available in the settings. This setting is the amount of times the beacon needs to be changed before it wil marked as such. The amount will be reset if the beacon is not in that current state.

Do you like the app? You can make me happy by buying me a beer!

Q&A

Q1 Why is the beacon marked ‘outside range’ when i use the beacon with my phone?

If a BLE beacon is connected to a device (phone) it cannot be discovered anymore and the app set the device as away. You can prevent this by removing the app from your phone.

Q2 Why is the beacon marked ‘outside range’ after a couple of minutes?

Your beacon is powering down for saving energy. Sometimes this is configurable by the manufacturer his software.

Supported devices:

  • Generic BLE beacon (every BLE device that is public discoverable)

Tested devices

Here is a list of used devices

  • Tile Pro (8m)
  • Tile Mate (8m)
  • Nordic nRF51822 (5m)

Usage

  1. Install app
  2. Make the device discoverable.
  3. Add device(s) to Homey.
  4. Make a flow with one of the cards.

Settings

There are some settings to improve and tweak the apps behaviour.

NOTE: Changing this settings can result into an unstable situation.

Update settings

The delay between reading sensor values in seconds. (default 10 seconds)

Discovery timeout

The amount of seconds that is given to discover the beacons. (5 seconds)

VerificationAmountInside

The amount of verifications the app need to mark a beacon inside the range. (1 time)

VerificationAmountOutside

The amount of verifications the app need to mark a beacon outside the range. (5 times)

Cards

An overview of all the trigger cards that can be used

Triggers
(Global) A beacon detected state is changed (beacon name, detected)
(Global) A beacon is inside range (beacon name)
(Global) A beacon is outside range (beacon name)
(Global) A beacon has been discovered (beacon name, uuid)
(Global) The app generates a log (log)
(Device) The beacon detected state is changed (beacon name, detected)
(Device) The beacon is inside range (beacon name)
(Device) The beacon is outside range (beacon name)

History

v1.0.0 - 04.10.18

  • first alpha to app store.

v1.0.1 - 05.10.18

  • add support for NRF51822
  • add app icon
  • refactoring the drivers

v1.0.2 - 07.10.18

  • add trigger card for discovered devices
  • add icon for discovery

v1.0.3 - 07.10.18

  • add generic device

v1.0.4 - 20.10.18

  • add verify process for detect/undetect events

v1.0.5 - 07.10.24

  • improve discovery of the devices
  • change card description

v1.0.6 - 07.10.24

  • improve by connection and find the advertisement

v1.0.7 - 07.10.24

  • bump version

v1.0.8 - 07.10.25

  • improve sequence update beacons
  • get peripheral for accurate range
  • change timeout to 1 second
  • improve logging to the app
  • add retry strategy

v1.0.9 - 07.10.25

  • bump version

v1.0.10 - 07.10.27

  • introducing timeout and verification settings
  • revert back to discovery strategy to improve speed
  • add translations
  • improve logging

v1.0.11 - 07.10.27

  • mismatch variable name bug
  • also check on bigger that the amount if app restarts

v1.0.12 - 07.10.30

  • add default values in settings
  • change comparator typo

v1.0.13 - 07.11.01

  • fixed change detect comparison mismatch
  • add log handler to watch false positives
  • fixed zero verification times

v1.0.14 - 11.11.01

  • add homeyCommunityTopicId
  • add version number app for logging
  • add triggercards detect state changed

Final note

The repository is available at: https://github.com/koktaildotcom/com.koktail.beacon


[Tutorial] Presence detection with bluetooth beacon
[Tutorial] Presence detection with bluetooth beacon
[Tutorial] Presence detection with bluetooth beacon
[Tutorial] Presence detection with bluetooth beacon
#2

A tutorial can by found here:


#3

Would a iPhone work as beacon?


#4

A couple of us have attempted with iPhone6 - and it has not worked.


#5

Apple does not allow that.


#6

Too bad, this would improve the WAF


#7

I’m curious, what BLE devices are you using, and what is the approximate range?


#8

a keeper from Gigaset does work, but minew’s C6, not why? In both are the same chips. And why only 8m. They have more power.


#9

“Any iOS device that supports sharing data using Bluetooth low energy can be turned into an iBeacon”
https://developer.apple.com/documentation/corelocation/turning_an_ios_device_into_an_ibeacon

Problem is that it’s only supported for apps that run in the foreground.


#10

I’ve just released new alpha version:

v1.0.14 - 11.11.01

  • add homeyCommunityTopicId
  • add version number app for logging
  • add triggercards detect state changed

#11

Are there people that use the app with another beacon as described in the readme?
Will you please share your experience of the range in the app’s topic? That way other people can make a good choice of using the correct beacons.


#12

I use the Tile Mate, certainly reach 8 meters


#13

Thanks for sharing, i’ll add it to the readme


#14

I have added my Somfy One fobs. I’m not sure of the range but is OK to detect when someone is home. Best presence detection I have found so far. Very quick to detect when someone arrives but takes a few minutes to be sure someone has left as they only broadcast every 2 to 3 minutes.
Maybe the Somfy One triggers them when a door opens and then randomly to see if still there.


#15

does it work with Lapa?

I’ve tried it yesterday but couldn’t add a beacon “Cannot get devices:No devices found.”

Lapa 2 is connected to my mobile device and works…


#16

That is designed as intended.

Like the description in the app say:

For filtering out false positives there is a verification amount inside or outside the range available in the settings. This setting is the amount of times the beacon needs to be changed before it wil marked as such. The amount will be reset if the beacon is not in that current state.

The default are:
inside amount = 1
outside amount = 5

The difference of this is that if your beacon will trigger out of range (en checks the inside change amount), it will never be detected falsly because it will never by found.


#17

You should disconnect your device from your phone because it isn’t public discoverable anymore that way.


#18

The purpose of my post was to let people know it works with the Somfy One fobs with those limitations caused by the fob. Your App is working perfectly and I used the settings to overcome those limitations. I hope it didn’t give the impression that I was unhappy with the App as I think you have done a great job.


#19

Thank you, that helped!


#20

I’ve never have that experience with the beacon app. Have you tried to remove and add the beacons again? Have you tried to restart the app again? Have you tried to reboot homey?

What settings do you use for:

Update settings
The delay between reading sensor values in seconds. (default 10 seconds)

Discovery timeout
The amount of seconds that is given to discover the beacons. (5 seconds)

VerificationAmountInside
The amount of verifications the app need to mark a beacon inside the range. (1 time)

VerificationAmountOutside
The amount of verifications the app need to mark a beacon outside the range. (5 times)

You can try to use a discovery timeout of 10 seconds, that way Homey has more time to discover the devices.

Note: We are spamming the tutorial topic, if there is a problem try to use the app’s topic: Beacon - Using BLE beacons for presence detection


Thank you for the help.

I did a reset of the APP (and the Homey). Re-added the beacons. Re-installed the Beacon APP. But no luck.

I’m using the standard settings.

But they only give 1 status update (in range) and when a remove the batterij it still says in range. Offcourse i waited more then 10 sec * 5 (checks).

Any idea how we can debug this?