[RELEASE] OwnTracks for Hubitat Presence Detection

That was my original hope.. basically a desktop 'lite' version of OwnTracks (or Life360 which also doesn't have one)

Show all members on a map.. update them as they move around.. that kind of thing. I didn't get that far so I wouldn't be much help on the idea though. Just wanted to throw it out there :slight_smile:

2 Likes

No. That section is blank.

Thanks...I forgot to mention, I have a rule setup that triggers on presence change and sets a switch based on home or away - that rule did fire properly on the presence change and the specific change to not present, so the word is getting out, so to speak, even though the not present isn't showing up in the device Events page and the HE Owntracks app isn't sending the message. :man_shrugging:

New OwnTracks Recorder Image Update yesterday.

3 Likes

Just completed the update, and things look normal.

Thaks for the tip.

Ok, gotcha. If you run the OwnTracks recorder, the next version will allow you to access everyone's live location. Seems to be a catch22 that the mobile Hubitat app won't show this (just a grey screen), but it's fine on a PC or on a browser on the mobile. I suspect some javascript stuff that the app dashboards don't like.

I'll look at that tonight. Thanks for confirming!

Hmmmm.. might need to nag the HE dev's on that version to see what's up. :rofl:

Just learned we can modify the default settings for the frontend application. I made it so on default it shows the current day history (starts from midnight to current time, compared to the whole month). I also enabled heatmap and location history points as well. It's also able to default to showing a single user initially, but I just left mine to show all users.

Pretty neat it has this configuration ability, as it defaulting to the whole month really annoyed me! As most of my problems, I just didn't research enough :sunglasses:

Can check out the config options here:

They get saved to a config.js file which goes in the config folder for the container.
Config below for those interested. These are the changes I did:

  • Defaults filtering date to current day
  • Shows distance travelled in top right (was enabled by default already)
  • Shows heatmap and location history points
  • Reloads data on location change, and refits the current view
CONFIG!
// Set the startDateTime to begin at the current day at midnight
const startDateTime = new Date();
startDateTime.setHours(0, 0, 0, 0);

// Configuration object
window.owntracks = window.owntracks || {};
window.owntracks.config = {
  startDateTime,
  showDistanceTravelled: true, // Calculate and show the travelled distance
  map: {
    layers: {
      heatmap: true, // Initial visibility of the heatmap layer
      points: true   // Initial visibility of the location history (points) layer
    }
  },
  onLocationChange: {
    reloadHistory: true, // Reload history on location change
    fitView: true        // Fit view on location change
  }
};

1 Like

Yes, there is only one +60follow region.

And of course, took two trips today:

First trip, did not get "not present" in Events when I left and no "not present" text from the HE app.

Second trip, got the 'not present" in Events and got the not present text.

And as always, the "present" in Events and text from the app is consistently working when I return.

And a rule that toggles a switch on not present/present always works.

:wink: :man_shrugging:

Thanks for all the info, I'm shamelessly trying to steal your config file, but not sure where the container config folder can be found (or does it need to be created) on an RPI w/Docker. Can you please lead the blind? :slight_smile: I'm assuming it's not just here...

Here? In the billion character long container folders?

I created a config.js file in the front end container directory...there was already another configuration file...
image

And...(no good deed goes unpunished, @jakokln) :wink: I've stopped and restarted the container but not seeing the settings being applied (assuming I've done it correctly w/the placement of the config.js file w/the contents you provided).

Do I need to do anything special for the config file to take effect?

How would this work if you are running Docker on a Synology?
Don't see a config folder.

Once you enable 'Gavin' you need to click 'Done'. This will create a device with your name, and stop giving that warning. Can you check your logs for a 'OwnTracks: Child Device Successfully Created' after you do that?

Ok, pushed another version with some nice to haves and a couple fixes for people having issues.

  • @Jani Advanced Hub Settings has a selection box to change how far from home that wifi SSID keeps the phone 'present'. The default is 750m (2461 ft), but raise it if you are getting spurious locations while on wifi
  • @RC51_Tofuman @danabw The SSID 'present' will now be ignored when the phone switches to mobile data.
  • @Jani @danabw If the phone fails to send a enter/leave home transition event, it will now sync to the presence event so they will display correct.
  • For the recorder setup, you just need the IP now (app will automatically add the /pub path). This automatically removes the existing /pub path, so no need to do anything -- just for reference if you notice it's missing.
  • If you use the Recorder. NOTE: The mobile app dashboards do not display these (not sure why -- might be a javascript issue), but they show on the webpage on the phone or a PC:
    • Each member has a selector to enable a 'LastLocations' HTML tile. It will show the past 12-hours of breadcrumb history in a dashboard
    • When you open the app and click 'Done' a new 'Owntracks' device is created. In this device, you can enable a 'FriendsLocation' HTML tile that shows the current locations of all enabled family members.
3 Likes

Is it possible to also enable this without the Recorder and view it on the dashboard as a Tile?

More importantly, I just noticed the following errors in my logs since the last update (1.7.11) and HE 2.3.8.117 on C8Pro and our Android phones are no longer communicating with the app.

1 Like

Getting the same thing.

1 Like

Hmmm...not me, at least so far, been about 10m and logs look normal.

I had gone into the app and pressed Done after the update. Still no errors or warns in my Owntracks logs.

I'll be honest, I am by no means docker expert. Also, I am a junkie running docker on Windows, so my experience with it is different than the Linux approach. Also, I use docker-compose, so both my recorder and frontend images are running in one container. I ended up setting the same config folder for both images (maybe not the best idea thinking about it now, but it's working :sunglasses:), so I was able to add the config.js file into the same folder with the recorder.conf file we created when setting up the recorder initially. Probably not the scenario in your situation, if the containers were created separately.

Seems like that would be the right spot to me, but I guess not. Did you create the container with a volume (-v when executing the initial docker run)? If not, you may need to create a volume with a config folder and stick the file in there. I believe if you stop the container, and 'docker run -v /...../......' you can build a volume for an existing container. Definitely google around a little bit, again not an expert :disappointed_relieved:. I did add volumes for both images from my docker-compose script, so maybe that's why it took for me. Might need to add a similar line to the volumes: line under the owntracks-ui section below.

My docker-compose for reference
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

I will say, when I initially created the config.js file, nothing changed until I reboot the container. After that, making changes and saving the config.js , and then opening a new tab of the frontend UI was all it took to update.

I am assuming the same thing here, you will probably need to mount a volume and put the config.js file in there. Not entirely sure how volumes are added on Synology, but if I remember correctly you can add them from the UI. Be sure to stop the container first though. I do have a Synology unit, but haven't ever toyed with running Docker on it, have a dedicated Windows PC that I've always used instead.

Hopefully a more experienced docker user can chime in. I really need to learn Linux better, but somehow the stability of running everything on Windows has kept me from learning.

1 Like

Thanks for the info and suggestions...I think rather than risking futzing up my system I'm going to wait for someone from the Linux side of things to chime in. :slight_smile: I am a "cookbook" user of RPIs, I am good at following recipes, doing simple customizations, and I can usually get myself out of trouble and fix minor issues, but I'm not really well versed in it.