Skip to content
OBEGRÄNSAD LED

Configuration

Some settings can be changed at runtime without flashing the firmware. Change them in the Web GUI under Settings, or with the API below. On ESP32 they are saved and survive a reboot.

For build-time options such as pins and feature flags, see Flashing.

Fields

General

FieldDefaultDescription
weatherLocationHamburgCity or coordinates for the Weather plugin. The weather comes from wttr.in.
ntpServerde.pool.ntp.orgNTP server for the clock.
tzInfoCET-1CEST,M3.5.0,M10.5.0/3POSIX time zone. The Web GUI has presets.
autoStartSchedulefalseStart the plugin schedule after boot.

Strings must have 1 to 99 characters.

MQTT

FieldDefaultDescription
mqttEnabledfalseConnect to the broker.
mqttHostBroker host name or IP. Less than 100 characters.
mqttPort18831–65535.
mqttUserLess than 100 characters.
mqttPasswordWrite-only. Less than 100 characters. Leave it out to keep the stored password.
mqttTopicobegraensad/<mac>Base topic. An empty string resets it to the default.
mqttDiscoverytruePublish Home Assistant discovery.
mqttDiscoveryPrefixhomeassistantAn empty string resets it to the default.

mqttTopic and mqttDiscoveryPrefix must not contain #, + or spaces, must not start or end with / and must be shorter than 100 characters.

See MQTT and Home Assistant.

Validation

Fields with an invalid value are ignored. The other fields of the same request are still saved, and the response is still a success. Read the configuration again to check the result.

Read

GET /api/config

curl "http://<device-ip>/api/config"
{
  "weatherLocation": "Hamburg",
  "ntpServer": "de.pool.ntp.org",
  "tzInfo": "CET-1CEST,M3.5.0,M10.5.0/3",
  "autoStartSchedule": false,
  "mqttEnabled": true,
  "mqttHost": "192.168.1.10",
  "mqttPort": 1883,
  "mqttUser": "obegraensad",
  "mqttPasswordSet": true,
  "mqttTopic": "obegraensad/a1b2c3",
  "mqttDiscovery": true,
  "mqttDiscoveryPrefix": "homeassistant"
}

The password is never returned. mqttPasswordSet tells you if one is stored.

Change

POST /api/config with a JSON body. Send only the fields you want to change.

curl -X POST "http://<device-ip>/api/config" \
  -H "Content-Type: application/json" \
  -d '{"weatherLocation":"Berlin","tzInfo":"CET-1CEST,M3.5.0,M10.5.0/3"}'

After saving, the device applies the new time zone and NTP server, reconnects MQTT and refreshes the weather. A reboot is not needed.

StatusMessage
200Configuration saved successfully
400No JSON body provided
400Invalid JSON format

Reset

POST /api/config/reset restores all defaults, including the MQTT settings, and applies them.

curl -X POST "http://<device-ip>/api/config/reset"

In the Web GUI, use Settings → Reset to defaults.