Skip to content

Commit

Permalink
Adding docs on how to find powerwall password, and adding override fo…
Browse files Browse the repository at this point in the history
…r requestHost
  • Loading branch information
DrEsteban committed Nov 21, 2024
1 parent 09a8636 commit 9db27c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ I've also checked in a few example assets for Docker Compose, Prometheus, and Gr
> [!WARNING]
> This app is currently designed to be run in a totally-local Prometheus environent behind a firewall. As such, there is no authentication enforced for callers of the API.
## Configuring

If you look at the `docker-compose.example.yml` file, there are a few <variables> that need to be filled in.

### Tesla Gateway
* `TeslaGateway__Host` - The IP address of your Tesla Gateway
* `TeslaGateway__Email` - The email of your Tesla account
* `TeslaGateway__Password` - This is **NOT** the password for your Tesla account:
* You can check here for details on how to find the password, and possibly change it later: https://www.tesla.com/support/energy/powerwall/own/connecting-network
* For my Backup Gateway 2 system, the sticker was located under the main cover. It was the last 5 characters of the string labeled "PASSWORD".


## Running
```sh
$ docker build -t solarapiproxy .
Expand Down
3 changes: 2 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@
{
client.BaseAddress = new Uri($"https://{configuration["TeslaGateway:Host"]}");
// The Tesla Gateway only accepts a certain set of Host header values
client.DefaultRequestHeaders.Host = "powerwall";
string? requestHostOverride = configuration["TeslaGateway:RequestHost"];
client.DefaultRequestHeaders.Host = string.IsNullOrWhiteSpace(requestHostOverride) ? "powerwall" : requestHostOverride;
})
.ConfigurePrimaryHttpMessageHandler(_ =>
{
Expand Down

0 comments on commit 9db27c8

Please sign in to comment.