There are a lot of cell phone GPS options that may or may not work with indigo. For various reasons, all had a shortcoming somewhere given what I wanted to be able to do.
I want to be able to have a list of devices which represent all the member of my house. Each device should be able to contually update with their location. I want geofence areas that let me know who is in that geofence. I want some mapping ability. I want the ability to get notifications based on movement. (My favorite so far, I call a geo-lock. It is an action that creates a geofence on the fly given the user's current location with triggers pre-set to notifiy me... more on that later.
Owntracks is very similar to Life360. Biggest difference, Owntracks is free, it runs on your server (no cloud) so you (and only you) have the data. There are some docker methods, I found it easiest to use their quicksetup guide and dedicate a raspberry pi to the job.
Once owntracks is setup on a raspberry pi, the next step is getting it linked up with Indigo. The best fit for this task is Flying Diver's MQTT stuff: MQTT Connector and MQTT Shims.
MQTT Connector: https://www.indigodomo.com/pluginstore/211/
MQTT Shims: https://www.indigodomo.com/pluginstore/210/
STEP 1:
To connect to the MQTT Broker (set up on the Raspberry Pi... packaged part of the Owntracks Install), You will need to use the login / password for the user "_lr"
Connection Info:
- IP Address (or hostname) of your Raspberry Pi
- Code: Select all
sudo nano /usr/local/owntracks/userdata/.lr.pw
Port: 8883
MQTT Protocol: MQTTv311
Transport Protocol: TCP
Username: _lr
Password: find it by typing this in terminal or on the raspberry pi.
I saved this device as "Owntracks Broker". Call it whatever, but that's what I'll refer to from here on.
STEP 2:
To add a device, I used MQTT Shims.... Start with a trigger, for this I'll use my phone as the example:
Type: MQTT Connector Event
Event: Topic Component Match
Event Settings: Select the Owntracks Broker (the step above) and you will want the topic strings to look like this:
- Match: owntracks
Match: bill
Any:
Message Type: ##billPhone##
Done with that step. On to the last step.
STEP 3:
Create a shim device (This will be the device that actually represents my phone)
- Type: MQTT Shims
Model: MQTT Generic JSON Device
Name: MQTT-Bill-Phone (obviously you will name it whatever... unless your name is also Bill)
Settings:
- MQTT Broker: Owntracks Broker
Message Type: ##billPhone## <--- Super important this matches the Message Type from the trigger.
Unique ID Location: Payload Field
Payloadk Key: _type
Unique ID Value: location <--- since my trigger will fire on any owntracks/bill... that will include any message my phone sends (contact card, waypoints, etc.). Adding location here makes sure that only the "location" messages populate the states of this device.
Multi-States Key: . <---- hard to see, but don't forget that little period there.
Custom Decoder: None
Device Supports status requests (check) <--- I havn't figured out if this does anything.... but that's what I have.
Status Requet Topic: owntracks/bill/myphone/cmd
Status Request Payload: {"_type":"cmd", "action":"reportLocation"}
Device reports battery status (check)
Battery Payload Key: batt
Energy (blank)
Power Load (blank)
Go to your phone, in the owntracks app, once you send your location, you should see the information in the shim device populate with your phone data.