Parsing keys act as identifiers in datapoint configuration.
Consider the Shelly H&T smart sensor, which monitors a room's temperature and humidity. The sensor sends data in JSON format as below:
In the Zoho IOT application, you'll use the parsing key `temp_C` to configure a datapoint called Temperature. Similarly, to create a datapoint for humidity, you'll use the parsing key `humid`.
In this scenario, given a JSON payload of `"temp_C": 37` and `"humid": 21`, the sensor reports a room temperature of 37°C and a humidity level of 21%. These values are then stored under their respective datapoints in the Zoho IOT application.
Configuring a Parsing Key
While configuring a parsing key, users have three options: Direct Parsing, Find Value (), and Edge Key Parsing. The selection of the parsing method depends on the nature/structure from the device.
Direct Parsing Key
This option is used for straightforward JSON messages consisting of a simple key-value pair.
Example: For the JSON message from a room temperature monitoring device, Direct Parsing is used.
The key room_temperature is specified to create a datapoint named Temperature to capture the value from the message.
Edge Key
It is used when a single gateway device relays information about multiple resources as objects in the JSON message.
Note: Edge Key parsing is available only in Assets and Locations.
Example: For the JSON message with data on multiple diesel generators in a building, the Edge Key method is used.
To acquire the engine temperature value for the Temperature datapoint, the Edge Key option is selected and the engine_temperature key is provided.
DieselGen1, DieselGen2, and DieselGen3 are the Edge keys of the respective diesel generators; the same must be provided in the Edge Key field of each asset/location.
Learn more about how edge keys are used. findValue()
This option is suitable for more intricate JSON messages where data is nested and includes objects with detailed information.
Example: For a comprehensive JSON message from a CNC milling machine, findValue() is used.
To acquire the speed value for the Spindle Speed datapoint of CNC Machine 1 the following values are provided.
Object Name: CNC_Machine_1
Unique identification Key name
Unique Identification Value: spindle_speed
Required Value's Key: value