Giter Site home page Giter Site logo

life360-influx's Introduction

life360-influx

Allows for importing data from Life360 to InfluxDB v2.

Requirements

  • Life360 credentials associated with an active circle.
  • A device with either Docker or Python 3.11+ installed.
  • InfluxDB v2 installed on this device or another device, and a bucket created in influxDB.

Setup

The app reads the settings from template.config.toml, then config.toml (if it exists), then environment variables. See template.config.toml for details.

With Docker & config file

Dependency: Docker installed.

  1. Download and run the Docker image: sudo docker run --name life360 -v config.toml:/app/config.toml vdbg/life360-influx:latest
  2. Copy the template config file from the image: sudo docker cp life360:/app/template.config.toml config.toml
  3. Edit config.toml by following the instructions in the file
  4. Start the container again to verify the settings are correct: sudo docker start life360 -i -e LIFE360_INFLUX_MAIN_LOG_VERBOSITY=DEBUG
  5. Once the settings are finalized, Ctrl-C to stop the container, sudo docker container rm life360 to delete it
  6. Start the container with the final settings:
sudo docker run \
  -d \
  --name life360 \
  -v /path_to_your/config.toml:/app/config.toml \
  --memory=100m \
  --pull=always \
  --restart=always \
  vdbg/life360-influx:latest

With Docker without config file

Dependency: Docker installed.

Inspect template.config.toml file for all the settings that need to be overriden. Command will look something like:

sudo docker run \
  -d \
  --name life360 \
  --memory=100m \
  --pull=always \
  --restart=always \
  -e LIFE360_INFLUX_LIFE360_USERNAME=user \
  -e LIFE360_INFLUX_LIFE360_PASSWORD=password \
  -e LIFE360_INFLUX_INFLUX_TOKEN=token \
  vdbg/life360-influx:latest

Without Docker

Dependency: Python 3.11+ and pip3 installed. sudo apt-get install python3-pip if missing on raspbian.

  1. Git clone this repository and cd into directory
  2. cp template.config.toml config.toml
  3. Edit file config.toml by following the instructions in the file
  4. pip3 install -r requirements.txt
  5. python3 main.py or ./main.py

Grafana

To get a dashboard similar to the below one, download the template, and replace these placeholders before creating a dashboard from the template:

  • Name_Of_Circle: name of the Life360 circle of interest, e.g. Family,
  • Member_1 to Member_4: names of the circle members of interest. Delete extra panels if fewer than 4 members, duplicate one if more.

Grafana dashboard

Known issues

Sometimes, Life360 updates the access token that's used in life360/auth_token of config.toml. When that happens, requests will fail with 403 Client Error: Forbidden for url: https://api.life360.com/v3/oauth2/token.json.

Fix is to update this app/docker container (if available) or google the old access token (hoping one of the hits will provide the new one)

life360-influx's People

Contributors

vdbg avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.