IoT Best Practice Schema Explained
When starting with our shared plans, to get the most out of the system, we offer a best practice schema that we recommend using to send IoT messages. This allows for the collection of device data, sensor readings, and sensor metadata to deliver a rich, pre-configured IoT experience. In short, the structure is as follows:
Following is a brief explanation of our best practice schema and how to use it.
If not using the best practice schema, data will still be accessible throughout the system. However, some more advanced features won't be accessible.
The root properties of the best practice schema are used for identifying, routing, and sequencing messages.
The DeviceID is required string value and we recommend using the Device Name (or full Device ID) from the devices created in the dashboard. If you would like to use a value other than these two, it is supported, just ensure your DeviceID is unique across all deployed devices.
The DeviceType is optional, though recommended to properly work with historic data. It is best for this to be a short descriptive value (i.e. 'boiler-monitor').
The Version is optional, though recommended to properly work with historic data. We recommend adopting a semantic versioniing strategy, though any string will work.
The Timestamp is required to properly sequence the messages sent from device to cloud. It should be in the ISO 8601 format as shown in the example below.
When working with sensor/gateway setups, there is often a set of information more static to the device. This could be latitudue and longitude information, building information, or anything else that isn't a sensor reading.
The information collected here should be numeric in order to work with downstream processing. If the sensor is not returning numeric values, they should be converted on the client side.
On top of the readings sensors are taking, there can often be additional information to track (power, connectivity) for use in health monitoring and maintenance. These values should be numeric and represent any valid number between 0 and 1 where 1 represents fully functioning and 0 represents not working. As an example, a battery that is fully charged would be set to 1, where as a depleted battery would be set to 0.
Special _ Property
This special property on the SensorMetadata allows sending information relating to a gateway or other non-sensor health information.