This post is part of a series, other related posts are:
- 28 Oct 2016 - A custom presence locator in Home Assistant: This post will show how to configure a custom presence locator in Home Assistant using GPSLogger and a personal server.
- 05 Oct 2016 - Configuring presence locator in Home Assistant: This post will show how to configure presence locator in Home Assistant using Owntracks and a personal server.
- 04 Oct 2016 - Exposing Home Assistant in a secure-way: Before putting Home Assistant accessible from Internet, the entire OS must be hardened and secured to avoid unpleasant problems.
- 03 Oct 2016 - Installing Home Assistant on a Raspberry Pi 3: This post will show how to install Home Assistant on a Raspberry Pi 3, secure it and expose it on Internet.
This post will show how to configure a custom presence locator in Home Assistant using GPSLogger and a personal server.
Presence service based on mobile phones in Home Assistant is now available using Owntracks or Locative. Owntracks works enough, but it’s too much battery consuming. Locative simply does not fit my needs.
I found another simple Android application for GPS trackinig: GPSLogger. Every Android device, with geolocation feature enabled, tracks itself using GPS sensors or WiFi networks. Installing another GPS app will lead to battery drain for sure unless it will use cached data.
GPSLogger can use multiple source: the passive one just get the latest Android known location, without activating GPS sensors or scanning for WiFi networks.
On my mobile phone, GPSLogger is using about 4% of battery so it’s the best tool in my opinion.
Installing the GPSLogger patch
I developed a small patch for Home Assistant, and it has been included in the offical repo.
Configuring Home Assistant
Check the old post and configures zones and automation.
Configure presence using GPSLogger:
device_tracker: - platform: gpslogger
MQTT configuration and daemon can be removed.
Configuring GPSLogger on Android
Install Logger GPS per Android and configure it like the following:
- General Options:
- Start on boot: yes
- Start on app launch: yes
- Display Imperial units: as you wish
- Hide notification buttons: yes
- Enable/Disable GPS: yes
- Write to debug file: no
- Logging details:
- Log to GPX: no
- Log to KML: no
- Log to custom URL: yes and set
- Log to OpenGTS Server: no
- Log to Plain Text: no
- Log to NMEA: no
- Location providers:
- GPS: no
- Network: no
- Passive: yes
- Time before logging: 60
- Keep GPS on between fixes: no
- Distance filter: 0
- Accuracy Filter: 40
- Retry time interval for accuracy filter: 60
- Absolute Timeout: 3
- Location providers:
Custom URL can also use API password, just add it to the URL (remember I prefer another security type, and check my previous post).
Start logging, check your
known_devices.yaml file and enjoy your light location service.