# Configuration > **Using Gleanvolt?** The user manual has this step by step: [The Settings page](https://mpospisil.github.io/gleanvolt/latest/en/setting-up/settings/). This page is the reference behind it. **Configure Gleanvolt in the web UI.** The [setup wizard](WEB_UI.md#the-setup-wizard) covers what a new installation needs, and **Settings** and **Car** cover the rest of what you change day to day. Every value is checked as you save it. That is the recommended way, and the one this documentation assumes. This page is the reference behind those forms: what each setting means. It also gives each setting's configuration key, which is **optional** — for the few settings the web UI doesn't cover (the charge-control tuning, the battery hold, the history stores), or to prepare an installation without a browser. **If you do use configuration files**, a setting is read from these, lowest to highest — a later one wins, key by key: 1. `src/Gleanvolt.Worker/appsettings.json`, the shipped defaults. 2. Environment variables, including `.env` (Docker: `/opt/gleanvolt/.env`; .deb: `/etc/gleanvolt/gleanvolt.env`). A key `A:B:C` is written `A__B__C`. 3. The overrides file, `data/pv-system.json`, written by the web UI and `gleanvolt setup`. 4. Command-line arguments. **Secrets** — API keys, passwords, the MQTT password — entered in the web UI go to the [secret store](#the-data-directory-holds-secrets-the-secrets-section). In files they belong in `.env` or an environment variable, never in `appsettings.json`. The `Controller` section holds the settings that belong to no single feature: ```jsonc "Controller": { "TimeZone": "", // "" = ask the OS; an IANA or Windows zone id overrides it "PollIntervalSeconds": 5 // one poll/decide cycle per this many seconds } ``` `TimeZone` is the zone every *local* decision is made in: the forecast's day boundary, the daily battery-loan budget, and the date a charging session is filed under. Leave it empty on Linux, where `TZ` sets it (the Docker stack does). **Set it on Windows**, which ignores `TZ` and would otherwise run in UTC; on the Nano Server image it must be a Windows id (`Central Europe Standard Time`). An id that cannot be resolved stops the controller at startup. `PollIntervalSeconds` is how often the controller reads the devices and decides. The other sections are documented with their features: | Section | Page | |---|---| | `Pv`, `Secrets`, `Solcast`, `Weather`, `Tariff` | below | | `ChargeControl` | [EV charge control](CHARGE_CONTROL.md) and the mode pages | | `BatteryHold` | [Battery discharge hold](BATTERY_HOLD.md) | | `Ev`, `Vehicle` | [The car and its telemetry](VEHICLE.md) | | `Web` | [Web UI](WEB_UI.md) | | `Api` | [HTTP API](HTTP_API.md) | | `SessionStore`, `EnergyMonitor` | [Charging session and energy history](DATA.md) | | `HomeAssistant` | [Gleanvolt with Home Assistant](HOME_ASSISTANT.md#settings-the-homeassistant-section) | ## The PV system (the `Pv` section) One section describes the installation: where the array is, what it faces, what it is made of, and what to call it. Set it in the setup wizard's **Inverter** and **Site** steps, or later on **Settings → Installation**. The charger isn't here: it is its plugin's ([Your charger](CHARGER_SETUP.md)). The keys below are the reference behind those forms. ```jsonc "Pv": { "Id": "home-roof", // stable slug: the system's identity, on the broker and upstream "Name": "Home Roof", // what a human sees "Address": "", // display only, never parsed "Latitude": 50.0755, "Longitude": 14.4378, "AzimuthDegrees": 172, // compass bearing: 0 = north, 90 = east, 180 = south "TiltDegrees": 35, // 0 = flat, 90 = vertical "CapacityKwp": 9.2, // peak DC capacity of the array "InverterCapacityKw": 8.0, // optional; AC side, where it clips the array "LossFactor": 0.9, // fraction of DC yield that reaches the meter "InstallDate": "2024-05-01", "Inverter": { "Driver": "", // which inverter family it speaks to: "solax" (empty) or "huawei" (readings only) "Topology": "", // huawei only: "dongle" (empty) or "emma"; UnitId is then the inverter's behind the EMMA "Model": "SolaX X3-HYB-G4 PRO", "Host": "192.168.2.10", "Port": 502, "UnitId": 1, "UnmeteredGridPhase": "" // only for a grid meter missing a phase clamp: "L3" (or SolaX's "T") } } ``` - **`Driver` picks how the inverter is spoken to; `Model` is only a label.** Empty means `solax`. The driver fills in `Port` and `UnitId` when they are left out. On Settings it is the **Inverter brand** drop-down. Which models each driver covers is in [Supported PV systems](SUPPORTED_PV_SYSTEMS.md). - **`AzimuthDegrees` is stored, not used.** The Solcast forecast already knows your roof's orientation from its resource id. - **`Pv:Chargers` is ignored** since 1.4 (#445), with a warning at startup naming the plugin that replaced the built-in driver it chose. Remove it. See [Your charger](CHARGER_SETUP.md#moving-from-a-built-in-driver-13--14). - **The charger is behind a plugin**, on the [charger hub](PROVIDERS.md#the-charger-kind), always on. The charge-control limits are checked against what the plugin's charger can do when it connects, not at startup. How long Gleanvolt waits for the plugin is the `ExternalCharger` section; the defaults need no change: ```jsonc "ExternalCharger": { "ReadTimeout": "00:00:05", // a read not answered by then is a charger Gleanvolt couldn't read "CommandTimeout": "00:00:10", // a command not answered by then failed "ReadingMaxAge": "00:00:02" // a reading this recent serves the next read too } ``` - **`UnmeteredGridPhase`** is only for a grid meter with a phase clamp missing; leave it empty on a correctly wired installation. Name the blind phase (`L1`–`L3`, or SolaX's `R`/`S`/`T`) and the grid flow on it is estimated from the inverter's output on that phase. See [Unmetered grid phase](UNMETERED_GRID_PHASE.md) ([česky](UNMETERED_GRID_PHASE.cs.md)). **Checked at startup.** A configuration that cannot describe a site stops the controller with every problem listed, each naming its key: an id that is not a slug, a latitude without a longitude, a tilt outside 0–90, a loss factor outside (0, 1], an unparsable install date, a missing inverter address, an unknown driver, or an unmetered phase that is not a phase. (In [setup mode](WEB_UI.md#setup-mode) these are listed on the setup page instead.) ### Keys that have moved A configuration that still sets a retired key **stops at startup**, naming the replacement: | Retired | Replaced by | | --- | --- | | `Solax:Inverter` | `Pv:Inverter` | | `Solax:EvCharger` | `Pv:Chargers:0`, itself ignored since 1.4: the charger is its plugin's | | `Solax:PollIntervalSeconds` | `Controller:PollIntervalSeconds` | | `Weather:Latitude` | `Pv:Latitude` | | `Weather:Longitude` | `Pv:Longitude` | | `HomeAssistant:DeviceName` | `Pv:Name` | The `deploy/.env` names (`INVERTER_HOST`, `EV_CHARGER_HOST`) did not change. `EV_CHARGER_HOST` is the charger plugin's address. ## The data directory holds secrets (the `Secrets` section) **Whoever can read the data directory can read — and charge — your car.** Besides the databases, it holds: | File | What it holds | What it lets someone do | |---|---|---| | `vw-website-session.json` | a live volkswagen.de session | read the car as you, with no password and no emailed code | | `skoda-api-key.json` | the MyŠkoda Public API key | read the car, and start and stop charging | | the secret store's other entries | keys and passwords entered in the web UI (Solcast, MQTT, the car) | use those accounts | ```jsonc "Secrets": { "Directory": "data", // relative paths resolve against the content root; the .deb sets it absolutely "Store": "Auto" // "Auto" | "File" | "Dpapi" -- Auto is right everywhere } ``` | Deployment | Directory | What protects it | |---|---|---| | Docker (Linux) | `/app/data` on the `./data` bind mount | mode `0600`, plus the host directory's own mode | | .deb / systemd | `/var/lib/gleanvolt` (mode `0750`, owner `gleanvolt`) | mode `0600`, plus `ProtectSystem=strict` and `ProtectHome=true` | | Windows zip / winget | `data\` next to the exe | Windows DPAPI, current user | | Windows container | `C:\app\data` | the volume's ACLs (DPAPI is not used: the container's account does not survive recreating it) | | `dotnet run` | `src/Gleanvolt.Worker/data` | mode `0600`; gitignored | **This is file permissions, not encryption** — the service has to start unattended after a reboot, so it must be able to read its own secrets. The startup log and **Settings → Health** say which protection is in use. Against a stolen SD card, use full-disk encryption on the host. **Back the directory up accordingly**: onto an encrypted volume, and never into an issue attachment or a shared drive. **Sign out** on the [Car](WEB_UI.md#car) page deletes the stored car credentials. A secret that can't be read back (a truncated file, or a Windows profile that no longer exists) is reported as *sign in again*. Secrets that arrive as environment variables are the deployment's to protect. `Web:PasswordHash` is a one-way hash, not a secret. ## Solcast solar forecast The controller fetches your site's solar forecast from [Solcast](https://solcast.com/), caches it, and refreshes it every 12 hours by default. It is optional: without it every mode except `Forecasted` works as usual. **Getting an account.** Register at [solcast.com](https://solcast.com/) on the free home-user (hobbyist) plan. Create a **rooftop site** with your location, panel tilt, azimuth and capacity — take them from your installation, since the forecast is only as good as they are. The saved site has a **resource id**; your **API key** is in your account settings. **On the web UI:** **Settings → Installation → Solar forecast** — paste the API key and the rooftop site's resource id and press **Save and fetch**. It is used from that fetch on, with no restart, and the status line says what Solcast made of it: a refused key, an unknown site, a spent quota. A refused key or unknown site is not retried until the account changes, so a typo does not burn the day's calls. The key goes to the secret store and wins over the environment; **Remove** hands back to the environment's. **Optionally, in configuration:** ```jsonc "Solcast": { "BaseUrl": "https://api.solcast.com.au/", "ResourceId": "your-solcast-resource-id", // the rooftop site id from your Solcast account "RefreshInterval": "12:00:00" // hh:mm:ss between refreshes } ``` The API key is a secret: `Solcast__ApiKey` (`SOLCAST_API_KEY` in `deploy/.env`), never in `appsettings.json`. `SolarForecast:Source` chooses where the forecast comes from: `solcast`, the default, or `external`, a [provider](PROVIDERS.md#the-solar-forecast-kind) that publishes to Gleanvolt. **Settings → Solar forecast** sets it, at once and for the next start (saved in `pv-system.json`). While `external` is selected, Solcast is not called. With no account, the controller logs a warning and runs without a forecast. The free hobbyist tier allows about ten calls a day, and every start spends one, so keep `RefreshInterval` within your plan. ## Weather (the `Weather` section, optional) Records **what the sky was doing** at the start and end of each charging session, so a session can be read against its day. Gleanvolt calls no weather service itself (#425): an [external provider](PROVIDERS.md#the-weather-kind) sends it. The ready-made one is the [OpenWeather plugin](PROVIDERS.md#shipped-plugins), released with Gleanvolt, which reads OpenWeatherMap with a key entered on its own page. Gleanvolt gives the provider the site's [coordinates](#the-pv-system-the-pv-section). **Where it comes from: `Weather:Source`** (#424), chosen under **Settings → Installation → Weather**, in the setup wizard's Extras step, or with `gleanvolt setup`. A choice applies at once and is saved in `pv-system.json` for the next start. | `Weather:Source` | | |---|---| | `NotProvided` | No weather. Sessions are recorded without it. Also what unset means | | `External` | An external provider publishes it, e.g. the OpenWeather plugin | Any case is accepted. A value that names neither is logged and treated as unset. ```jsonc "Weather": { "Source": "External", // NotProvided or External "ExternalRequestTimeout": "00:00:15", // how long the provider has to answer "ExternalReadingMaxAge": "00:10:00" // a reading this recent is used without asking again } ``` **Upgrading from the built-in OpenWeather** (#425). Until #425 Gleanvolt called OpenWeatherMap itself, with `Weather:Source` = `OpenWeather` and a key on Settings or in `Weather__ApiKey`. At the first start after the upgrade, an installation that used it (that source chosen, or a key with nothing chosen): - gets `Weather:Source` = `External`, saved in `pv-system.json`; - has the key Settings kept deleted from the secret store. It is not handed to the plugin, which keeps its own; - logs one warning, and shows a notice under **Settings → Weather**, until a weather provider connects. `Weather__ApiKey` (`WEATHER_API_KEY`) is used for nothing but that recognition; while it is set, each start logs a warning asking for it to move to `OPENWEATHER_API_KEY`. The Pi's compose file still passes it to the controller, for the recognition, and to the plugin while `OPENWEATHER_API_KEY` is unset, so a key kept in `.env` carries over. `Weather:BaseUrl`, `Units` and `RequestTimeout` are gone and ignored. A setup document with `Weather:Source` = `OpenWeather` or a `Weather:ApiKey` is refused. See [The weather a session ran in](DATA.md#the-weather-a-session-ran-in) for what is stored. ## Grid tariff (the `Tariff` section) When the grid is cheap, for a two-rate tariff — in Czech terms the distributor's **HDO**, switching between the low rate (**NT**) and the high rate (**VT**). The tariff is shown on the Overview, in Home Assistant and on the HTTP API. **On its own it changes nothing about charging**: that is the **Low tariff only** option of [`FastNoBattery`](MODE_FAST_NO_BATTERY.md#fastnobattery-on-low-tariff-only) and [`SolarGrid`](MODE_SOLAR_GRID.md#solargrid-on-low-tariff-only), which wait for low tariff before buying from the grid. It is set up on **Settings → Installation**, under *Tariff*. A save applies at once. Like the rest of Settings it is read-only until the UI has a login. **The provider** — where the low-tariff times come from: - **None** — no tariff, the default. The Overview says nothing about a tariff and the Home Assistant entities read *unknown*. None never means "always low". - **Table** — the periods you type in, below. - **External** — windows another program publishes to Gleanvolt over its hub on the web port (#401): for a tariff a table can't hold, such as day-ahead spot prices. The token for it is the one every provider uses, made under **External providers** on the same page. The windows are saved in `external-tariff.json` beside `tariff.json`, and still count after the program disconnects or Gleanvolt restarts, until the last one ends. What such a program sends, and the rules it is held to, are in [PROVIDERS.md](PROVIDERS.md). **The table.** Enter **only the low-tariff periods**; every other minute is high tariff. There are two lists: **weekdays** (Monday to Friday) and the **weekend**. Public holidays follow the weekday list. Times are local `HH:mm`, and an end may be `24:00`. - **A period belongs to one day.** A night tariff of 22:00–06:00 is two rows, **22:00–24:00** and **00:00–06:00**. They are joined across midnight, so at 23:00 the Overview says *"Low tariff, until 06:00"*. The same works from Friday into Saturday and Sunday into Monday. - **Rows in one list must not overlap**; touching is fine (06:00–08:00 and 08:00–10:00). - **Clock changes are handled.** A time in the missing spring hour moves to 03:00; in the repeated autumn hour it is the first one. - **Today and tomorrow are drawn** under the lists, from what the form holds, so a mistyped time shows before you save. **Where to find your times.** Your distributor publishes them for your HDO code (on the HDO receiver beside the meter, and in your contract): EG.D, ČEZ Distribuce and PREdistribuce each have an *HDO* or *časy spínání* page. If your times change with the season, edit the table when they do. **Prices** per kWh for each rate, in the configured currency. Optional: without them the rate is still shown, without a price. **The file.** It is all kept in `data/tariff.json`, beside `pv-system.json`. You don't need to edit it; if you do: ```jsonc { "provider": "Table", // "None", "Table" or "External" "lowPricePerKwh": 2.10, // optional "highPricePerKwh": 4.80, "table": { // kept while another provider is selected "weekday": [ { "start": "00:00", "end": "06:00" }, { "start": "13:00", "end": "15:00" } ], "weekend": [ { "start": "00:00", "end": "08:00" }, { "start": "20:00", "end": "24:00" } ] } } ``` A missing or unreadable file, or a table that breaks a rule, is read as no tariff (with a warning in the log); Settings still shows it for fixing. **Configuration.** Two keys, neither on Settings: ```jsonc "Tariff": { "Path": "data/tariff.json", // relative to the content root unless absolute "Currency": "CZK" // ISO 4217; labels the price fields and every price shown } ``` The `.deb` sets `Tariff__Path` to `/var/lib/gleanvolt/tariff.json`. `Currency` is a label; it converts nothing. **Where it shows.** The Overview has a line under its headline — *"High tariff, 4.80 CZK/kWh, until 22:00"* — and shades low tariff along the bottom of today's plan chart. Home Assistant gets **Low tariff**, **Tariff change** and **Grid price** ([the entity table](HOME_ASSISTANT.md#what-each-entity-means)). The HTTP API has `GET /tariff`, `GET /tariff/providers` and `GET`/`PUT /tariff/settings`.