[RELEASE] OwnTracks for Hubitat Presence Detection

Region transition not changing was a weird problem and it was fixed automatically next day.

Battery saver is not turned on and wifi is on always.
This seems to be problem that occurs some time to time.

I have been following my device log (owntracks) and I'm sometimes seeing a lot of:
starting service
no location available
lines..

Starting service seems to be basic line that comes up every time when owntracks app is opened.
"No location available" line is the issue and I do not understand where does it come from. At the same time google maps shows location normally, and Owntracks shows location normally, wifi is on, lte is on. Everything seems to be good but still owntracks log says "no location available". When that occurs I need to manually press arrow button and location from device updates to hubitat side. So owntracks does know its location but it cannot send location information automatically to server until someone press arrow key.
Today..is a good day. Today there is no red lines and everything seems to be working normally.

Out of curiosity I wrapped the OT PresenceTile attribute in TileMaster created tile and added a second line attribute as Location (hidden). This creates the same look but now updates TM tile as 'location' changes.

Not practical since it has to be generated via another HE app, so it uses 2x resources for producing 1 tile.

1 Like

I revisit this once I get the google maps finished up. It's almost done.

I didn't write the mobile app, but from my experience, as soon as you open it, the service starts, and typically there is "no location available" (immediately after opening). If you see it a lot in the logs, then that's the weird bug in v2.4.x that they claimed should be fixed in v2.5.x.

@gavin do you see similar in your logs? Are you running the forked version? I had seen in the past that if the phone hadn't triggered a GPS update for a while, the wifi/cell would go stale, and then result in "no location available", and no updates from the phone. The forked version will still call home to report in, and then the HE app will request a GPS update which unbricks it.

Yep it seems to always point back to the store version issues. That most likely is the case again.

@lpakula I am having errors with null data coming from Owntracks. Any idea what I need to do to fix this?

I have Recorder set up and am not seeing these errors - and given this part (
image) it seems related to Recorder. Are you using Recorder?

No, not using recorder. How do I turn this off? I have no URL and Enable Location Updates is turned off.

Above my paygrade...likely need @lpakula to chime in on this one.

I assume you've never had Recorder enabled and haven't enabled any of the settings in the Recorder section of the OwnTracks HE app?

If you force close/open the app again, or restart your phone, that will "cure" it. They did a bunch of improvements around this in the upcoming version -- I had asked if they'd add in the changes for this portion, but they asked to wait to confirm it's still broken on the next version.

Let me check into this. Might be missing a check that's giving you that error. That shouldn't be happening....

Are you willing to publish your tweaked version on Play Store? :smiley: That would be the fastest way to fix my issue.

2 Likes

Don't really have any issues but I thought I would post this log error that was thrown randomly today.

dev:21422024-03-14 09:47:26.392errorjava.lang.RuntimeException: java.sql.SQLException: Referential integrity constraint violation: "FK_DCDS_TO_DEVICESTATE: PUBLIC.DEVICE_CURRENT_DEVICE_STATE FOREIGN KEY(DEVICE_STATE_ID) REFERENCES PUBLIC.DEVICE_STATE(ID) (CAST(25309391 AS BIGINT))"; SQL statement: DELETE FROM device_state WHERE device_id = ? AND attribute_name = ? [23503-214] Query: DELETE FROM device_state WHERE device_id = ? AND attribute_name = ? Parameters: [2142, since] on line 239 (method generatePresenceEvent)

Long time coming, but it is finally here. Just pushed a version that has some pretty nice map changes and other improvements:

  • @miller.rickm Fixed the log error when the recorder is not being used.
  • @UncleAlias Regions now properly ripple from the primary hub down the chain. When editing regions, do it on the phone or the primary hub, since changes won't ripple back from the secondary.
  • @jonathan.lorber the Google Map is FINALLY 'done' :slight_smile: When you click on a user marker, it will zoom in slightly, and show info stats on the user. More you click on the marker, further it zooms in. Once you clicked once, the map will track that user until you click anywhere else on the map. Clicking on just the map will zoom back out.
  • New configuration map screen and tile. If you have the Google Maps API key entered, the existing add/edit/delete region screen is replaced with a single map.
    • You can select a region from the selection box to focus directly on that pin.
    • If you have a Google Geocode API key entered, a text input will be shown to allow you to enter a street address, and it will drop a pin at that location on the map.
    • Clicking on the pin allows you to change the name and radius bubble.
    • Pins can be dragged around to a new location.
    • If you don't save the pin, it will revert to it's past settings when another pin or map is clicked.

Let me know if you see any funny business when using either of the Google features. There was a ton of back end work to make that pretty seamless.

6 Likes

Wow...that's a LOT. :slight_smile: Thanks for the update, hopefully some time tomorrow to play w/it. Wife has advised me my play time is almost over, so more to follow at another time. :wink:

3 Likes

The map configuration turned into a bit of OCD black hole. Did feel like the missing link if you wanted a more seamless Life360 transition though.

I also added a configuration tile. For new installs, the config tile will be there for the OwnTracks device. For existing installs, you need to go into the configuration screen on the HE app once or push the "push" button on the OwnTracks Device to get the first generation. That will allow region management via a dashboard.

I'll look at those tiles that don't refresh soon.

1 Like

I'll look into transitioning the address lookup and region selection boxes directly to that config map as well.

That would allow the tile or a direct link work without the need to drill into the HE app for those 2-features.

It just seemed this release was dragging on, so I wanted to kick it out for people to play with while I added this last polish!

ran into a problem this morning after update. I'm set to NOT use google API, I can't get to the screen so can't see what my geo service type is, but I'm 100% sure I'm not google api.
I get an 'unexpected error' crash when I try to go into the app.

I'm seeing this after the latest update.

Anyone getting an error when clicking on:

image

image