Skip to content

An Apple HomeKit accessory for the Tesla Powerwall 2 written in Go

License

Notifications You must be signed in to change notification settings

sighmon/homekit-powerwall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An Apple HomeKit accessory for the Tesla Powerwall 2 written in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages