A tool to collect and visualize Rivian vehicle data using InfluxDB and Grafana.
- Collects vehicle data directly from Rivian's API
- Stores data in InfluxDB
- Visualizes data using Grafana dashboards
- Supports authentication with Rivian's API (including MFA)
- Configurable polling interval
- Go 1.19 or later
- Docker and Docker Compose (optional)
- Rivian account credentials
- InfluxDB token (for writing data)
- Clone the repository:
git clone git@github.com:rivflux/rivflux.git
cd rivflux- Create a
.envfile with your InfluxDB and Grafana credentials:
cp .env.example .env
# Edit .env with your actual credentialsNote: Before starting the data collector, you must complete the authentication process as described in the "Authentication Process" section.
- Start all services:
docker-compose up -d- Clone the repository:
git clone git@github.com:rivflux/rivflux.git
cd rivflux- Build the binaries:
cd src/rivian
go build -o bin/auth cmd/auth/main.go
go build -o bin/logger cmd/logger/main.go-
Set up InfluxDB:
- Install InfluxDB locally or use a cloud instance
- Create an organization and bucket
- Generate an API token with write permissions
-
Create a
.envfile with your InfluxDB credentials:
cp .env.example .env
# Edit .env with your actual credentialsNote: Before starting the data collector, you must complete the authentication process as described in the "Authentication Process" section.
- Start the data collector:
./bin/logger \
-auth-file=data/auth/auth.json \
-influx-url=http://localhost:8086 \
-influx-token=your_influx_token \
-influx-org=rivflux \
-influx-bucket=rivian \
-poll-interval=300The authentication process works in two steps:
-
Generate Auth Token (
authcommand):# Without MFA: ./bin/auth -username=your.email@example.com -password=your_password -output=data/auth/auth.json # With MFA (you'll receive an OTP code via email or your MFA tool): ./bin/auth -username=your.email@example.com -password=your_password -otp=123456 -output=data/auth/auth.json
- The command will authenticate with Rivian's API
- If MFA is enabled, you'll need to provide the OTP code
- You'll be prompted to select your vehicle
- The auth token and vehicle ID will be saved to the specified file
-
Use Auth Token (
loggercommand):- The logger reads the auth token from the file
- Makes authenticated requests to Rivian's API
- Automatically refreshes the token when needed
The collector polls the following data points every 5 minutes (configurable):
- Cabin temperature
- Power state
- Drive mode
- Gear status
- Vehicle mileage
- Battery level and capacity
- Range
- Charger status and power
- Charging session details
The Grafana dashboard provides comprehensive visualization of your Rivian vehicle data:
- Real-time vehicle status and metrics
- Battery level and charging information
- Drive mode and gear status
- Temperature and climate control data
- Detailed charging session information
- Power delivery and efficiency metrics
- Charging rate and duration
- Cost and energy consumption
- Historical trends and patterns
- Range and efficiency analysis
- Usage statistics over time
- Customizable time ranges and views
- Open Grafana at http://localhost:3000
- Login with:
- Username: admin
- Password: (your GRAFANA_PASSWORD)
-username Rivian account email (required)
-password Rivian account password (required)
-otp OTP code for MFA (if enabled)
-output Output file path (default: auth.json)
-auth-file Path to auth file (default: auth.json)
-influx-url InfluxDB URL (default: http://influxdb:8086)
-influx-token InfluxDB token (required)
-influx-org InfluxDB organization (default: rivflux)
-influx-bucket InfluxDB bucket (default: rivian)
-poll-interval Polling interval in seconds (default: 300)
- Auth Token Issues:
# Regenerate auth token
./bin/auth -username=your.email -password=your_password -output=data/auth/auth.json- Check collector logs:
# If running in Docker:
docker-compose logs rivian-collector
# If running locally:
./bin/logger -auth-file=data/auth/auth.json [other options] 2>&1 | tee collector.log- Verify InfluxDB connection:
curl -I http://localhost:8086/health- Check Grafana logs:
docker-compose logs grafana-
Account Security:
- Create a secondary Rivian account specifically for this tool
- Do not use your primary Rivian account to avoid potential security risks
- The secondary account should have limited access to only the necessary vehicle data
- This follows the principle of least privilege and minimizes potential impact if credentials are compromised
-
Credential Management:
- The auth token file is base64 encoded and should be kept secure
- File permissions are automatically set to 600 (user read/write only)
- Never commit your auth token file to version control
- Store your
.envfile securely and never commit it - Regularly rotate your InfluxDB tokens and Rivian account password
-
Network Security:
- When running locally, ensure InfluxDB is properly secured
- Use HTTPS for all external connections
- Consider using a VPN if accessing the dashboard remotely
- Implement proper firewall rules to restrict access to services
-
Data Protection:
- Regularly backup your InfluxDB data
- Monitor for unauthorized access attempts
- Review access logs periodically
- Consider implementing rate limiting on your services
MIT License


