Smart Citizen: Device blueprints

Description

The Smart Citizen API supports other devices to publish data to the platform by previously agreeing with the Smart Citizen terms and conditions.

For each device type that we intend to add, we would need to create a device blueprint. A device blueprint defines the sensors and the metrics that your devices will have. This will include the hardware details of your sensors and the kind of data that will be published to the platform. Custom calibration formulas to be applied to the data when processed in the platform can be also added.

Once a device blueprint is added to the platform, any user can create as many devices as he likes and publish data to them following the standard Smart Citizen API. It is important to note that Device Blueprint currently cannot be created by users and should be requested by contacting support@smartcitizen.me.

The minimal Device Blueprint includes all the necessary data that a user might provide in order to create a Kit (http://developer.smartcitizen.me/#kits). It is composed of Components (http://developer.smartcitizen.me/#components) and those can reuse existing Sensors (http://developer.smartcitizen.me/#sensors) and Measurements (http://developer.smartcitizen.me/#measurements) definitions. Sensors define the hardware or software component that records the data. Measurements are descriptions of what sensors are recording.
Blueprints can be shared across many devices or can be tailored per device in order to provide dedicated calibration formulas per individual sensor. This is achieved with the Components binding.

The following example shows a basic Device Blueprint in JSON. This is the minimum of information that a blueprint needs:

EXAMPLE

{
“name”: “The Frog”,
“description”: “Custom Arduino Humidity Sensor”,
“slug”: “ms:0,5”,
“components”: [{
“map”: “hum”,
“equation”: “(125.0 / 65536.0 * x) + 7”,
“sensor”: {
“name”: “HPP828E031”,
“description”: “Humidity”,
“unit”: “%”,
“measurement”: {
“name”: “relative humidity”,
“description”: “Relative humidity is a measure...”
}
}
}]
}

The following examples expand the previous Device Blueprint with the complete data model:

EXAMPLE

{
“id”: 10,
“uuid”: “056e452d-41c4-436d-a640-2157a278037d”,
“slug”: “ms:0,5”,
“name”: “The Frog”,
“description”: “Custom Arduino Humidity Sensor”,
“created_at”: “2016-06-18T16:25:02Z”,
“updated_at”: “2016-06-18T16:25:02Z”,
“components”: [{
“id”: 35,
“uuid”: “22da9377-5151-4547-a71b-6fd8958e1330”,
“equation”: “(125.0 / 65536.0 * x) + 7”,
“map”: “hum”,
“sensor”: {
“id”: 13,
“uuid”: “1c19ae8f-b995-460f-87a3-a9d0c140abfb”,
“parent_id”: 19,
“name”: “HPP828E031”,
“description”: “Humidity”,
“unit”: “%”,
“created_at”: “2015-02-02T18:24:30Z”,
“updated_at”: “2015-07-05T19:54:54Z”,
“measurement”: {
“id”: 2,
“uuid”: “9cbbd396-5bd3-44be-adc0-7ffba778072d”,
“name”: “relative humidity”,
“description”: “Relative humidity is a measure of the amount of moisture in the air relative to the total amount of moisture the air can hold. For instance, if the relative humidity was 50%, then the air is only half saturated with moisture.”
}
}
}]
}

Labs
External Links
Contributors

Discuss this Project on discuss.fablabs.io