In the context of the ThingsBoard IoT platform, “devices” are basic Internet of Things objects that can produce telemetry data and transmit it to the ThingsBoard platform, as well as respond to Remote Procedure Call (RPC) commands.
ThingsBoard offers the capability to manage devices through a web interface and REST API, store data from devices, and facilitate interaction between devices and other components of the platform.
Devices, in this context, can refer to physical or virtual objects connected to a network, such as monitoring sensors, smart devices, machines, sensors, and more. These devices can collect data like temperature, humidity, GPS coordinates and send this data to the ThingsBoard platform.
Devices can be organized into various groups.
The ThingsBoard platform allows you to create dashboards, track and analyze data from devices, and configure rules and automation based on this data.
In short, devices in ThingsBoard are a central part of your IoT system, and the platform provides tools for managing them and utilizing the data they collect.
Adding a new device
- Login to your ThingsBoard instance and navigate to the “Entities” section. Then go to the “Devices” page;
- Click on the “+” icon in the top right corner of the table and then select “Add new device”;
- Enter the device name. For example, “My New Device”. No other changes are required at this time. Click “Add”;
- Device is created. A window will open where you can check the device’s connection to ThingsBoard. This step is optional. Let’s close this window for now and return to checking the connection in the next step in more detail;
- Your first device has been added. As new devices are added, they will be added to the top of the table since the table sorts devices by default using the time of creation.
When adding a new device, you will receive a notification. You can view it by clicking on the “bell” icon in the top right corner.
Learn more about notifications and how to configure them here.
Editing a device
You can change the device name, its device profile, label, assign the firmware and software. To edit the device, you need to:
- Clicking the device row to open its details, then click the "pencil" icon in the upper right corner of the dialog;
- If necessary, change the device name and its profile. Also, you can input label and description, or check the "Is gateway" box. After editing, click the orange check mark to save all applied changes.
Deletion device
You can delete a device using one of the following ways:
First way:
- Click on the “trash can” icon can opposite the device's name you want to delete.
- Confirm deleting the device in the dialog box.
Second way:
- Click on the device that you want to delete. In the device details window, click the "Delete device" button;
- Confirm deleting the device in the dialog box.
Device operations
You can perform various operations with the device, such as make device public, assign device to customer, manage credentials, check connectivity, delete device, copy device id, and copy access token.
Make device public
Make the device public and all its data will be made public. It is necessary when you are creating a public dashboard that needs access to the device’s data.
- Open "Device details" window and click the "Make device public" button;
- Confirm the action in the dialog box;
To make the device private again, follow these steps:
- Open "Device details" window and click the "Make device private" button;
- Confirm the action in the dialog box.
Assign device to customer
You can assign devices to certain customer. This will allow Customer users to fetch device data using REST APIs or Web UI.
- Open "Device details" window and click the "Assign device to customer" button;
- Select the customer to assign the device. Then click "Assign";
- The device is assigned to the selected customer.
Manage device credentials
You can manage device credentials. The current release supports credentials based on Access token, X.509 certificates, and MQTT Basic.
By default, “access token” credentials are used. To change device credentials, follow these steps:
- Open "Device details" window and click the "Manage credentials" button;
- Choose your preferred credential type, generate the necessary data in the fields, and click "Save".
Check connectivity
Check your device’s connection to the ThingsBoard platform:
- Open "Device details" window and click the "Check connectivity" button;
- Select the messaging protocol and your operating system, then copy the command;
- Send telemetry to the ThingsBoard instance on behalf of the device by executing the command via terminal. The device state should be changed from "Inactive" to "Active" and you should see the published "temperature" readings.
Copy device Id
Copy the device Id to the clipboard using the “Copy Device Id” button.
Copy device credentials
Click on the “Copy Access Token” or “Copy MQTT Credentials” button (depending on your choice of device credentials type) to copy the device credentials.
Device details
The “Device details” window provides various tabs that allow you to manage and monitor information such as attributes, latest telemetry, alarms, events, relation configurations, audit logs, and version control of the device.
Device attributes
This tab displays the client, server, and shared attributes of the device. For example, serial number, model, and firmware version. Attributes are static and semi-static key-value pairs associated with devices.
Device telemetry
This tab shows the real-time telemetry data the device sends, such as sensor readings, status, and other measurable variables. Time-series data points are available for storage, querying, and visualization. For example, temperature, humidity, and battery level.
Adding telemetry. You can manually add telemetry using the ThingsBoard UI. To do this, click the “plus” icon in the top right corner of the window. In the new window, enter the key name, select the value type, and enter the value.
Deleting telemetry. To delete telemetry, click the “trash can” icon next to the name of the telemetry key you want to delete. Choose what you want to delete specifically: delete all data, delete all data except latest value, delete latest value, delete all data for time period. Confirm the deletion by clicking the “Apply” button.
Device alarms
This tab shows alarms that identify issues with your devices.
Device events
Here, events related to the device are displayed, including system logs, errors, warnings, and other important moments in the device’s lifecycle.
Device relations
Relations are directed connections to other entities. This tab displays the relationships of this device with other devices, dashboards, assets, and other entities in the ThingsBoard system.
Device audit logs
ThingsBoard provides the ability to track user actions in order to keep an audit log. It is possible to log user actions related to main entities: assets, devices, dashboard, rules, etc.
Version control
ThingsBoard version control service provides the ability to export and restore ThingsBoard Entities using Git.