Monitor regional crop soil conditions
This tutorial shows how to create a device map dashboard using the space feature of IoT App Development to monitor and display real-time soil condition data for crops in different regions.
Prerequisites
You have created a project named project_space. For more information, see Projects.Step 1: Create soil sensor devices
- In the project list, find the project_space project and click its card.
- On the project details page, choose Products from the left-side navigation pane. Click Create Product, configure the parameters, then click Confirm.In this example, name the product Soil Sensor and select Custom Category. Use the default values for the other parameters.
For more information about the parameters, see the Parameter Description Table.
- In the product list, click View in the Actions column for the Soil Sensor product. Click Feature Definition to customize the TSL model properties for the product as shown in the following table.
Property Identifier Type Range Unit Access mode Soil Temperature soilTemperature double (double-precision floating-point) -10 to 100 °C Read/Write Soil Volumetric Water Content soilVolumetricWater double (double-precision floating-point) 0 to 100 % Read/Write GeoLocation GeoLocation struct A JSON object with the following parameters: - Longitude
- Latitude
The data type is double, and the value range is -180 to 180.
° Read/Write - On the product details page, click Manage next to Number of Devices. On the Devices page, click Add Device to add three soil sensor devices.Set the DeviceName (alias) values to soil_sensor_01 (Soil Sensor 1), soil_sensor_02 (Soil Sensor 2), and soil_sensor_03 (Soil Sensor 3). For more information, see Devices.
- In this tutorial, use the device simulator to report property data. Set three different GeoLocation values for the devices. You can use a tool like the Amap coordinate picker to get longitude and latitude values. You can customize the other property values. For more information, see Device Simulator.
Step 2: Add spaces
On the project details page, choose Spaces from the left-side navigation pane. Add three spaces corresponding to the geographic locations of the three soil sensors: Test Plot 1, Test Plot 2, and Test Plot 3. For more information, see Add Space.
Step 3: Configure the device map
- Create a Web application, for example, Device Map Dashboard. For more information, see Create Web Application.
In the Web application editor, click the component icon
on the left.-
Above the component list on the left side of the canvas, enter device map in the search box. Find the component and drag it to the center of the canvas.
For more information about adding components, see Add a component.
-
In the Style pane on the right side of the web application editor, click Edit Device Map.
- In the Device Map Editor, on the Device Data tab, click Select Product to import the three soil sensor devices into the device map component.
- Click the settings icon
to the right of the Soil Sensor product to configure the bubble to display device property values.In the Bubble Property Display section, click Configure Properties and add the Soil Temperature and Soil Volumetric Water Content properties.
Step 4: Add geographic spaces for devices
- Return to the Device Map Editor. From the function menu on the far right, click Geospaces. Add the Test Plot 1, Test Plot 2, and Test Plot 3 spaces that you created. Then, customize the style for each geographic space as shown in the figure. For more information, see (Optional) Configure Geospaces.Enable the Show on Map toggle. You can customize the Fill Color, Fill Opacity, Line Color, and Line Type for each space.
- Click Save, return to the Web application editor, and refresh the device map component.
- In the upper-right corner of the page, click Preview to see how the devices are displayed.As shown in the figure, the colors on the map let you quickly observe and analyze soil conditions for crops in different regions.
Click a space to display its geographic information, and click a device bubble to view real-time soil data for that region.
The real-time soil data includes metrics like Soil Temperature and Soil Volumetric Water Content. The displayed geographic information includes the space name, such as Test Plot 2. - Click Publish to deploy the application to the cloud.