Blues
The integration guide with Blues
Last updated
The integration guide with Blues
Last updated
Blues is a hardware manufacturer that specializes in IoT connectivity solutions, offering efficient, secure, and low-power data communication. Their tools enable developers to integrate cellular IoT functionality into devices with minimal coding and setup, streamlining global data transmission.
Blynk offers built-in integration with Blues, enabling seamless data visualization, downlink scheduling, lifecycle status monitoring, and simplified device provisioning, along with other advanced features.
To begin, configure the Blues integration by connecting your Notehub project to your Blynk organization. Open Notehub, create a new project or select an existing one. Navigate to Settings in the left menu bar, then go to Programmatic API Access and select Generate Programmatic Access. Save the generated credentials and click Save.
Next, open the Blynk Console, go to Developer Zone -> Integrations -> Blues, and enter the Client ID and Client Secret generated from Notehub. Click the Connect button, and the integration status should update to "Connected".
Finally, create the Blynk Route in your Notehub project:
Open your Notehub project and navigate to Routes -> + Create Route -> Blynk.
Fill in the Blynk region and click Save.
You can find the Blynk region at the bottom right of the Blynk Console:
Now that the integration is configured, you can create a device template. Each template is mapped to a Notehub ProductUID to group common devices.
Ensure that your datastream name matches the keys your device sends to Notehub. By default, Blynk will attempt to map all keys from all Notefiles to their corresponding datastreams.
Each time Blynk receives an update from the device, it will trigger the Online lifecycle event. Therefore, it is recommended to config a meaningful wait time to prevent your device from being stuck in the offline state.
For downlinks, Blynk will send a blynk.qi
Notefile with the datastream name as the key. Below is an example of the Notefile body that Blynk will create:
Once you have completed the template configuration, save it and navigate to Developer Zone -> Integrations -> Blues. In the Data Mapping section, locate the Blues ProductUID you will use and select the created template in the Blynk Template column. Click Add.
At this point, the Blues Device metafield will be created in the template if it wasn't created before. Blynk uses this metadata to identify each device in the Notehub.
Optionally, if you already have devices connected to your project, you can click the import icon in the Actions column to import those devices from Notehub.
At this point, your integration should be working. However, importing devices from Notehub might not always be necessary, and you may prefer to create devices directly within Blynk.
To provision a device using Blynk, create it manually and configure the Blues Device ID metafield:
In the Blynk Console, navigate to Devices -> + New Device -> From Template.
Select the template and give the device a meaningful name.
After creating the device, open the Info & Metadata page and enter the Blues Device ID in the Blues Device field.
Once you save the value, Blynk will automatically create the device in your Notehub project.
To simplify device provisioning for end-users, you can use Static Tokens:
Create a CSV file with Blues Device IDs listed in each row. For example:
Navigate to Developer Zone -> Static Tokens -> + Generate Static Tokens -> Create From File. Select the template and upload the file.
Map the row with Blues Device IDs to the Blues Device metafield and click Create.
You will receive a separate QR code for each row in your CSV file. Users can scan these QR codes using the Blynk Mobile app or Blynk Console. Once scanned, the device will be automatically created in both your Blynk organization and Notehub project.