- Introduction
- Create device on ThingsBoard
- Connect device to ThingsBoard
- Check data on ThingsBoard
- Conclusion
Introduction
Wireless open / close sensor detects and logs in its memory events of door opening and closing.
If a change of state is detected, the device immediately sends the notification to cloud.
The device uses magnetic sensor to detect open / close event.
Efento NB-IoT sensors transmit the data over cellular network (Narrowband IoT) and do not require any additional devices (router, gateway, etc.).
Sensors are also equipped with Bluetooth Low Energy interface, which allows quick and easy configuration with a smartphone.
Efento NB-IoT sensors can be integrated with any cloud platform.
- Sensor detects open / close events
- Batteries ensure up to 10 years of maintenance free operation
- NB-IoT sensors send the data over the cellular network to Efento Cloud or any other cloud platform.
- Sensor’s configuration can be changed remotely from the cloud or with a mobile application over Bluetooth Low Energy
- The device stores 40,000 measurements in its memory, when the memory is full, the oldest measurements are overwritten
Prerequisites
To continue with this guide we will need the following:
Create device on ThingsBoard
Create device profile
Before you add an Efento sensor to the platform you need to create a new Device profile for Efento device.
-
Log in to your administrator account and navigate to “Device profiles” page. Click on the “+” icon in the top right corner of the table and then select “Create new device profile” from drop-down menu;
-
Fill up the profile name (mandatory) and configure optional settings (Rule chain, Queue Name, Description). Once you are ready press “Next: Transport configuration” button;
-
From the dropdown menu in the “Transport type” field select “CoAP”, and from the dropdown menu in “CoAP device type” field select “Efento NB-IoT”, click “Add” button to confirm adding new device profile;
-
Once the profile is ready you will see it on the list in the “Device profiles” section. If you plan to use your ThingsBoard instance only with Efento sensors you can set the profile as default.
Configuration of the “Alarm rules” and “Device provisioning” tabs is optional.
If you want to learn more about these features please refer to the documentation.
Create a device
In order to save a data from the sensor we should also create a device on ThingsBoard.
-
Go to the “Devices” page of the “Entities” section. Click on the “+” icon in the top right corner of the table and then select “Add new device” from drop-down menu;
-
Enter the device name. In the “Device profile” field specify the profile you have recently created for Efento sensors. Then, click “Next: Credentials” button;
-
Leave the credential type as “Access token”. Set the new access token, which will be used by a sensor to validate in the ThingsBoard platform. Note that the token must be unique for each sensor. Configuration of the token is optional. Click “Add” button to confirm adding new device;
-
A window will open where you can check the device's connection to ThingsBoard. This step is optional. Close this window;
-
Once added, the device appears in the device list.
Connect device to ThingsBoard
The whole configuration of Efento sensors is done with a free mobile application for Android.
Application can be downloaded from Google Play.
Before you start configuration make sure the sensor is able to register in the NB-IoT network and the APN settings are right.
Detailed user manual of Efento NB-IoT sensors and Efento mobile application can be found in the support section of Efento website.
-
Once you download and install the application select “Nearby sensors” mode and unlock the power user mode: open the application menu and quickly tap Efento logo five times.
-
Make sure the APN you use allow the device to connect to the server on which your ThingsBoard instance is running. You can check the network status in the Efento mobile application. Connect to the sensor -> click on the menu (three dots in the upper right corner)
-
Click on Cellular network status. Mare sure that the field “Registration status” value is either “REGISTERED” or “REGISTERED_ROAMING”
-
Set the sensor to send the data to the server on which ThingsBoard instance is running. Connect to the sensor -> click on the menu (three dots in the upper right corner).
-
Click on Power user -> Server configuration. Select “Other” and fill in the address of the server (coap.eu.thingsboard.cloud). Default port used for CoAP communication is 5683. Set authentication mode to “custom token” and key in the token you created for the device on ThingsBoard platform.
Set the CoAP endpoints, to which the sensor will send the data. Click on the menu (three dots in the upper right corner) -> Power user -> CoAP endpoints. Set the endpoints to the following values:
- Data: “efento/m”
- Time: “efento/t”
- Configuration: “efento/c”
- Device Info: “efento/i”
Check data on ThingsBoard
Trigger the transmission in order to check if the device sends the data to your ThingsBoard instance.
Click on the menu (three dots in the upper right corner -> Trigger transmission.
If everything is set correctly, you should see the data in ThingsBoard. To do this click on the device and the most recent data from the device will be visible in the “Latest telemetry” tab.
-
Click on the device and the most recent data from the device will be visible in the “Latest telemetry” tab.
Conclusion
With the knowledge outlined in this guide, you can easily connect your Wireless open/close logger and send data to ThingsBoard.
Explore the platform documentation to learn more about key concepts and features. For example, configure alarm rules or dashboards.