OK here is how i do the where is family by request.
- create a virtual switch in Smartthings for each person that you wan to know their location on demand I named mine 'virtual presence request tom, virtual presence request Kim, etc.
- share those switches with webCore so that you can use them.
- i use google home for my requests, but you can use Smartthings app to turn the individual switch on, when you want to know someones location. i have set up shortcuts in google home so when i say "where is tom, it turns the virtual switch on.
- you need to get an API key for google distance matrix API and one for the geolocation API
you can get the keys by going to the following websites:
- follow the instructions on how to create an API key for each. once created copy these and save them somewhere. you will need them later.
- in webCore create a few global variables :
@GoogleMapsDriveTimeApiKey = enter the key you created earlier
@Google_Maps_Api_Key = enter the key you created earlier
@GPS_Home = enter in the GPS location of your home (latitude,Longitude)
@LongState= Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Maryland,Michigan,Minnesota,Mississippi,Missouri,Montana,Nebraska,Nevada,New Hampshire,New Jersey,New Mexico,New York,North Carolina,North Dakota,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Texas,Utah,Vermont,Virginia,Washington,West Virginia,Wisconsin,Wyoming
** note ** the longstate and shortstate are used to convert the shortstate text to a long version. this allows there wording to be used by speakers when using text to peach commands from webCore
- import the following piston and use as needed. your results may vary but it works great from my side.
my actual presence sensors are named presence tom, presence kim, etcl that is why when you look at this code it is replacing the word presence with a ’ ’ so when outputing the result to speakers it would not say the word presence. change that to your circumstance.