ThingsBoard offers a rich library of out-of-the-box widgets: charts, maps, value cards, alarm tables, and switches and buttons to control devices. This is enough if the dashboard only needs to display device data and control hardware. Things get more interesting when device operations need to be combined with business logic already running in an existing backend: orders, pricing, and billing.

We then face an alternative. We can build a separate UI alongside ThingsBoard, with its own authentication, roles, and mobile app, or write a ThingsBoard custom widget, meaning custom HTML, CSS, and JavaScript code that runs inside the dashboard, has access to ThingsBoard’s data and API, and can simultaneously communicate with the backend. By choosing ThingsBoard, we get the ready-made interface, authentication, and roles directly from ThingsBoard itself. We can also use the existing mobile app instead of building one from scratch.

For ThingsBoard Cloud, it is readily available on Google Play and the App Store, while for a self-hosted PE instance, a branded app can be built from ThingsBoard’s open-source project. The exact same dashboards, along with custom widgets, work inside this app. (This has its limitations, but more on that later). Thanks to custom widgets connected to the backend, users can carry out their work directly within the dashboard.

The fluid-collection PoC behind this article

We put this second approach, custom widgets talking to a ThingsBoard custom backend, to the test in practice. Recently, we built a PoC of a system for collecting used process fluids from repair shops and manufacturing plants, building its entire user interface out of ThingsBoard widgets. The system includes several roles: a coordinator schedules pickups, drivers work within the ThingsBoard mobile app, technicians install level sensors in tanks (measuring fluid contamination was also planned for the next phase), and site operators monitor the status of their tanks.

Under the hood, it runs ThingsBoard PE 4.1.0 alongside a Django backend that calculates volumes, pricing, and billing. The result is a single business application inside ThingsBoard. Pickup scheduling runs as one ThingsBoard React widget that holds a whole React application, and Django handles billing calculations. Authentication, ThingsBoard user roles, and the mobile app come from the platform itself, without requiring a separate frontend.

In this article, we walk through the custom widget capabilities described in the ThingsBoard documentation. For each feature, we share whether we used it in the project and, if not, why. This article is aimed at developers and tech leads starting with custom widgets who want to know what to look out for before writing their first large widget. We will spoil the outcome right away: we used surprisingly little of the ThingsBoard Widget API. Almost always for the same reason, which was a single early decision about where we store the data. In the end, each of our custom widgets was a ThingsBoard Static widget that fetched its own data.

We skip the editor tabs and the onInit / onDataUpdated / onDestroy lifecycle. They are well covered in the ThingsBoard widget development guide and the Widget API documentation. Here, we focus on the decisions.

Key takeaways

  • Decide where the single source of truth for each piece of data lives before you pick a widget type. That one decision sets the type, the refresh mechanism, and how much of the Widget API you will use.

  • In our PoC on ThingsBoard PE 4.1.0 with a Django backend, every custom widget was of the Static type and fetched its data from the backend.

  • In ThingsBoard 4.1, self.ctx.currentUser only carries the fields of the session JWT token, so the widget never sees PE roles, user groups, or permissions.

  • A hidden button is not access control, so the backend resolves the user through GET /api/auth/user and checks the role on every request.

  • The ThingsBoard app renders dashboards in a WebView, and in our project it limited geolocation, background execution, and refresh control, so test mobile features inside the app.

Choosing the ThingsBoard custom widget type starts with the data

When you add a ThingsBoard custom widget to the widget library, the platform first asks for its type before you write even a single line of code. It is easy to treat the type as just another category in the library, but it dictates something far more important: what the dashboard subscribes to on the widget’s behalf and what ends up in self.ctx.

Type What you ge from ThingsBoard When to choose it
Latest values
The latest value of each key; in self.ctx.data, one value per key
Cards, gauges, status tiles
Time series
Data from the dashboard’s (or widget’s) time window as [ts, value] arrays
Charts, historical tables
Control (RPC)
Target device and self.ctx.controlApi
The widget sends commands to the device
Alarm
Alarms from the selected source, with pagination and filtering
Custom alarm list or map
Static
Nothing: no datasource or subscription
The widget fetches data on its own

However, this table assumes that all data resides in ThingsBoard. In the architecture we are discussing, this is not the case. Devices send data to ThingsBoard via MQTT, users across various roles work in dashboards, and business logic (orders, pricing, billing) runs in a custom backend that communicates with ThingsBoard and the widgets via REST. The backend is indispensable here.

ThingsBoard then largely becomes a transport and presentation layer. It ingests device data, reacts to it with rules and alarms, handles authentication, and displays dashboards. Business logic and the single source of truth for business data remain in the backend. That is why, for every widget, the first question must be: where does the data it needs to display actually live?

Why a ThingsBoard custom backend instead of the Rule Engine

A proponent of “pure” ThingsBoard might ask why a ThingsBoard custom backend is needed at all when the platform has the ThingsBoard Rule Engine. The Rule Engine can enrich a message with customer, device, or related entity attributes, so a simple price list stored as a customer attribute could technically be computed there. The trouble starts beyond that.

Contracts with validity periods, pricing dependent on zones, fluid types, and contract terms, price change history, numbering and issuing billing documents, approval workflows: these are relational and transactional data that fit poorly into the telemetry and attributes model. Logic spread across rule chain nodes and scripts is also harder to test, version control, and review in code reviews than regular code. In our project, the Rule Engine did what it was designed for, which is reacting to device data, such as detecting sensor events and raising alarms. The backend handled billing.

Thingsboard architecture; WizzDev

Figure 1. An architecture where a custom backend is an integral component. Custom widgets connect its logic to users in every role. Conceptual diagram.

When a ThingsBoard static widget is the right choice

The choice of type then looks as follows:

  • Everything the widget displays comes from the backend: Static type. Types with datasources offer no benefit here, as the dashboard would subscribe to data that the widget never reads. This was the case in our project. Every one of our custom widgets was a ThingsBoard Static widget; none used datasources, implementedonDataUpdated, or read self.ctx.data. As a result, the person configuring the dashboard does not have to configure a datasource that the code never uses anyway.

  • Part of the data is in ThingsBoard and part in the backend, e.g., a sensor-level chart next to an order list: Latest values or Time series for ThingsBoard data and fetch for the rest. In that case, however, the widget has two independent refresh sources, which we discuss below. Often, it is simpler to split this into two widgets: a standard chart and a custom widget with the list.

  • The backend writes its results back to ThingsBoard as attributes or telemetry (this was the case with calibration in our project): regular types with datasources work fine, and often an out-of-the-box widget is sufficient, making a custom widget unnecessary.

  • The widget displays device data exclusively and does not modify anything: types with datasources or out-of-the-box widgets right away, without a backend. This is how we built the demo site operator dashboard, which we discuss below.

  • Control (RPC) and Alarm are selected regardless of whether you have a backend, because device control and alarms are handled by ThingsBoard’s built-in mechanisms. The backend can, at most, react to their outcomes.

Four data sources and who is responsible for refreshing

The first three are described in the documentation. The fourth appears in most real-world systems.

  • Dashboard datasources. Entity aliases, the time window, filters, and live updates via onDataUpdated are provided without writing any code. Limitation: the widget only sees what has been configured on the dashboard.

  • Custom subscription.self.ctx.subscriptionApi.createSubscription() opens a live subscription independently of the dashboard configuration. This comes in handy when a widget needs real-time telemetry from devices it selected dynamically, e.g., from a list returned by the backend:

				
					// Live level of one device, independent of the dashboard's aliases
var options = {
    type: 'latest',
    datasources: [{
        type: 'entity',
        entityType: 'DEVICE',
        entityId: deviceId,                               // e.g. from your backend's response
        dataKeys: [{ name: 'level', type: 'timeseries' }]
    }],
    callbacks: {
        onDataUpdated: function (subscription) { renderLevel(subscription.data); }
    }
};
self.ctx.subscriptionApi.createSubscription(options, true).subscribe(function (sub) {
    self.levelSub = sub;
});

self.onDestroy = function () {
    if (self.levelSub) { self.ctx.subscriptionApi.removeSubscription(self.levelSub.id); }
};
				
			
  • ThingsBoard REST API. self.ctx.http is an Angular HttpClient that automatically attaches the logged-in user’s token. You can call any endpoint the user has permissions for with a single line of code. ThingsBoard’s Angular services are also available via the injector: attributeService, entityService, deviceService, alarmService, entityRelationService, and others.
				
					var attributeService = self.ctx.$scope.$injector.get(self.ctx.servicesMap.get('attributeService'));
attributeService.getEntityAttributes({ entityType: 'DEVICE', id: deviceId }, 'SERVER_SCOPE', ['capacity'])
    .subscribe(function (attrs) { /* [{ key, value, lastUpdateTs }] */ });
				
			

We did not use these services at all. All ThingsBoard calls went through self.ctx.http, and we wrote the REST paths manually. We would do the exact same thing today, though for a reason other than convenience. The REST API is a documented interface that also changes between versions, but less frequently and with changes detailed in the release notes. Angular services are internal UI code, and that code changes. In version 3.0, ThingsBoard rewrote the entire UI from AngularJS 1.5 to Angular 9, and version 4.1 already runs on Angular 18. The less a widget depends on internal code, the easier the next upgrade is.

  • Custom backend. Business data that does not fit into ThingsBoard (orders, routes, pricing, billing) is fetched from your own API using a standard fetch. You are then solely responsible for CORS, authentication, and error handling. There can also be no secrets in the widget code, as it is plain JavaScript running in the user’s browser.

Thingsboard data sources; WizzDev

Figure 2. Four custom widget data sources. Our custom widgets used only the last two. Conceptual diagram.

Who refreshes the data when a widget has two sources

The most critical decision in the project concerned who is responsible for refreshing. If a single widget takes data from both (1) and (4), it receives it from two sources that update at different times. The same tank might momentarily display different levels in two places on the screen. For our custom widgets, we opted for the backend as the single source. It was already storing a copy of the telemetry required for calculations anyway, so widgets could fetch everything from one place. Even the technician’s widget—which in its first two iterations read the latest measurement and signal quality directly from ThingsBoard—fetched them from the backend in the final version.

This decision comes at a price, and it pays to know it from the start. You lose the time window, entity aliases, filters, and dashboard states because all of them operate through datasources. There is also a consequence that is easy to overlook: ThingsBoard permissions do not protect data coming from your API. A customer user sees only their customer’s devices in ThingsBoard, but the backend knows nothing about this. It must determine the user, their customer, and their role on its own for every request. How we handled this is covered in the section on roles.

Choose the attribute type deliberately when writing data

A widget can modify data in ThingsBoard in two ways, via attributes or via RPC. The call itself takes a single line of code. Choosing what to use and where requires much more care.

  • Server attributes (server) are visible to ThingsBoard, rule chains, and the UI, but not to the device.

  • Shared attributes (shared) reach the device. If the device subscribes to attribute updates, it receives the new value immediately upon saving. They are well-suited for configurations used by the device itself, such as measurement reporting intervals.

  • Client attributes (client) are sent by the device. A widget should not write them.

RPC via self.ctx.controlApi.sendOneWayCommand(method, params, timeout) or sendTwoWayCommand(...) requires a Control widget type with a target device. The device must also be listening for commands. Our level sensors were battery-powered, slept most of the time, and had nothing to control, so RPC was not needed. If you have sleeping devices and need to send them commands, look into persistent RPC. Such a command waits for the device to wake up instead of timing out immediately.

Why sensor calibration goes through the backend

Sensor calibration turned out to be an interesting case. The technician mounts the sensor, measures the level before and after a test fill, and then submits the result. The simplest approach is a widget that saves the calibration directly as a device attribute. We took a different path. The technician’s custom widget submits a form to the backend, an authorized user approves the installation, and only then does the backend write the result to ThingsBoard as server attributes. Server attributes, rather than shared ones, because the backend calculates the volume, and the sensor has no need for this value.

Thingsboard instalation flow; WizzDev

Figure 3. Who writes what: the widget never writes calibration to ThingsBoard on its own. Conceptual diagram.

Behind this lies a principle we recommend to anyone running a custom backend alongside ThingsBoard. Every piece of data has a single source of truth, and synchronization flows in one direction. For installation data, the single source of truth is the backend, as it holds the approval and history. A widget writing directly to ThingsBoard would bypass both.

Why the widget knows less about ThingsBoard user roles than it seems

self.ctx.currentUser looks like a user object, but it only contains data from the session JWT token. In ThingsBoard 4.1, it has the following fields:

				
					interface AuthUser {
  sub: string;          // login (email)
  scopes: string[];     // e.g. ['CUSTOMER_USER']
  userId: string;
  firstName: string;
  lastName: string;
  enabled: boolean;
  tenantId: string;
  customerId: string;
  isPublic: boolean;
  authority: Authority; // SYS_ADMIN | TENANT_ADMIN | CUSTOMER_USER | ...
}
				
			

There are no roles, user groups, or permissions here. In PE, permissions stem from roles assigned to user groups, and the widget does not receive them. Based on currentUser, it can at best tailor the user interface. Action visibility conditions work similarly, allowing you to hide a header button from certain roles:

				
					// Action editor, "Show action function", arguments: widgetContext, data
return widgetContext.currentUser.authority === 'TENANT_ADMIN';
				
			

A hidden button is not access control. The user can still execute whatever the button would have called.

Our widgets did not check roles at all. What a given role saw in the interface was determined by which dashboard their user group was assigned. With clearly distinct roles, we consider this a cleaner approach. Each widget stays simple, while dashboard access is governed by ThingsBoard permissions, which are designed for precisely that. A single widget adapting itself to all roles only makes sense when the roles see almost the exact same thing.

The dashboard for a given role is unified and shared across all customers. Whose data the widget displays is determined by the session, not by the dashboard configuration. We created users in ThingsBoard and synced them to the backend, so when someone logs into ThingsBoard, the backend knows which data to return to them.

The backend determined the user from the ThingsBoard session token rather than from an identifier sent by the widget, as such an identifier is easy to tamper with in the browser. For the same reason, the backend enforces roles independently: just because a technician cannot see the coordinator’s button does not mean they cannot call their endpoint.

How the backend validates the session token

How should you validate such a token? We recommend a straightforward pattern. The widget attaches the current ThingsBoard session token to every request. The backend does not take the token’s claims at face value; instead, it asks ThingsBoard who the token belongs to (GET /api/auth/user), and based on that, resolves its own synchronized user along with their roles. Only then does it check whether that role is authorized to perform the operation and filters data by the user’s customer.

The site operator dashboard relies on the same principle, just without the backend. In the PoC, it served as a demo because the customer hierarchy had not yet been finalized, but the pattern is straightforward. It is a single, read-only dashboard shared among all operators, composed of out-of-the-box widgets that fetch live device data directly from ThingsBoard, bypassing the backend entirely.

Each site is configured in ThingsBoard as a separate sub-customer of the fluid-collection company, and that sub-customer owns its tanks. An alias points to the customer’s tanks, and ThingsBoard resolves it within the scope of the logged-in user, ensuring each operator sees only their own tanks. A single dashboard serves all customers.

Three PE permission settings that cost us time

  • Do not add users to the default “Customer Users” and “Customer Administrators” groups if roles need to see different dashboards. These groups have access to all of the customer’s dashboards. For each customer, we created custom groups instead, such as coordinators and technicians.

  • Pay attention to who owns the dashboard group. A group owned by a customer is only visible within that customer’s scope. Therefore, we keep a dashboard shared across all customers in a group owned by the tenant and share it with the customer user groups that have the appropriate role.

  • Use group roles instead of generic ones. Each user group was assigned an “Entity Group Read-only User” type role for one specific dashboard group. In PE, everything is denied by default, and permissions are cumulative, so a single broad generic role can inadvertently grant access to everything. The operator dashboard also requires read access to the device group, because its out-of-the-box widgets read telemetry directly from ThingsBoard. Dashboard access alone is not enough.

Point operator / Coordinator; WizzDev

Figure 4. One system, two roles, two dashboards. On the left: out-of-the-box widgets with live data from ThingsBoard; on the right: a custom widget with data from the backend. Neither widget checks user roles: the role is determined by the dashboard assigned to the group, while data access is enforced by the backend and ThingsBoard permissions. PoC UI recreation using demo data.

Navigation and inter-widget communication

ThingsBoard provides a full suite of tools for building multi-screen interfaces out of multiple widgets:

  • Widget actions triggered by a header button, clicking a row or cell, a map marker, and elsewhere. An action can, for instance, transition to another dashboard state (“navigate to new dashboard state”), execute custom code (“custom action”), open a modal dialog from an HTML template (“custom action with HTML template”), or trigger a mobile action.

  • Dashboard states and self.ctx.stateController (updateState, getStateParams, navigatePrevState). This is the built-in mechanism for creating a “details” view, where the selected entity is passed in as a state parameter.

  • broadcastService for dispatching events between widgets on the same dashboard without global variables.

We used almost none of this list. Actions operate on the entity context of a datasource: clicking a row knows which device or asset was selected and passes it along. Our widgets displayed backend records (orders, routes, installations), not ThingsBoard entities. Out-of-the-box actions were a poor fit for them and would have required extra integration, such as mapping every order to an entity. We built the detail views, forms, and modal dialogs directly inside the widgets.

One ThingsBoard React widget instead of many small widgets

The coordinator dashboard took the opposite path from “many small widgets talking to each other.” The first version had separate widgets for the order list and the route list. We replaced them with a single ThingsBoard React widget featuring a map, lists, and editing capabilities. Components share state via an internal application store. Instead of bridging widgets with an event bus, we turned them into a single application.

Thingsboard Coordinator; WizzDev

Figure 5. The coordinator dashboard before and after the change: separate widgets were replaced by a single widget containing the entire application. PoC UI recreation using demo data.

However, a single large application inside a widget comes with its own costs, and it is worth knowing them before starting. The React app must be built into a single JavaScript bundle that the widget loads, requiring a dedicated build and deployment process.

Building, deploying, and testing the widget bundle

We recommend uploading the bundle to the ThingsBoard resource library (Resources, JavaScript library) with a version number in its filename, and referencing it from the widget’s Resources tab. This is how ThingsBoard describes deploying UI extensions (the thingsboard-extensions repository).

This step can be automated in CI via the ThingsBoard REST API, along with importing the widget definition, which is best kept in the repository as JSON. On the other hand, we do not recommend uploading files directly to ThingsBoard server directories. They will vanish during an upgrade or when recreating a container, leaving no one sure which version is running in production.

The second aspect is testing. It is best to write the application so that as little of its code as possible is aware that it runs inside ThingsBoard. That way, it can be run and tested outside the dashboard using a mocked self.ctx object. In our case, a simple HTML page loading the widget files with such a mocked context was sufficient. Following a ThingsBoard upgrade, you then only need to verify the thin integration layer with the platform.

When separate widgets are still the better choice

When is it better to stick with separate widgets? When your widget is meant to sit alongside standard ones (a chart, an alarm table) and the user should be able to rearrange them, or when the same elements are needed across multiple dashboards. Or when the data genuinely consists of ThingsBoard entities, because then actions and states work without extra effort. If a single role performs a cohesive task across multiple views, a single widget is simpler.

The only action we actually used was the “Get location” mobile action in the driver’s widget. The widget does not wait for the driver to tap a header button. It triggers the action programmatically from code when browser geolocation is restricted inside the mobile app’s WebView.

Mobile app limitations

This example illustrates the limitations we mentioned in the introduction. The ThingsBoard app renders dashboards inside a WebView, and not everything that works in a desktop browser behaves the same way there. In our project, beyond location services, background execution and refresh control were also limited. Therefore, verify the mobile device features your widget relies on directly within the ThingsBoard app, not in a desktop browser, before you start building.

Dashboard as an application

Turning a ThingsBoard dashboard into an application comes down purely to configuration, yet it impacts how the system is perceived more than many pieces of code. For the technician, we configured:

  • a home dashboard in user settings, with the “Always fullscreen” and “Hide home dashboard toolbar” options enabled,

  • all toolbar items disabled in dashboard settings: dashboard and entity selection, filters, time window, export, and dashboard thumbnail update,

  • a single custom widget spanning the entire dashboard, with its title hidden.

Upon logging in, the technician sees only today’s task list. They cannot navigate to another dashboard because the interface provides no way to do so. (What the technician could open is still governed by permissions; the hidden toolbar simply removes the temptation).

Thingsboard sensor instalation; WizzDev

Figure 6. The technician dashboard: a single full-screen widget without the ThingsBoard toolbar. PoC UI recreation using demo data.

PE also offers white labeling, meaning a custom domain, logo, color scheme, and login page for each customer. We planned it for the next phase and did not implement it in the PoC.

Settings, resources, and appearance

The ThingsBoard widget settings form allows configuring the same widget differently across dashboards. It supports fields of various types (text, number, select, json, fieldset, array, and many others), default values, and conditions that display a field only when another field holds a specific value. The result is passed to self.ctx.settings. In PE 4.1.0, however, we encountered a known issue. Fields defined in a custom widget’s settings form failed to appear under the Appearance tab when editing the widget on a dashboard, leaving self.ctx.settings empty.

Working around the settings form bug in PE 4.1.0

This is documented in issues #13671 (since version 4.0.1) and #13880 (PE 4.1.0). In the PoC, we implemented a quick workaround and put a small JSON configuration directly into the hidden widget title. As a rule, we do not recommend this, although this hack has one strong argument in its favor: the title is a fundamental widget property that will not disappear in a future ThingsBoard version. The downside is that such configuration lacks validation or hints and gets mixed into what is normally used for display purposes.

A cleaner workaround is provided in issue #13880. In the widget editor under the Widget settings tab, manually clear the “Settings form selector” field (and enable “Has basic mode” if needed). ThingsBoard will then render the settings form, and it works as described in the documentation. This is still a workaround, not a fix. Both issues were closed without code changes, so after any ThingsBoard upgrade, it is worth verifying whether the form still appears.

External libraries and CSS that leak beyond the widget

The Resources tab loads external JavaScript and CSS files before the widget’s code runs. For anything larger than a small utility library, it is worth looking into resources of type JavaScript library (Resources, JavaScript library), which the widget can include as an extension. We loaded libraries from our own server rather than a public CDN, manually injecting <script> and <link> tags in onInit and removing them in onDestroy.

Cleanup is more critical than it might seem because all widgets run on a single page. In our case, the mapping library loaded by our widget overwrote the copy ThingsBoard uses internally in its own map widgets. As a result, the standard map stopped working on the next dashboard the user opened. The quick fix is to stash the library’s global variable on widget initialization, restore it upon teardown, and remove the injected tags.

However, this only works reliably when there is a single such widget on the page. The permanent solution is to bundle the library directly into the widget’s build so that it never pollutes the global scope in the first place.

CSS in the CSS tab is scoped strictly to the widget container. Elements appended todocument.body, such as modal dialogs, do not inherit these styles. Widgets that opened modals this way injected their own <style> tag into the page and removed it upon widget teardown. For visual styling, ThingsBoard provides CSS variables (e.g., --tb-primary-500), and for dark mode, the dark class along with a toggle-dark-mode event. We did not support dark mode in the PoC.

What we didn't use

Feature Used in PoC? Why not or when it is useful
Dashboard datasources, onDataUpdated
Only in out-of-the-box widgets on the operator dashboard
Business data and telemetry required by custom widgets lived in the backend
typeParameters beyond defaults
No
Without data sources, there was nothing to configure
subscriptionApi
No
Useful for live telemetry when the device list originates from outside the dashboard
Angular services via servicesMap
No
REST via self.ctx.http was sufficient
Writing attributes from widgets
No
Single source of truth: backend writes them after approval
RPC, controlApi
No
Battery-powered sleeping sensors; nothing to control
Row click, custom actions, HTML template actions
No
Our records were not ThingsBoard entities; built-in actions did not fit them
Dashboard states, stateController
No
Detail views and forms are built inside the widgets
broadcastService
No
A single application widget instead of multiple communicating widgets
Role checking in widget code
No
One dashboard per role, assigned via user groups in PE. Data access is enforced by the backend
Mobile actions
Yes, one: Get location
Invoked programmatically when the WebView blocks geolocation
timewindowFunctions
No
Without datasources, there is no time window to control
onMobileModeChanged, onEditModeChanged
No
Full-screen widgets with their own responsive layout
Dark mode
No
Out of scope for the PoC
White labeling (PE)
No
Planned for the next phase

This table can also serve as a checklist. If your widget’s data consists of ThingsBoard entities, most of the “No”s will turn into “Yes”es, and you will write significantly less code than we did. That was the case in our sensor management platform built on ThingsBoard PE, where loggers, add-on sensors, and users were modeled as ThingsBoard assets and devices, and rule chains handled device registration. If your data lives in your backend, navigation and filtering will have to be built inside the widget, and that is well worth factoring into your estimates.

Check IoT Hub before you start

IoT Hub is ThingsBoard’s built-in catalog of ready-made components that install with a single click: widgets, solution templates (with dashboards and rule chains), devices, and more. Some come from ThingsBoard, others from partners and the community. It is worth spending a few minutes on it before you start, especially when you need “a standard widget, just slightly different.” For the workflows in our project (pickup scheduling, sensor installation), nothing there was a fit, but for a custom chart or map, it can save a week of work.

Summary

When a custom backend runs alongside ThingsBoard, first decide where the single source of truth lies for each piece of data. This single decision dictates the widget type, the refresh mechanism, and how many features of the Widget API you will actually use. In our project, the business logic stayed in the backend, so the custom widgets were of the Static type and fetched data on their own, while standard ThingsBoard mechanisms remained where data truly originates from devices: on historical charts, in alarm tables, and for reading sensor statuses. Enforce data permissions in the backend, because a hidden button is not authorization. And read the “What we didn’t use” table as a checklist for your own project.

This approach works best where devices sit at the center of the process and people across multiple roles work with the same sensor data: in field service logistics, industrial maintenance, or operating distributed equipment in the field. If the interface has little to do with devices or requires complete freedom in UX design, a standalone frontend is often the better choice.

We described the business side of this project, from tank-level alerts through route planning to automatic billing, in our industrial fluid logistics platform case study.

If you are planning a similar system and want to know what belongs inside a widget and what should stay outside, talk to a ThingsBoard architect at WizzDev.

References