Been trying to get presence detection working!

This is all from memory so hopefully I get everything. :wink:

  1. Mobile. Load Locative app.
  2. Hub. Create a Virtual device and allocate 'Virtual Presence' as the type.
  3. Hub. Install the built in app 'Maker API' if you haven't installed it already.
  4. Hub. Open maker api and select your virtual presence sensor. Click done.
  5. Hub. Open maker api and scroll down to 'Cloud URL's'. Copy the url under Get Device Commands (replace [Device ID] with actual subscribed device id.
  6. Hub. Click on Get All Devices under cloud url's. This will give a print out of your maker api connected devices. Make a note of the device id of your virtual presence sensor.
  7. In the above copied url replace [Device ID] with the device ID obtained above.
  8. In the above copied url replace 'commands' with 'arrived'. Save the url.
  9. In the above copied url replace 'commands' with 'departed'. Save the url.
  10. You now have 2 url's. One for arriving and one for departing.
  11. Mobile. In the app set up a home geofence.
  12. Mobile. Scroll down to HTTP setting.
    12a. Change trigger on enter to 'GET'. Copy in the arrived url above.
    12b. Change trigger on exit to 'GET'. Copy in the departed url above.

No username or password is needed.
Click on save top right corner.
To test to see if it is working OK, click on the 3 bar icon top right.
Select settings.
In global HTTP settings select 'get' and then copy in your departed url and click on SEND TEST REQUEST.
Fingers crossed you will see your virtual switch turn off.
Now copy in your arrived url and click on SEND TEST REQUEST.
Fingers crossed you will see your virtual switch turn on.
The deleted by me parts are my hub info that should be kept private. :slight_smile:
Here is an example of my arrived url to compare with.
https://cloud.hubitat.com/api/deleted by me/apps/2763/devices/1505/arrived?access_token=deleted by me

Hope this covers everything.

Don't forget to turn off command optimisations for the locative app on your mobiles.
Also you can define multiple virtual presence devices and set up multiple locations and then using them for arriving/departing at various locations. Pub/golf club/mistress :wink: etc.

2 Likes

Nice memory....

2 Likes

:rofl: Don't be fooled. I was just going through it and hoping I've covered everything. There's bound to be something missing.

1 Like

Ssshhhhh.... :shushing_face:

1 Like

Thanks bobbles
How do I load locative app on my phone?
I don't see an app named that in play store.
I a bit new to all this, I came over from Smartthings
Regards John F

The link to the apk for the app is in post 16 above.

Here it is again.