Veea Bluetooth manager allows you to manage and interact with your Bluetooth sensors remotely. You can retrieve critical data from your Bluetooth sensors, and scan and connect to devices near your VeeaHub. This article also explains how to attach templates to the connected devices and subscribe to them for data. Users can create their own JSON templates for new Bluetooth devices and then upload them to Veea Bluetooth Manager. This initiates a real-time data stream from the device, enabling users to see the data on the main Bluetooth Manager screen.
Bluetooth sensors and templates
To retrieve data from a Bluetooth sensor it must be associated with a template that contains a list of services, for which data has to be retrieved from the sensor. A template also enables you to customize the type of data retrieved, as well as thresholds. You can edit or create templates according to your specific needs and configure the settings using a JSON File.
To manage Bluetooth sensors, click the Bluetooth link on the IoT Device Manager main screen. The following page is displayed:
On this page, there are two sections: Subscribed Sensors and Available Sensors. If you haven't subscribed to any sensors, the Subscribed Sensors section will be empty as in the above image.
Click the Scan button at top right to find sensors. If a new sensor is found, it is added to the Available Sensors section. This lists the name of each Bluetooth sensor, its MAC Address, and any Bluetooth template that has been assigned to it.
-
The Connect button is In front of an unconnected sensor. Click it to connect that sensor to the VeeaHub, and the Connect button is replaced with two new buttons: Remove and Pick Template.
-
Click the Remove button and the following pop-up appears. If you click on the Ok button, the sensor will disconnect from the VeeaHub and be removed entirely. If you wish to reconnect to it, scan for the devices again by clicking on the Scan button:
Click on the Pick Template button and the following pop-up appears:
-
The Select Template pop-up contains a list of all the Bluetooth templates that are currently available. Choose the template you want to attach to the selected sensor and then click on Submit to finish the process.
If you don't find the right template in the list, then you can create one by clicking on the Create Template button in the top right corner. It will redirect you to the New Template page. You can learn how to create a new template here.
You can also view a template by clicking on the View button and the View Template pop-up appears:
-
To make changes to the template, click on the Edit button and it will redirect you to the Edit Template page.
-
The template selected from the Select Template pop-up will be listed in the Template column, in the following image:
The template for a sensor can be changed by clicking on the template name, which makes the Change Template pop-up appear. You can select a template for your sensor from this pop-up. Also, if you don’t want any template assigned to your sensor, you can select the Unassign option from the list and click on Submit.
Once you have selected a template for a sensor, the Pick Template button will be replaced by Subscribe. When you click on the Subscribe button, the sensor will be relocated to the Subscribed Sensors section, as shown below:
-
In the Subscribed Sensors section, you will see the data for the sensor under the sensor name.
-
The data from the sensors will be refreshed on the UI every three seconds by default, but you can change this refresh rate using the Refresh dropdown in the top right corner.
-
You will also see two buttons in front of the subscribed sensor’s name: Unsubscribe and Remove.
-
Click on Unsubscribe to stop the data stream from the sensor and relocate the sensor back to the Available Sensors section.
-
Click on Remove to make the following pop-up appear. If you click on the Ok button, then not only will it unsubscribe the sensor but also remove it completely from the VeeaHub and the Available Sensors section.
-
There is also an Unsubscribe All button at the top of Subscribed Sensors section, which will unsubscribe all the sensors in the Subscribed Sensors section.
Working with Bluetooth Templates
Bluetooth Templates contain a list of services for which data has to be retrieved from the sensors. These templates allow users to customize what type of data is retrieved. You can create new templates and configure the settings using a JSON File.
Viewing/Editing the Templates
-
Clicking on the Templates button in the left-hand side menu will redirect you to the following page:
Here, you will find all the Bluetooth templates listed in a table. If this is the first time you’re using the Bluetooth Device Manager, then only two in-built templates will be present, SensorTag and Thingy. Each template has multiple services inside it (the exact number depends on the type of device that template has been created for) and each service has multiple characteristics inside it as well (the exact number depends on the type of device that template has been created for).
Click on a template in the list to see the View Template page:
-
On this page, you will find Template Name and Template JSON inside a code box.
-
Click the Download button to download the JSON file.
-
To edit a template, click on the Edit button and you will be redirected to the Edit Template page.
-
Give your template a name.
-
Add the JSON file to this new template. To do that, you can either write a new JSON file in the JSON box or you can upload a JSON file using the Upload JSON button.
-
If you are creating a new template for Thingy or SensorTag sensors, download the JSON and upload it to your new template. Once you upload it, the JSON code will be populated inside the code box automatically.
-
If you are creating a template for a sensor other than Thingy or SensorTag:
-
Make sure you are adding a BLE type Bluetooth sensor with a GATT profile.
-
Use the specification document from the manufacturer to create a JSON file. Then upload it to IoT Device Manager. The code box is automatically populated and you can configure any changes.
-
Click on the Save button to create the Bluetooth template. You will be redirected to the Templates page with the newly created template listed in the table. This template can then be assigned to sensors from the Bluetooth page.