Power & battery¶
This page shows how to read the battery, get a low-battery warning, and switch the display off and on.
How it behaves¶
Switching the display off only darkens the LEDs. Wi-Fi, MQTT and the apps keep running, and AWTRIX stays reachable over HTTP. The battery percentage is worked out from the battery voltage, so it is an estimate (How the percentage is derived). The low-battery warning stays off until you set a threshold.
Check the battery¶
All battery values are in the device state:
The battery part of the answer:
batteryPercentis how full the battery is.batteryVoltageis the battery voltage.
The values update every 10 seconds. The Status app shows the battery level and whether USB power is connected.
Every field: Device state → Battery fields.
Get told when the battery is low¶
GET /api/v1/device always has a lowBattery value.
lowBattery becomes true when batteryPercent is below lowBatteryThreshold (below, not
equal). Set the threshold to a percentage under Low-battery threshold in
System → Brightness & sensors of the web UI, or send:
curl -X PUT http://<awtrix-ip>/api/v1/system \
-H "Content-Type: application/json" \
-d '{"lowBatteryThreshold": 15}'
- The default is
0, which turns the warning off:lowBatterystaysfalse. - Below the threshold, the battery in the Status app blinks, unless USB power is connected.
- In Home Assistant the same warning is the Low battery sensor. See Battery in Home Assistant.
Turn the display off and on¶
This switches the LEDs off, not the clock. Your brightness settings stay as they are.
- On the clock, press the select (middle) button twice quickly. This is the only way to switch the display back on without the network.
- In the web UI, use the Power switch on the Dashboard.
With the API¶
Off:
curl -X PATCH http://<awtrix-ip>/api/v1/display \
-H "Content-Type: application/json" \
-d '{"power":false}'
On:
curl -X PATCH http://<awtrix-ip>/api/v1/display \
-H "Content-Type: application/json" \
-d '{"power":true}'
To see the current state, read power in GET /api/v1/display or matrixPower in
GET /api/v1/device. Both are false while the display is off.
Battery in Home Assistant¶
Home Assistant gets four battery entities automatically:
| Entity | Device class | Unit | Source |
|---|---|---|---|
| Battery | battery |
% | batteryPercent |
| Battery voltage | voltage |
V | batteryVoltage |
| Low battery | battery |
- | lowBattery |
| Charging | battery_charging |
- | usbPower |
- Low battery only turns on once you set a
lowBatteryThresholdabove 0 (see Get told when the battery is low).
See Home Assistant.
How the percentage is derived¶
The clock cannot measure how much charge is left. AWTRIX NG works out the percentage from the battery voltage and from whether USB power is connected. The voltages below were measured on a TC002 that ran from a full charge until it switched off, about 7 hours with the display at full brightness. The percentage is the share of that time left. A second TC002 stayed within 4 % of it:
| Battery voltage | Shown |
|---|---|
| 4.09 V or more | 100 % |
| 4.05 V | 90 % |
| 3.95 V | 60 % |
| 3.89 V | 50 % |
| 3.76 V | 20 % |
| 3.66 V | 10 % |
| 3.10 V or less | 0 % |
Between these points the value is interpolated.
What this means for you:
- With USB power the percentage only rises. It shows how far the charger has got. An empty battery took about 2.5 hours to reach full voltage with the display at full brightness. The percentage shows 100 % from then on, when the battery is nearly full. The charge light turns green later, when the charger has finished. How long that takes depends on what the clock is doing.
- What the display shows moves the percentage. A dark or switched-off display draws less power, so the voltage and the percentage read higher. A bright, full display lowers both.
- On battery the percentage only falls. It does not come back up when the display draws less power.
- Short loads, such as a sound, do not change it. The percentage follows the battery over the last five minutes.
- After you plug in or unplug, and after a restart, the percentage stays for about five minutes. Then it follows the battery again.
- There is no "time left" estimate. The voltage alone cannot tell you that.
Good to know¶
- A double press of select does nothing while Block buttons is on. Switch the display with the Power switch or a request instead.
- Notifications are not shown while the display is off. Add
"wakeup": trueto show one anyway. See Wake a dark display. - There is no sleep timer.
POST /api/v1/device/sleepdoes not put this clock to sleep. It only restarts AWTRIX NG. To save power, switch the display off.
Details¶
- Device state → Battery fields: every
battery field in
GET /api/v1/device - System configuration → Battery warning:
lowBatteryThreshold - HTTP API → Display: the display power route
Related¶
- Brightness: set the brightness
- Notifications: a notification that wakes the dark display