Prometheus exporter for Tesla Powerwall and Solar.
Building the Tesla Powerwall exporter can be done by running the following commands.
$ git clone https://github.com/dmyerscough/tesla-powerwall-exporter.git
$ cd tesla-powerwall-exporter
$ npm install
Once you have installed the required dependencies, export the following three environment variables. TESLA_ADDR
is the
IP address of the Tesla Powerwall and the TESLA_EMAIL
and TESLA_PASSWORD
are used for authenticating.
$ export TESLA_ADDR="192.168.0.3"
$ export TESLA_EMAIL="[email protected]"
$ export TESLA_PASSWORD="MySecretPassword"
$ npm run start
{"level":"info","message":"Scraping powerwall","timestamp":"2022-04-04T06:48:33.765Z"}
{"level":"info","message":"Listening on 0.0.0.0:8080","timestamp":"2022-04-04T06:48:33.768Z"}
{"level":"info","message":"Finished scraping powerwall","timestamp":"2022-04-04T06:48:34.342Z"}
...
...
docker run \
-p 9961:9961 \
-e TESLA_ADDR="192.168.0.3" \
-e TESLA_EMAIL="[email protected]" \
-e TESLA_PASSWORD="MySecretPassword" \
prometheus-tesla:0.0.1
You can configure Prometheus to scrape the Telsa Powerwall Exporter metrics endpoint using the following job snippet.
- job_name: "tesla_powerwall"
metrics_path: "/metrics"
static_configs:
- targets: ["192.168.0.1:9961"]