Skip to content

Gps tracker relayed by TTN (LoRa) then displayed on your Home Assistant as a tracker

Notifications You must be signed in to change notification settings

PDWest/PyTrack-GPS-LoPy-TTN-HA_tracker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTrack-GPS-LoPy-TTN-HA_tracker

This project link a GPS tracker that sends it's coordinate by LoRa trought the TTN (The things Network), TTN decodes the payload then send it by MQTT. Home Assitant receive that MQTT message trought an JSON MQTT Device Tracker Component, you can then see it on your map or program differents interactions. Then it send another MQTT message in a format compatible with owntrack, so you can see your position throught any owntrasks device (iphone, android, custom software) and if you want you can share that message to friends.

You need :

In the pycom folder, the program to run on the LoPy attached to a Pytrack. Replace the wifi ssid, wifi password and all the ABP lora : dev_addr, nwk_swkey, app_swkey. You'll find those information in your TTN device page.

In the TTN folder, the code to insert in your payload decoder

You should see decoded data now in your TTN application page.

In the HA folder, some lines to add to your configuration.yaml and to your automation.yaml replace remote-gps/devices/lopypremier/up/payload_fields by your application ID (here remote-gps) and device ID (here lopypremier)

In the mosquitto folder, some lines to bridge your MQTT broker with the TTN broker add those lines in your /etc/mosquitto/mosquitto.conf file, it will bridge your MQTT broker to the TTN broker to get the messages. Replace remote_password ttn-account-v2.1000000000000000000000000000000000000000000000000 by your own Application access keys and topic remote-gps/devices/lopypremier/up by your application ID (here remote-gps) and device ID (here lopypremier)

ToDo:

  • have function to get time from the gps and send it.
  • get the accuracy from the gps and send it.
  • change the tst function to generate a correct time with HA or get it from the device

About

Gps tracker relayed by TTN (LoRa) then displayed on your Home Assistant as a tracker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%