diff --git a/README.md b/README.md index b67fea0..4bac7f0 100644 --- a/README.md +++ b/README.md @@ -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 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 . diff --git a/src/Program.cs b/src/Program.cs index 20441df..b78fe19 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -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(_ => {