Owntracks GPS Presence in Node-RED

Hi All,

I figured i’d pass this on to anyone also interested. I put this together using elements from other articles I found online and it’s been great. My wife and I use both Unifi (WiFI) and now Owntracks (GPS) for presence mainly because her iPhone would constantly drop on and off the WiFi as it slept.

Nodes used: node-red-contrib-boolean-logic-ultimate, node-red-contrib-unifi, node-red-node-geofence and node-red-contrib-owntracks

Step 1) Sign up for a free service with HiveMQ . This service offers a cloud hosted (Azure or AWS you choose) secure service

Step 2) Install Owntracks on either your Android or iPhone devices and set encryption key.

Step 3) Configure Owntracks public secure connection to MQTT and enter details from the HiveMQ service.

Step 4) Configure Node-RED to (as per image) or develop your own flow (your call). Note: I also push this and the Unifi (WiFi) payloads into a boolean logic ultimate node so they work together. Note: set the same encryption key as mobile app in node-red-contrib-owntracks node.

Anyways I won’t bother sharing the flow with this one given it’s a all custom to my setup but I do suggest looking into this because it’s made a significant difference in our house. I can share components you need though if interested and again if you do it another way and or make it better share back here for others.

4 Likes

My lady is not interested in participating so my flow is much simpler.

And I can’t blame her because all I’m doing is keeping a local log, as you can see. So far there is just nothing I care to use this presence for as I automate only those things that make our life easier and nothing just because I can. Blasphemy, I’m sure, to those who never pass on a chance to automate. :rofl:

4 Likes

How do you find accuracy with owntracks?

I currently use tasker with autolocation for presence and can’t fault it (yet!)
Just another suggestion if anyone is looking!

1 Like

It can be quite good, depending on the chosen mode and distance settings. I use the “significant changes” mode but “move monitoring” is much more sensitive which causes too much reporting for my taste.

2 Likes

Agree with @LosinIt I also use it in the default “significant mode” and it works great I don’t even notice any changes to my battery life either which is nice.

2 Likes

I notice that none of you are bothering to encrypt your location for added privacy making you all dead simple to track if i wanted too… Why???

Also anyone up for a game of i know where you are right now? hehe :stuck_out_tongue:

Yes, well… ahem… it’s an issue with getting a psk setup in Mosquitto. I wasn’t able to get it worked out but recently there was an update that supposedly fixed some issues with it. I just haven’t got back to trying again. But it doesn’t matter near as much as you seem to think because OT → Mosquitto only happens on either MY Wi-Fi or over MY VPN when on cell data so go ahead and find my phone. OTOH, I know for sure you can find my IP that is in use ALL the time when I’m using YOUR discourse instance. :stuck_out_tongue_winking_eye:

1 Like

I was actually talking about the inbuilt encryption within the OT app. Encrypts the location data with a key of your choosing and then gets decrypted inside your node-red instance.

As great as the added security of wifi and vpn connections are, exploits get released for them like everything else and the encryption option is just another easily added layer of protection so it surprised me you guys arent utilizing it,

It turns out that OT doesn’t support a psk to mosquitto. It seems the only way for that is TLS certs which are too much of a PITA for my liking. I’m also not seeing how to decrypt, in either mosquitto or node-red, the location data from OT’s encryption. Care to enlighten me?

All you need to do is deploy the node-red-contrib-owntracks and put that in your flow with your encryption key. that node will then decrypt the data when matched to the same encryption key you entered into the advanced encryption section of the mobile app.

1 Like

D’oh! I didn’t even look for such a node. :roll_eyes:

1 Like

No worries. I had it in my flow previously. I clearly forgot to put it back. All good :ok_hand:

1 Like