An Apple HomeKit accessory for the Tesla Powerwall 2.
- 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"
To export the battery, load, solar, and grid 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
# HELP grid Watt (W, signed: negative when exporting)
# TYPE grid gauge
grid -1200
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.
- Powerwall module: go-powerwall
- Powerwall HomeKit for hc: powerwall-homekit
- Update to use
hapinstead of `hc - Add energy exported/imported from meters
- Add pull-request to the original repository





