Skip to content

Config Editor

Jeroen Simonetti edited this page Sep 17, 2026 · 4 revisions

Config Editor

The mimirheim Config Editor is an optional web service that provides a browser-based UI for editing every mimirheim process's configuration: mimirheim core itself, and any helper that opts into the Config Service protocol. It removes the need to hand-edit YAML files: fields are rendered as labelled form inputs, valid values are enforced before anything is written, and every write is atomic and comment-preserving.

How it works

The editor never reads or writes a configuration file itself. Each process it can edit — mimirheim core, or a helper — is a Config Owner: it validates and writes its own configuration file, and announces its schema and presentation metadata over MQTT. The editor is purely a client of that protocol. This means:

  • A Config Owner appears in the editor as soon as it connects to the broker, with no editor-side configuration or restart needed.
  • A Config Owner that is not currently running does not appear at all. If a previously-visible Config Owner stops, it disappears from the list; the editor keeps serving every other Config Owner without interruption.
  • A Config Owner running in a separate container works identically to one running in the same process as mimirheim core, as long as both reach the same MQTT broker.

Prerequisites

The editor needs its own MQTT broker connection to discover Config Owners — the same broker every other mimirheim process uses. There is no local-only or MQTT-optional mode, including for editing mimirheim core's own configuration.

Enabling the editor

Create config-editor.yaml in your /config directory. It must at minimum specify how to reach the broker:

mqtt:
  host: localhost

An empty (or entirely absent) file is also accepted: the editor still starts, and falls back to any MQTT connection details supplied by the environment (this is how the Home Assistant add-on works, since the Supervisor injects broker credentials automatically). It is the one process allowed to start before its own config file exists, since it is the tool a first-time user relies on to create every other file.

Then restart the container. The editor service starts automatically.

Accessing the UI

Open http://<container-host>:8099 in a browser.

If you use Docker host networking, the editor is accessible on port 8099 of the host machine. If you use bridge networking, map the port explicitly:

docker run -d \
  -v /path/to/your/configs:/config \
  -p 8099:8099 \
  mimirheim

Configuration

The example config file is at /app/examples/config-editor.yaml inside the container. Only mqtt has no default.

Field Default Description
mqtt (required, or supplied by the environment) Broker connection used to discover Config Owners. See Configuration for the shared mqtt: fields.
port 8099 TCP port the editor listens on. Change this if the default conflicts with another service.
log_level INFO Logging level. One of DEBUG, INFO, WARNING.
allowed_ip (none — all IPs accepted) If set, only HTTP requests from this source IP are served; all others get 403 Forbidden. In the Home Assistant add-on this is set automatically to the ingress proxy's address.

There is no disabled field: ENABLE_CONFIG_EDITOR is the editor's only off-switch, set outside this file, the same as every other service. See Environment Variables.

Changing the port

In host networking mode, change the port if 8099 is already in use:

mqtt:
  host: localhost
port: 8321

Remember to also update the -p flag in your docker run command if using bridge networking.

Using the editor

The editor opens to a discovery page listing every Config Owner currently announcing itself: mimirheim core, plus any helper that has opted into the protocol and is currently running. Clicking a Config Owner opens its own page, rendered directly from the fields, labels, help text, and grouping it declared.

  • Basic vs. Expert fields. Each Config Owner marks its own fields as Basic (shown immediately) or Expert (collapsed behind an "Advanced" disclosure). Fields with no sane default are always Basic.
  • Conditional fields. Some fields only appear once another field has a particular value — for example, a helper's Home Assistant discovery topic fields only appear once discovery is enabled for that helper.
  • Saving. Submitting the form sends your edits to that Config Owner, which validates them against its own configuration rules and, only if they pass, writes its file. A validation failure is shown inline with the specific error, and your in-progress edits are kept so you can fix and resubmit.
  • Each Config Owner keeps its own separate configuration file; the editor does not merge them or store any values of its own.

Validation

Every save is validated by the owning process itself — the same Pydantic model it would use to validate its file at startup — so a save that succeeds here cannot later fail to start the process.

Atomic, comment-preserving writes

Every Config Owner writes its file the same way: to a temporary file in the same directory, then renamed over the target, so a crash or interrupted save never leaves a half-written file. Existing YAML comments in the file are preserved across the write.

Example: this config with inline comments:

batteries:
  home_battery:
    capacity_kwh: 10.0  # Tesla Powerwall 2
    # Charge efficiency degrades above 0.8 SOC
    charge_segments:
      - power_max_kw: 5.0
        efficiency: 0.95

After editing capacity_kwh to 12.0 in the GUI, the file becomes:

batteries:
  home_battery:
    capacity_kwh: 12.0  # Tesla Powerwall 2
    # Charge efficiency degrades above 0.8 SOC
    charge_segments:
      - power_max_kw: 5.0
        efficiency: 0.95

All comments are preserved; only the edited value changes.

Limitations:

  • New devices or list entries added via the GUI start with no comments. Add them manually after saving.
  • Comments attached to a deleted entry are removed with it.

After saving, restart the affected process (or the whole mimirheim container) for the new configuration to take effect. Every mimirheim process reads its config once at startup and does not reload it at runtime.

Security note

The editor has no authentication of its own. In the Home Assistant add-on it is reachable only through HA ingress, which is restricted to the ingress proxy's address; outside the add-on it is designed for use on a trusted private network (e.g. a home LAN or a local Docker network). Do not expose port 8099 to the internet or to untrusted networks.

Clone this wiki locally