Battery level
Displays the current battery level of the device.
Battery level
Displays the current battery level of a device as a battery-shaped indicator with the value rendered inside it. Ships as a built-in widget in ThingsBoard.
Default data keys
- batteryLevel (function) — battery charge,
%, 0 decimals
Default appearance
| Setting | Default |
|---|---|
| Layout | Vertical, solid fill |
| Sections | 4 |
| Value shown inside the shape | Yes, auto-scaled font |
| Widget size | 2.5 × 2.5 grid cells |
The fill color follows the value by range:
| Battery level | Color |
|---|---|
| below 25% | Red |
| 25–50% | Amber |
| above 50% | Green |
How to customize
The widget has a basic configuration mode, so a datasource and the visual settings can be set without editing the advanced widget config. Available settings: layout (vertical/horizontal, solid/divided), section count, value visibility and font, value color, battery fill color (constant or range-based), battery shape color, and background.
Share Your Widget with the Community
Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.