Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaisor/tesla-api-prometheus-exporter
Prometheus exporter for Tesla API metrics
https://github.com/jaisor/tesla-api-prometheus-exporter
exporter grafana metrics powerwall powerwall-api prometheus tesla tesla-api
Last synced: 26 days ago
JSON representation
Prometheus exporter for Tesla API metrics
- Host: GitHub
- URL: https://github.com/jaisor/tesla-api-prometheus-exporter
- Owner: jaisor
- License: apache-2.0
- Created: 2023-11-08T06:18:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-17T08:03:41.000Z (about 1 year ago)
- Last Synced: 2024-11-15T03:38:17.927Z (3 months ago)
- Topics: exporter, grafana, metrics, powerwall, powerwall-api, prometheus, tesla, tesla-api
- Language: JavaScript
- Homepage:
- Size: 810 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tesla-api-prometheus-exporter
Prometheus exporter for Tesla API metricsDashboard snapshot https://snapshots.raintank.io/dashboard/snapshot/V8ReJsr79g4LfgzLlWVphFmZDIKP2Wp1
![Example Grafana dashboard](img/dash.png)Grafana JSON exported in [grafana_dash.json](grafana_dash.json)
GitHub repo: https://github.com/jaisor/tesla-api-prometheus-exporter
# Tesla API auth
See https://github.com/adriankumpf/tesla_auth for instructions on how to generate access and refresh tokens
# Build & run
## Local npm
Create an `auth.json` file in the config path (ex: `.config/auth.json`) containing at-least a valid refresh token.
The script will populate access token and future refresh tokens in that file as needed.```
{
"refresh_token": ""
}
```Ensure the script has access to CONFIG_PATH environment variable pointing to the the folder containing `auth.json`. Example `.env` file to accomplish this:
```
CONFIG_PATH=.config
```Install and run
```
npm install
npm start
```## Docker container
```
docker build -t tesla-api-prometheus-exporter:latest .
``````
docker run -dit --restart unless-stopped --name tesla-api-prometheus-exporter \
-v .config:/config -p 9004:8080 \
-e CONFIG_PATH=/config -e LOG_LEVEL=info \
tesla-api-prometheus-exporter:latest
```