Connecting Smart Devices to EnOS Cloud


This tutorial guides you through simulating a smart device’s direct connection to the EnOS Cloud via the EnOS Application Portal, sending data between the device and EnOS Cloud, and viewing device communication details.

Scenario Description


The connection scenario follows “Scenario 1.1” described in the Device Registration Methods.

About This Task

Let us take the household PV inverter connection as an example. The inverter device triple is burned into the inverter during manufacturing. After you power on and connect the inverter to the network, the inverter is connected to EnOS based on the device triple authentication. The overall connection scenario is shown below. In this task, we use a cloud-based device simulator to mimic real device behavior.


../_images/device_connection_task_description.png


The procedure has the following steps:

  1. Create a device model

  2. Create a product

  3. Register a device

  4. Simulate data transmission using the Device Simulator

  5. Check device connection status

  6. View device data

Prerequisites


Your account must have the Developer role to access the Developer Console. Contact your OU administrator if permissions are required.

Step 1: Creating Device Models

  1. In the EnOS Application Portal > Developer Console, navigate to Model Management > Models. Check if your OU has reusable models under Models Created in This OU or Shared Models matching the specifications below:


Feature Type

Name

Identifier

Data Type

Data Definition

Attribute

Inverter Type

invType

enum

{0:Central,1:String}

Attribute

Component Capacity

capacity

float

kWp

Measurement Point

Active Power

INV.GenActivePW

double

kW


  • If an identical model exists: Use it directly.

  • If a partially matching model exists: Create a new model via Creating a Model.

    • If no reusable model exists: Creating a Model from Scratch with:

      • Group: Custom (custom)

      • Name: Inverter_Demo

      • Business Identifier: Inverter_Demo_0

      • Model Usage: Device Connection

      • Description: Inverter model for demo project


    Note

    Ensure Device Connection is selected under Model Usage. Otherwise, the model cannot be used for Product Creation/Device Registration.


    ../_images/create_model.png
    :width: 800px
    
  1. On the model details page, Creating Model Elements:

    • Attribute 1

      • Type: Attribute

      • Name: Inverter Type

      • Identifier: invType

      • Data Type: enum

      • Enum Type: string

      • Enum Values:

        • Value: 0; Description: Central

        • Value: 1; Description: String

      • Default Value: None

      • Mandatory: Yes

      • Writable: Yes

    • Attribute 2

      • Type: Attribute

      • Name: Component Capacity

      • Identifier: capacity

      • Data Type: float

      • Aggregation Method: sum

      • Unit: kWp

      • Default Value: None

      • Mandatory: Yes

      • Writable: Yes

    • Measurement Point

      • Type: Measurement Point

      • Name: Active Power

      • Identifier: INV.GenActivePW

      • Point Type: AI

      • Data Type: double

      • Aggregation Method: sum

      • Unit: kW

      • Quality Bit: No

      • Writable: Yes


../_images/create_property.png


After completing the model, proceed to create products and register devices.

Step 2: Creating Products

Create a product called Inverter_Product. It is assumed that a device of this product model sends data in JSON format and the data transmission is not encrypted using the CA certificate.

  1. In EnOS Application Portal > Developer Console, select Device Management > Products.

  2. Click New Product, and provide the following settings in the New Product window:

    • Product Name: Inverter_Product

    • Asset Type: Device

    • Device Model: Inverter_Demo

    • Data Format: Only EnOS IoT

    • Certificate-based Authentication: Disabled

    • Product Description: Inverter product for demo

  3. Click OK to complete the operation.


../_images/create_product.png

For details, see Creating a Product.

Step 3: Registering Devices

Create a device named INV001, which belongs to the Inverter_Product product model created in the previous step.

  1. In EnOS Application Portal > Developer Console, select Device Management > Device Assets.

  2. Click New Device, and provide the following settings in the New Device window:

    • Basic Info:

      • Product: Inverter_Product

      • Device Name: INV001

      • Timezone/City: UTC+14:00

    • Attributes:

      • Inverter Type: 0:Central (centralized inverter)

      • Component Capacity: 5.0

  3. Click OK to complete the operation.


After you complete the device registration, click |view| to retrieve the device triplet (ProductKey, DeviceKey, DeviceSecret) from the device details page, which will be used in the following step.


../_images/register_device.png


For more information about devices, see Creating a Device.

Step 4: Simulating Data Transmission


Use the Device Simulator to send active power data to the cloud.

  1. Go to Device Management > Device Simulator.

  2. Click Add Simulated Device, then select device INV001 created in the previous step from the list.

  3. Click OK. The simulated device based on INV001 will appear in the simulated devices list.

  4. Click Define Sample |simulator|, download the template.

  5. Customize data for the measurement point INV.GenActivePW in the file. Example:

timeOfDay

INV.GenActivePW

15:00:00

342.567

15:06:00

876.123

15:12:00

123.456

15:18:00

654.321

15:24:00

987.654

15:30:00

234.567

15:36:00

765.432

15:42:00

456.789

15:48:00

567.89

15:54:00

345.678

Here, timeOfDay represents the timestamp of the current day. The first data point will be sent at 15:00:00 today, with subsequent transmissions every 6 minutes for a total of 10 times. INV.GenActivePW is the measurement point identifier.

6. After uploading the file, click Start Simulation |start| in the simulated devices list. The device will send data according to your configured schedule.


For more details, see Using the Device Simulator.

Step 5: Checking Device Connection Status

In EnOS Application Portal > Developer Console, click Device Management > Device Assets. Check the status of device INV001 in the device list.

During simulation, the device status will show as Online.

../_images/device_status.png

Step 6: View Device Data


  1. In the device list, locate device INV001 and click View icon to access Device Details page.

  2. Click the Measurement Points tab, find the INV.GenActivePW measurement point, then click View Data to access the Data Insights page and view the latest data.

  3. You can also retrieve the latest data via the TSDB Data Service.