Android Presence using Beacons/Autolocation/Sharptools

I have created an app that uses several tools to determine overall and precise locations within the house using beacons. This uses very little power and should be relatively simple to setup. The files are located here: https://github.com/mlebaugh/TaskerBeacons

if you have the following apps.

How this works, uses Autolocation and wifi connected to determine if you are home. Basically the same as this post This will then set a smartthings presence sensor “User Home” to present. Once the user is home the app will wait for you to walk, once you start walking it will scan for beacons. The beacon radar app reports every ping back to tasker. Tasker will not scan continuously while walking, but every few seconds. Auto tools will then average all of the pings to determine the average RSSI (recieved signal strength indicator). Whichever Beacon’s avg rssi is closest and with the most number of pings is the location. Once you stop moving this will continue to scan for several seconds. when a new beacon is selected as the Location the presence sensor for “User BeaconName” will be set to present and all others will be not present.

BeaconRadar used to scan for beacons
Tasker XML / Beacons.apk
AutoTools used to make easy dialogs/average large numbers
AutoLocation used for geofencing
SharpTools used to update presence

Beacon Radar

  • Check the permissions for this app… it seems the developer did not check permissions for Location. Android Settings >Apps >Permissions, enable Locations.
  • Do a scan to find your Beacon, press the play button, you’ll want to stop this after your beacons are seen.
  • At this point you may want to also block notifications from this app.
  • Tap the beacon that was found and name it to the Room or Location you plan to use. Example: Basement, Bedroom, etc
  • Scroll to the bottom and enable broadcast intent on visible only.
  • Go to the settings
  • Set all three (foreground, background, device locked) cycle timing to
    • Interval: 24h
    • Duration: 10000ms
    • The other settings don’t matter in this use case. These settings are because we will not be using Beacon radar’s scanning/scheduling services and use one that we can control within tasker.

Auto Location

  • Open Autolocation and create two geo-fences
  • “Home-inner”
    I use a radius of 200 meters
  • “Home-outter”
    I use a radius of 1500 meters

Auto-Tools

  • Only install no config needed

Smartthings

  • Login to the ide
  • Devices, new devices
  • Name: Use the format User Location, for example Matt Basement
  • Device network id: some value i use mattbase
  • Type: simulated presence sensor
  • Create Presence devices for each user and room
  • Create an overall Presence sensor for the user this must be User Home, ex: Matt Home
    you must have a device for each user that is User Home and a device for each user and room.
  • Two user, two room setup would look like
    User1 Home
    User1 Room1
    User1 Room2
    User2 Home
    User2 Room1
    User2 Room2

Sharptools

  • Authorize all of the devices you created

Beacons app/Tasker

  • Using the Tasker xml
  • Load the project, run the Beacons task.
  • Follow steps for the APK
  • Using the Beacons.apk **turns out i can’t upload the apk to this
  • Install the app.
  • Enter the user for the app
  • Enter the wifi for your home
  • Enter the Locations - this must match exactly the name of the beacons you setup in beacon radar, if you have multiple separate by comma.
  • Thats it - you may want to scan now to set your current room, or get up and walk and few steps…

The end result should look like this:


Some notes:

I have no idea if this will work for you, I did my best to make it as easy as can be…

If your beacons are configurable, like rad beacons, you can set the uuid major/minor to the same as another beacon. In my living room and basement I use 2 beacons in each room because they sit on top of each other.

I use this within tasker and my wife uses the apk so either should work. The reason I stay in tasker is because I use %Location for other phone automation. Like if I’m in the Bedroom after x time silence phone. [details=Summary]This text will be hidden[/details]

6 Likes

This is a very cool use case for SharpTools and Tasker - thanks for sharing the project!

1 Like

What kind of beacons are you using?

This is very cool indeed and I’m thinking of ways to make this work with EchoSistant.

@SBDOBRESCU

1 Like

Radbeacons are the ones I used. they are very configurable and support ibeacon,altbeacon, and eddystone.

2 Likes

What is the smallest beacon available that I might be able to play with? I want to attach one to our dog’s collar so we know if she’s up to no good lol.

1 Like

Radbeacons are about the size of a quarter and about 5-5 quarters tall.

Unless you have something that would scan for the beacons (like a rPI or a spare tablet that is stationary) I’m not sure how this would track the dog.

This setup is designed for keeping the beacons stationary and the scanner(phone) mobile.

Thanks, that’s the objective, set up something to do the scanning. I have the rpi hardware to do it just haven’t gotten the beacon. I should probably ready up on what’s available now as far as scanner.

@mlebaugh, which model are you using for the beacons? the dot or the usb? any preference?

1 Like

I am using the dots. Though the USB ones would work too without battery concern. I use the default settings for the dots. At that default advertising rate the batteries should last around 90 days. If you don’t have overlapping beacons you can probably reduce the advertising rates to increase battery life.

I can’t get the beaconradar app to find my radbeacon. I can connect to it in the radbeacon app though.

The beacons app does not seem to work anymore.
Please update.