InfluxDB data source for reporting Tesla vehicle metrics.
Report metrics such as vehicle location, speed, climate control settings, charge rate, and more!
Prerequisites:
- A Tesla vehicle
- InfluxDB Time Series Database (Only version 2 and above is supported!)
- Basic understanding of InfluxDB + FluxQL or a willingness to learn
- A Tesla API Token
Choose one of the following deployment methods:
docker run --name tesla-metrics-agent \
-e TESLA_REFRESH_TOKEN="See repository readme to obtain your refresh token" \
-e INFLUXDB_URL="https://your-influx-db.example.com" \
-e INFLUXDB_TOKEN="your-token-here" \
-e INFLUXDB_ORG="your-org-here" \
-e INFLUXDB_BUCKET="tesla-metrics" \
ghcr.io/technoguyfication/tesla-metrics-agent:master
Or with docker-compose:
version: "3.8"
services:
collector:
image: ghcr.io/technoguyfication/tesla-metrics-agent:master
environment:
TESLA_REFRESH_TOKEN: "See repository readme to obtain your refresh token"
INFLUXDB_URL: "https://your-influx-db.example.com"
INFLUXDB_TOKEN: "your-token-here"
INFLUXDB_ORG: "your-org-here"
INFLUXDB_BUCKET: "tesla-metrics"
VERBOSE: false # If you're having issues, change this to true to output more data
restart: unless-stopped
Bare metal installation isn't supported yet! You can always download the source code yourself and figure it out.
Tesla uses a non-traditional OAuth flow, and currently the easiest way to obtain a token is by using one of the following mobile apps:
- iOS: Auth app for Tesla
- Android: Tesla Tokens
You need the refresh token generated by these apps. The access token can be ignored when setting up this software.
If you would like to attempt to get your token manually, please read the following article on how the flow works.