HomeKit Tesla Powerwall 2
An Apple HomeKit accessory for the Tesla Powerwall 2.

Software
- Install Go >= 1.14 (useful Gist for Raspberry Pi)
- Build:
go build homekit-powerwall.go
- Build for Raspberry Pi by cross-compiling on macOS:
env GOOS=linux GOARCH=arm GOARM=7 go build homekit-powerwall.go
- Run:
go run homekit-powerwall.go -ip POWERWALL_IP -username YOUR_USERNAME -password YOUR_PASSWORD
- In iOS Home app, click Add Accessory -> "More options..." and you should see "Tesla"
Prometheus exporter
To export the battery
, load
, and solar
for Prometheus use the optional flag -prometheusExporter
.
- Run:
go run homekit-powerwall.go -ip POWERWALL_IP -username YOUR_USERNAME -password YOUR_PASSWORD -prometheusExporter
You'll then see the data on port 8001
: http://localhost:8001/metrics
# HELP battery Charge (%)
# TYPE battery gauge
battery 90
# HELP load Watt (W)
# TYPE load gauge
load 3980
# HELP solar Watt (W)
# TYPE solar gauge
solar 6230
Powerwall setup
Follow the instructions in Connecting to Tesla Gateway to set your username
and password
for your Powerwall.
Then use these credentials to run this HomeKit exporter app.
Thank you
TODO
- Update to use
hap
instead of `hc
- Add energy exported/imported from meters
- Add pull-request to the original repository