System configuration¶
GET/PUT /api/v1/system holds the system configuration of AWTRIX: Wi-Fi, MQTT and Home
Assistant, time server and time zone, device name and login, the battery warning, the buttons and
mirroring. This page describes every field.
It is one flat JSON object without nesting.
Settings are something different: they control how the display behaves –
brightness, apps, transitions – and are written with PATCH /api/v1/settings.
Most system fields take effect only after a restart:
curl -X POST http://<awtrix-ip>/api/v1/device/reboot. The "Reboot" column in each table shows
which fields apply at once.
Read the whole configuration¶
Returns 200 with the full configuration as a flat JSON object, using the field names on this
page:
{
"wifiSsid": "MyNetwork",
"netStatic": false,
"mqttHost": "192.168.1.10",
"mqttPort": 1883,
"hostname": "kitchen-clock",
"lowBatteryThreshold": 15
}
wifiPass, mqttPass and authPass are secrets and are left out of a normal GET. Add
?secrets=1 – GET /api/v1/system?secrets=1 – to get them too. The web UI's backup export uses
this so that you can restore the backup later. In setup mode any secrets query parameter is refused with 403 forbidden, because
anyone nearby can join the open setup hotspot. A PUT answer never contains the secrets.
Write a configuration¶
PUT takes only the keys you want to change. Keys you leave out keep their stored value.
Unknown keys are ignored without an error.
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"mqttHost":"192.168.1.10","mqttPort":1883,"mqttUser":"awtrix"}'
Returns 200 with the new configuration (same as GET, without secrets). The change is saved at
once.
A rejected write changes nothing. All answers and error messages of this route are in Errors – PUT /api/v1/system.
Always send Content-Type: application/json. Without it, curl -d marks the body as a form, and
AWTRIX refuses the PUT with 415 (Content-Type).
What PUT checks¶
AWTRIX checks the type and range of every number before it stores anything. A wrong value is
rejected with 422 validationFailed, and field names the key – the same as with
PATCH /api/v1/settings.
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" -d '{"webPort":70000}'
The allowed range of each field is in the "Range" column of its table.
Whole-number fields also reject other values ({"mqttPort":"eighty"} and {"tempDecimals":1.5}
both fail with 422). Decimal fields accept any number in range.
What PUT does not check¶
Apart from the number ranges, the IP address fields, mqttTlsPin and the rules in the next
section, text fields are not checked. Unknown keys are ignored.
Switches, blank fields and secrets¶
MQTT and the login each have an on/off switch: mqttEnabled for MQTT, authEnabled for the login.
The feature runs only while its switch is true. Switching it off keeps host, user name and
password, so you do not need to type them again later. Because the switch decides, you can leave
mqttHost and authUser empty whenever you like.
You can switch a feature on only when it has what it needs. Otherwise you get 422 validationFailed:
| Set | Requires | Field named on 422 |
|---|---|---|
mqttEnabled: true |
a non-empty mqttHost |
mqttHost |
authEnabled: true |
a non-empty authUser and authPass |
authUser |
wifiSsid cannot be emptied with PUT (422, field: wifiSsid), because an empty network name
sends AWTRIX into setup mode. The error points you to POST /api/v1/device/factory-reset.
An empty value for one of the three secrets is ignored and the stored secret stays. So a PUT can
set or change a password, but never delete one. To stop using a feature, switch it off. To delete
all stored secrets, use POST /api/v1/device/factory-reset.
The API does not tell you when a restart is needed. The web UI shows its "reboot required" note after every save, even for fields that apply at once. Use the "Reboot" column in the tables below.
Keys without effect¶
GET also returns these keys. You can write them, and they are checked and stored, but they
change nothing on this clock:
webPort: the web server always uses port 80.tempOffset,humOffsetandbatteryDividerRatio: the clock has no temperature sensor and measures its battery itself.minBrightness,maxBrightness,ldrFactor,ldrGamma,ldrOnGroundandbrightnessSmoothing: see Auto-brightness.dfplayer,artnetandtempDecimals.
There are no panel or pin keys. A PUT or a restored backup ignores such keys like any unknown
key. See Panel.
Wi-Fi¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
wifiSsid |
string | - | "" |
Network name to join. Cannot be emptied with PUT (see above). Not checked for format. |
yes |
wifiPass |
string | - | "" |
Wi-Fi password. Secret: never returned; an empty value on write keeps the stored one. | yes |
netStatic |
bool | - | false |
false = get the address from the router (DHCP). A fixed address is used only when netStatic is true and ip is set. |
no |
ip |
string | dotted quad, optional /0–/32 suffix |
"" |
Fixed IP address. You can add the mask as a suffix: 192.168.1.50/24 is stored as ip + subnet (sending a subnet in the same request as well is a 422). With netStatic: true but an empty ip, AWTRIX stays on DHCP. Invalid values are rejected with 422; "" leaves it unset. |
no |
gateway |
string | dotted quad | "" |
Gateway (router) address. Also used as DNS server when dns1 is empty. |
no |
subnet |
string | dotted quad | "" |
Subnet mask. GET always shows the mask here, even if you set it with the /24 suffix. Required when netStatic is true and ip is set – otherwise the write is rejected with 422. |
no |
dns1 |
string | dotted quad | "" |
First DNS server. Empty → the gateway. | no |
dns2 |
string | dotted quad | "" |
Second DNS server. Empty → none. | no |
wifiConnectTimeout |
long | 5000–120000 ms | 15000 |
How long AWTRIX tries to join at startup before it opens its setup hotspot. Raise it for a network that connects slowly. While the setup hotspot is open, AWTRIX tries the stored network every 60 s. | yes |
wifiRoamRssi |
int | −90–0 dBm | 0 |
Switch to a stronger access point when the signal is weaker than this. 0 = off. The signal must stay below the value for about 30 s, and AWTRIX switches at most once every 5 minutes. Switching means a short disconnect of a second or two, and MQTT reconnects too. |
yes |
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"wifiSsid":"MyNetwork","wifiPass":"secret123"}'
A fixed address needs netStatic and ip together:
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"netStatic":true,"ip":"192.168.1.50/24","gateway":"192.168.1.1"}'
/24 is the mask; "ip":"192.168.1.50","subnet":"255.255.255.0" means the same.
Other Wi-Fi details cannot be changed: power saving is always off, channels 12 and 13 work, and AWTRIX checks the connection every 5 s and reconnects if it dropped.
MQTT and Home Assistant¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
mqttEnabled |
bool | - | false |
Main switch for MQTT. false → no connection; host, user and password stay stored. true needs a mqttHost, otherwise 422 validationFailed. |
yes |
mqttHost |
string | - | "" |
Broker host name or IP address. You may leave it empty; mqttEnabled decides whether MQTT runs. A .local name only works if something on your network answers for it (mDNS); an IP address always works. |
yes |
mqttPort |
uint16 | 1–65535 | 1883 |
Broker port. Outside 1–65535 → 422 validationFailed. |
yes |
mqttUser |
string | - | "" |
Broker user name. Not a secret – GET returns it. If user and password are both empty, AWTRIX connects without login. |
yes |
mqttPass |
string | - | "" |
Broker password. Secret: left out of GET; an empty value on write keeps the stored one. |
yes |
mqttTls |
bool | - | false |
Connect over TLS, usually on port 8883. AWTRIX accepts only a broker whose certificate comes from a public certificate authority and names mqttHost, or whose certificate you trusted with mqttTlsPin. An uploaded broker CA replaces both; see MQTT → Connect over TLS. |
yes |
mqttTlsPin |
string | 64 hex digits | "" |
SHA-256 of the broker certificate you trust, in lowercase hex, as GET /api/v1/mqtt/tls shows it. "" trusts none. Anything else → 422 expected 64 lowercase hex digits. Applies at the next connection attempt. |
no |
mqttPrefix |
string | - | "" |
Start of every topic. Empty → the device uid (MAC address in lowercase, without colons). Used for <prefix>/cmd/#, <prefix>/availability and <prefix>/state/*. |
yes |
haDiscovery |
bool | - | false |
Announce AWTRIX to Home Assistant on <haPrefix>/device/<uid>/config. The MQTT topics stay the same either way. Applies at once while connected. Switching it off removes AWTRIX from Home Assistant. |
no |
haPrefix |
string | - | "homeassistant" |
Home Assistant discovery prefix. Empty → homeassistant. When you change it, AWTRIX removes the announcement from the old topic and publishes it on the new one. |
no |
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"mqttEnabled":true,"mqttHost":"192.168.1.10","mqttPort":1883,"mqttPrefix":"awtrix","haDiscovery":true}'
To turn MQTT off, set the switch and restart. Host, port, prefix and login stay stored, so you can switch it on again later without typing them again:
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"mqttEnabled":false}'
See MQTT topics and Home Assistant.
Time¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
ntpServer |
string | - | "pool.ntp.org" |
Time server (NTP – gets the exact time from the internet). Applies at once. | no |
tz |
string | POSIX TZ | "CET-1CEST,M3.5.0,M10.5.0/3" |
Time zone rule in POSIX format (default: Central Europe with daylight saving time). This is the value AWTRIX uses. Applies at once. Not checked – a wrong string gives no error, just the wrong time. | no |
tzName |
string | IANA zone | "Europe/Berlin" |
The name of the zone, for example America/New_York. Only a label for the web UI; it does not change the time. |
no |
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"tz":"EST5EDT,M3.2.0,M11.1.0","tzName":"America/New_York","ntpServer":"time.cloudflare.com"}'
Daylight saving time needs no extra setting: the change dates are the M rules in the POSIX
string.
You can write tz alone – the web UI then shows the first zone that uses this rule. Writing
tzName alone does not change the time. The web UI's time zone picker writes both.
Identity, web server and authentication¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
hostname |
string | - | "" |
The device name: network name, name of the setup hotspot, mDNS name (http://<hostname>.local) and name for discovery tools. Empty → awtrixng- plus the last 6 characters of the Wi-Fi MAC address (for example awtrixng-a1b2c3). In Home Assistant an empty name shows as AWTRIX NG. |
yes |
authEnabled |
bool | - | false |
Main switch for the login (HTTP Basic auth). true → every request needs user name and password (realm AWTRIX NG); without them the answer is 401. true needs authUser and authPass, otherwise 422 validationFailed. false → no login needed; the stored login stays. Applies at once. |
no |
authUser |
string | - | "" |
Login user name. You may leave it empty; authEnabled decides whether a login is needed. |
no |
authPass |
string | - | "" |
Login password. Secret: left out of GET; an empty value on write keeps the stored one. Applies at once. |
no |
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"hostname":"kitchen-clock","authEnabled":true,"authUser":"admin","authPass":"hunter2"}'
The login applies from the next request on – including the answer to this PUT. To switch it off
again, send the current login with the request. User name and password stay stored:
curl -u admin:hunter2 -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"authEnabled":false}'
The setup hotspot has no password
The setup hotspot is open, so you can join it to set AWTRIX up. The login is off by
default, so until you turn on authEnabled, anyone nearby can read the configuration and enter
Wi-Fi details. Set AWTRIX up somewhere you trust and connect it to your Wi-Fi soon.
A login you switched on also applies in setup mode. In setup mode AWTRIX answers only a few
requests: the setup page, device/setup status, PUT /api/v1/system with only wifiSsid,
wifiPass and hostname, POST /api/v1/device/reboot and restoring a backup
(POST /api/v1/restore). Logs, scripts, file lists, secrets export and other uploads answer
403. See the
setup allow-list.
Battery warning¶
| Key | Type | Range | Default | Units | Effect | Reboot |
|---|---|---|---|---|---|---|
lowBatteryThreshold |
uint8 | 0–100 (0 = off) |
0 |
% | Below this battery percentage, GET /api/v1/device reports lowBattery: true (and the Home Assistant "Low battery" sensor turns on). 0 switches the check off. |
no |
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"lowBatteryThreshold":15}'
The clock measures its battery by itself. See Power & battery.
Auto-brightness¶
The clock has no light sensor. autoBrightness is accepted, but the display always uses the
brightness setting. minBrightness, maxBrightness, ldrFactor, ldrGamma, ldrOnGround and
brightnessSmoothing are checked and stored, but change nothing. minBrightness must still not be
greater than maxBrightness.
Panel¶
The panel is 52 × 16 pixels and cannot be changed. There are no panel or pin keys:
GET /api/v1/capabilities reports the size with configurable: false.
Buttons¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
swapButtons |
bool | - | false |
Swaps left and right: left → next app, right → previous app. The middle (select) button is never swapped. Applies at once. | no |
buttonCallback |
string | URL | "" |
Web address AWTRIX calls on every press and release, and when the knob turns. Empty = off. Applies at once. | no |
With buttonCallback the buttons can control something in your home – a lamp, a scene, a Node-RED
flow. Set it to the URL of your listener. AWTRIX sends a POST with
Content-Type: application/json and this body:
button is left, middle or right. state is true when the button goes down and false
when it is released. uid is the device ID from GET /api/v1/device.
The knob reports too. Pushing it sends
"button":"knob" with state, like a button. Turning it sends turn instead of state: the
number of clicks, positive clockwise, negative counterclockwise.
Clicks that come faster than your listener answers are added up into one call, so a quick turn
sends one call with a larger turn, not one per click.
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"buttonCallback":"http://192.168.1.20:1880/awtrix-button"}'
Good to know:
- One press means two calls –
"state":truewhen pressed,"state":falsewhen released. React totrueand ignore the other, or measure the time between them to detect a long press. - The buttons keep working normally. They still switch apps, and the knob still sets
brightness and volume. Use
blockNavigationif the buttons and the knob should only control your automation, or a script that returnstruefromon_button()to handle presses on its own screen. middle, notselect– MQTT and scripts call the same buttonselect. The names follow the wiring:swapButtonsdoes not rename them.- Only
http://, nohttps://and no login, so keep the listener in your home network. Anhttps://URL sends nothing. - No answer needed – AWTRIX ignores the answer, does not follow redirects and does not retry.
- Answer quickly. AWTRIX calls in the background, so the display never waits. It gives up after 1 s to connect and 2 s for the answer. While your listener is slow, AWTRIX keeps up to 16 calls waiting and drops further presses.
uidis the clock's MAC address, so several clocks can share one listener.
With MQTT you may not need this at all – state/buttons/<button> reports
the same presses, and Home Assistant finds them by itself.
event/knob reports the knob turns.
The debounce time and the double-press time are fixed and cannot be changed.
Mirroring¶
Shows the display of one clock on other clocks with a panel of the same size. The port for it,
UDP 4212, is open only while mirrorShare is on or mirrorFrom names a clock. All six keys apply
at once.
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
mirrorShare |
bool | - | false |
Lets other clocks show this display. Any device on the network can watch; there is no login. | no |
mirrorShareApps |
string | app names, comma separated | "*" |
Which apps are shared. * = all, "" = none. Case does not matter. |
no |
mirrorShareNotifications |
bool | - | true |
Whether notifications are shared. | no |
mirrorFrom |
string | IP address or host name | "" |
The clock whose display this clock shows. "" = mirror nothing. |
no |
mirrorFromApps |
string | app names, comma separated | "*" |
Which apps of that clock are shown. * = all, "" = none. |
no |
mirrorFromNotifications |
bool | - | true |
Whether that clock's notifications are shown. | no |
What a mirroring clock shows, and the state in GET /api/v1/device, are described in
Mirroring.
Miscellaneous¶
| Key | Type | Range | Default | Effect | Reboot |
|---|---|---|---|---|---|
statsInterval |
long | 1000–600000 ms | 10000 |
How often device state is published over MQTT – for plain MQTT and Home Assistant. Outside 1 s–10 min → 422. |
yes |
debugMode |
bool | - | false |
Writes detailed messages about requests and commands to the serial port and the log console. Off keeps the log short. Applies at once. | no |
scriptingEnabled |
bool | - | true |
Main switch for scripts. Off no script runs. Your scripts are not deleted, and you can still list, read, edit and delete them – so you can fix a script that made the clock unreachable. Changes take effect after the next restart with the switch on again. | yes |
Install, read and remove scripts with /api/v1/apps/script/{name}; the script
language is described in the Scripting guide.
The color settings colorCorrection and colorTint are in Settings, not here.
Wi-Fi scan¶
GET /api/v1/system/wifi-scan searches for Wi-Fi networks.
The first call starts a search and answers 202. Ask again until you get 200.
| Status | Body |
|---|---|
202 |
{"scanning":true} – search starting or still running |
200 |
list of networks |
[
{ "ssid": "MyNetwork", "rssi": -52, "enc": true },
{ "ssid": "GuestWiFi", "rssi": -78, "enc": false }
]
enc is true for a network with a password and false for an open one. After the list has been
returned once, it is gone; the next request starts a new search.
Searching does not work while the setup hotspot is open (503 scanUnavailable). Type the
network name by hand. Searching works once the clock is connected to a network.
Persistence and resets¶
Every PUT is saved at once. A field you have never written keeps its default, so a firmware
update that adds a new field does not change your existing configuration.
| Route | Clears | Keeps |
|---|---|---|
POST /api/v1/settings/reset |
the stored settings only | all system configuration – Wi-Fi, MQTT |
POST /api/v1/device/factory-reset |
Settings, system configuration, all files (icons, melodies, palettes, scripts), and stored Wi-Fi credentials | nothing |
A factory reset cannot be undone and takes AWTRIX off your network
It deletes the stored Wi-Fi details and wifiSsid, so AWTRIX starts in setup mode with its own
network. All files are deleted. There is no confirmation and no undo.
Factory reset works only over HTTP. Restart, sleep and settings reset also work over MQTT.
Related¶
- Settings – brightness, apps, transitions and colors
- Device state – live values such as
batteryPercentandlowBattery - MQTT topics
- Errors – PUT /api/v1/system