8

I have a service at my home, on a Raspberry Pi for example, which should execute depending on where I am (work, home, shop,...)

Use case example : Send a reminder to somebody in my house but not when I am at my house

Is there a way for my Raspberry Pi to query my (android) phone and get my position ?

In fact I would like to do like this answer, which is geofencing but in reverse. I have for example Tasker which could send my approximate position on well known places (work, home, shop,...) when I enter or leave, but it comes back to how to query Tasker from outside my phone.

For the moment I am thinking of pushing my position at a server every ~30 minutes so my service could query my last position. Of course real time (~5 minutes) is better.

1 Answer 1

5

How about something like Owntracks + Node-RED with the geofence node.

Owntracks runs on your phone and can upload your location to either a MQTT broker or a HTTP server. Node-RED can either subscribe to the MQTT topic or provide the HTTP endpoints to accept the incoming messages. Then the geofence node can be set up to mark locations of interest which can be used to filter messages.

Then there are a huge range of nodes you can use to send messages or trigger actions.

There is even a Node-RED node to decrypt encrypted Owntracks messages.

(full disclosure, I wrote the geofence and Owntracks decryption nodes)

3
  • Can Owntracks send a location by query? Such as a MQTT message "where are you" and Owntracks answers directly ? Or else do you know at which frequency Owntracks can upload the location ?
    – Goufalite
    Commented Dec 11, 2017 at 7:52
  • Iirc you can't query it. But you can configure the reporting interval (default looks to be every 900 seconds)
    – hardillb
    Commented Dec 11, 2017 at 8:47
  • The problem with Owntracks is that on newer Android, it can not start up by itself as it requires location permission. You have to remember to start it every time teh phone reboots. Using Autostart on it, did not work. Commented Feb 28 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.