[RELEASE] OwnTracks for Hubitat Presence Detection

Is that an iPhone or Android?

I've confirmed....."cmd" is ON

ranging - OFF
extendedData - ON
locked - OFF
cmd - ON
allowRemoteLocation - ON

Do you see a "+follow" or similar in your "regions" on the phone. And only 1?

yes....there is a "+60follow" (and only one).

The map will sometimes refresh correctly. But it's typically hours after arrival at some location.

What is the time different between those gaps? Looks like the phone sleeps and wakes (+60follow is supposed to limit that to 60-seconds).

Anyone interested in trying the OwnTracks Frontend: GitHub - owntracks/frontend: 🌍 Web interface for OwnTracks built with Vue.js I've updated the app to give the instructions to do so.

Basically, you need to have OwnTracks Recorder all ready running, and then install the front end. If you installed the same as I listed in the instructions:

  • docker pull owntracks/frontend
  • docker run -d --restart always --name=owntracks_ui -p 8082:80 -e SERVER_HOST=OwnTracks -e SERVER_PORT=8083 owntracks/frontend

It's the "same" but "different" than the regular OwnTracks web front in. It is slower, and offers slightly different info (like elevation change or total distance traveled over a span of time), but you loose things like speed on each breadcrumb.

I wouldn't say it's "better", just "different". :+1:

4 Likes

Time deltas is often hours...many.

Interesting thing is that the Hubitat app shows the correct location.....it just doesn't get sent to the iPhone (family member phone).

Latest version from HPM. I tried to keep it updated on each new release.

1 Like

This is now fixed. No extra "left home" notifications any more. Thanks!

3 Likes

Running both here as well. I do really like the fact that you can track location over a certain time range (that you can select), for all users or a single user. I find it useful to look at a user over a day period to see where we have been. Life360 had this functionality for 1 or 2 previous days on the free plan. This is super nice because you can look it up as far back as the recorder has been active.

Would be nice if they combined both of them. Like you mentioned, there are tradeoffs to both, so it seems like two halves to a whole solution.

For anyone interested, here is my docker compose file. I prefer docker compose since it helps me remember how I setup the container. That way if the machine running it crashes, all I need to do is pull my compose files from backup, and spin up another machine.

If you intend to use, you will need to modify the "FILEPATH" and "YOUR TIMEZONE" variables. For Time zone, lookup what is required for docker compose time zones, and you should be able to figure out which one you need. For File path, you could probably do a few things, but I have a folder called OwnTracks, and inside that lies everything for this container. Just link the full path to the "FILEPATH" note in the code and you should be all set.

I have been running on Docker for Windows (I know I know) but overall it has performed well, and it does not consume many resources.

For reference, this uses port 8083 for the owntracks integration, and 89 for the frontend addon.
So to access from a web browser it would be the machines IP:8083 for the recorder, and IP:89 for Frontend.

version: '3'

services:
  otrecorder:
    container_name: owntracks
    image: owntracks/recorder
    ports:
      - 8083:8083
    volumes:
      - "<FILEPATH>/config:/config"
      - "<FILEPATH>/store:/store"
    restart: always
   
   
  owntracks-ui:
    container_name: otui
    image: owntracks/frontend
    ports:
      - 89:80
    volumes:
      - "<FILEPATH>/config.js:/usr/share/nginx/html/config/config.js"
    environment:
      - SERVER_HOST=owntracks
      - SERVER_PORT=8083
      - TZ=<YOUR TIMEZONE>
    restart: always
1 Like

@jakokln

Perhaps you would be able to offer a little insight to my own post/question, burried above please?

================================================

I'm hanging fire for now until I'm confident with the info and guides.

Stellar work though!

At the moment I'm presuming the 'history' features require the installation of docker/recorder, which is beyond me. Also, I'm not sure if it's worth the effort as it's difficult to find an actual video (or similar) to show how this works in practice if I do actually get around to installing this.

Again, a presumption, but I suspect the recorder won't allow this kind of functionality to be restored from Life360..?

======================================================

Play Store Owntracks Location permission seems to have just "Allow only while using the app" which seems weird. I'm not sure why it doesn't have "Allow all time" setting which for example Hubitat app and Google have.
Not sure how it effects on daily use though. Today once again I'm seeing Owntracks acting really bad on phone. I need to open owntracks and hit arrow button. Nothing on my side have changed.

Need help understanding the map you display above. To clarify:

  • The iPhone reports an address to the Hubitat app correctly
  • The iPhone map isn't correct? Or is it not showing other family member locations? They don't dynamically update on the mobile app, they only get updated when that phone sends a location to the Hubitat app.
  • That map looks like from Recorder. It could be poor location accuracy causing gaps as well. That should be shown in the iPhone logs that it was bad.

Can you have her restart the app on the phone (or just restart the phone to make it easier)? Might be an issue with the mobile app.

You didn't clarify the answer to this above. Which functionality are you looking for? You cannot get any history from Life360 into the app. Are you looking for the breakdown of segments over time that Life360 did? Owntracks will give you a breadcrumb of points that you can click to see when the person was at each point, but doesn't break it down into blocks (IE 1 mile trip).

I find the breadcrumb map of recorder a lot more useful than the way Life360 did it (my personal preference though). Here is an example:

I get the following error

"host not found in upstream "owntracks:8083" in /etc/nginx/nginx.conf:7"

It's because that Play Store version does not have background operation allowed. The version I put in post #2 does, which allows it to run automatically on the phone or app restart.

Oh wait, on your mobile app, what is displayed in the top right of the map? Does it have the "Play" symbol like the image below? @Noob_using_hubitat @s1godfrey can you check the iPhones that are having location issues? It's super easy to tap that icon and switch it to a manual or quiet mode which stops reporting locations. It's the reason I blocked it in the forked version I put on post #2. Worst location for that selection right next to the send location button IMO.

image

I do have a play button in my app because its a play store version. If I remember right in your app version that is disabled.

I understand what you are saying but just to confirm.. Play store version still runs background even though it doesnt start automatically when phone is restarted. When app is manually started owntracks stays on in a background and location is sent when ever im moving. But sometimes it just takes a long time to report location.
I could try to turn Google location sharing service on if that would make location reports faster.

That triangle icon will change if you tap it. It will change from "Move -> Significant -> Manual -> Quiet". "Significant" mode is the single triangle like in the picture I posted.

No, the Play Store version starts up "dead" and puts a notification that you need to open the app to enable it to run. At that point, it runs in the "foreground" and will send out locations as expected until the app or phone is restarted. Others use 3rd party apps like "Tasker" to do this automatically.

1 Like

This exactly...until you open the Play store version of the app it don't do nuthin' after a reboot :frowning:

This is what I used to do, no longer needed w/@lpakula's modified version.

Hopefully at some point the Owntracks Android app dev(s) will pick up Lyle's pull request(s) and release an updated version of the Play Store app w/his improvements...but they seem to move glacially slow.

2 Likes