Using Android Location as a presence device!


(Daniel Consuegra) #1

Hi all!

Just a thought…

I dunno about you but the folks around me all use Android phones…

Android AFAIK has location based services built in… no need for extra software, and they seem to be getting better… using Wifi/Bluetooth as a means to get even better location…

Anybody here know if/how I could get it to work?

What I’d like to do is have a presence device for say, Mom, who wouldn’t need to install the ST app or Life360, but use her Google account’s location.

Any ideas?

I’m willing to be a guinea pig if anyone helps! :smiley:


(Tim Slagle) #2

Something needs to be installed to interface with STs.


(Daniel Consuegra) #3

True… but I was thinking something along the lines of Android’s location settings…


(Kristopher Kubicki) #4

I always thought this was how the app worked already… !


(Tim Slagle) #5

I think thats a samsung thing no a android thing and i have never understood how its actualy supposed to work


(Chuck Pearce) #6

All apps hook into Android’s location services, the reason for this is

  1. Only one connection can be made to the GPS module at a time
  2. Prevents polling from multiple apps that may be processing the same data
  3. Allows smart logic to be applied to polling for coordinates such as aggregating accelerometer data.

It sounds like what you are talking about is that Android (Google) should push this data to one location where it can be accessed by multiple consumers. They do have this, it is called Google+ (Formerly Google Latitude), however most people do not want Google to archive their location data points, nor do they really want ST to do this. So ST has chosen to have their application access Android’s location service and process the events locally on the phone then send that notification of breaching a geofence to the ST API.

In the Google+ method they would have to constantly poll their API for changes to the location or setup a callback to be notified when a geofence breach occurs (not even sure if this is possible on the Google+ API). Added to the fact that Google has been changing their location APIs heavily over the past few years, developers are not quick to jump on using any Google geo-reporting services.

I believe at a minimum we need read-only and control-only users implemented into ST, where they can only view status of switches/sensors, and in the case of control-only can not actually install apps/things or modify smartapps/things. I think most of us would have our spouses/children on the control-only accounts. I understand you concern, she doesn’t want a full tracking app like Life360, and you don’t want her to be able to mess up what you have setup in ST.


(Chuck Pearce) #7

Oh and I just looked at the image, yes @tslagle13 is correct, that is to do with Samsung’s rehash of Android. It is likely part of their “Connection Optimizer” package they install. Google does something similar but it is part of “Google Now” (They keep moving this stuff around) and only have Work and Home.


(Joshua Lyon (SharpTools.io Dashboard)) #8

I agree with the idea behind this - it would be nice to have guest users with more limited capabilities than a normal full access user built directly into the app.

While I would love to see some improvements to the presence detection that is natively built into SmartThings, if you don’t want to use Life 360 and you want to have more control of your presence detection using the Android location provider, there are other options.

I wrote an app called SharpTools which provides Widgets and Tasker integration for SmartThings (on Android). Some users have been using this to build a custom presence detection device and I wrote up some basic instructions explaining the concept:

This solution is more for tinkerers than your average user. That being said, I wanted to at least comment to provide awareness that there are alternative location/presence solutions.


(Tim Slagle) #9

Yep, but they do this for only google now. Only google now can hook into that api.


(Daniel Consuegra) #10

You guys are awesome!

There’s a lot here for me to think over in the next couple of days!

@joshua_lyon I’ll look up your app and use it!

Thanks a lot guys!


(Carson Dallum) #11

Wholeheartedly agree that ST needs accounts with different levels of access/capabilities. As previously mentioned I could see three levels of access: an administrator that can do everything (e.g. install, uninstall, add/remove users, control devices, etc.), a controller that can both view and control devices installed by an administrator, and a guest that has very limited capabilities, likely only presence, receive some notifications and view status of devices.


(Daniel Consuegra) #12

alternatively… how would you guys go about using BLUETOOTH as a presence sensor? Any ideas? that way there wouldn’t be any need for apps to install…

AND it would help those not-so-tech-savvy… (I’m thinking mom, parents-in-law, even SISTER-in-law… at least in my case)…


(Chuck Pearce) #13

I don’t believe there is BT hardware in the ST v1 hub. I know they added it in the v2 hub but I don’t think it is a possibility unless you make an android device a listener or use an arduino with shield to be the sensor.

Though I am not sure you would be very happy with BT (non 4.0) presence since it doesn’t have very good penetration power especially when compared to ZigBee.


(Patrick Stuart [@pstuart]) #14

I proposed back in July that ST use wifi connection as a much more reliable presence detection instead of GPS or as an option.

They can easily poll the system for wifi, or even subscribe to the network change subscription and check if it is a wifi AP and if the home AP, then location is home.

This would be insanely easy to implement, I’ve already done it in tasker.

Why it never got prioritized given how broken Android presence is and will continue to be is beyond me.


(Daniel Consuegra) #15

How about having bluetooth beacons? I heard somewhere that you can program those to go to a webpage… from there it would be just a matter of feeding the systems some variables that identify the user and presto!

EDIT:

Or is that dreaming too far?