The sensor library defines a canonical set of predefined sensor and control capabilities. A sensor capability describes that part of a device that can measure some quantity, and a control capability describes that part of a device that can be modified, changed or in some way remotely controlled.
The library is logically divided into subpackages related to the domain to which that capability best fits, although applications a free to select capabilities from any domain. The name of the capability follows the Fragment naming convention. There are Java representations of each of these capabilities that can be found in the Java packages corresponding to the Fragment names.
Environmental Capabilities
Environmental capabilities include sensors that measure properties of the environment such as temperature, humidity, wind speed, etc.
Temperature Sensor
A temperature sensor reports temperature in degrees Celsius (C).
Inventory representation
In a managed object, a temperature sensor is modelled as a simple empty fragment:
A motion sensor detects motion. Simple motion sensors may just detect if there is, or is not motion based on some predefined threshold, whereas more complicated motion sensors (such as police speed radars) can measure the actual speed of the motion. It is assumed in the model that only the speed towards or away from the sensor is measured. The untis for this sensor type are kilometres per hour (km/h).
Inventory representation
In a managed object, a motion sensor is modelled as a simple empty fragment:
"c8y_MotionSensor" : {}
Measurement
Measurement
Units
Description
motionDetected
none
Boolean value indicating if motion has been detected (non-zero value) or not (zero value).
speed
km/h
Measured speed towards (+ve) or away (-ve) from the sensor.
An acceleration sensor, or accelerometer, is a device that measures acceleration along an axis. This sensor model does not define the direction of that axis. The untis for this sensor type are metres per second per second (m/s2).
Inventory representation
In a managed object, an acceleration sensor is modelled as a simple empty fragment:
"c8y_AccelerationSensor" : {}
Measurement
Measurement
Units
Description
acceleration
m/s2
Measured acceleration along the sensor axis (direction of the sensor axis is not defined in this measurement).
In a managed object, a light sensor is modelled as a simple empty fragment:
"c8y_LightSensor" : {}
Measurement
Light is measured with two main alternative sets of units: radiometry consists of measurements of light power at all wavelengths, while photometry measures light with wavelength weighted with respect to a standardised model of human brightness perception. Photometry is useful, for example, to quantify Illumination (lighting) intended for human use.
A humidity sensor measures the amount of water vapour in the air.
Inventory representation
In a managed object, a humidity sensor is modelled as a simple empty fragment:
"c8y_HumiditySensor" : {}
Measurement
There are three main measurements of humidity: absolute, relative and specific. Absolute humidity is the water content of air. Relative humidity, expressed as a percent, measures the current absolute humidity relative to the maximum for that temperature. Specific humidity is a ratio of the water vapour content of the mixture to the total air content on a mass basis.
A moisture sensor measures the water content of a substance.
Inventory representation
In a managed object, a moisture sensor is modelled as a simple empty fragment:
"c8y_MoistureSensor" : {}
Measurement
There are three main measurements of moisture: absolute, relative and specific. Absolute moisture is the absolute water content of a substance. Relative moisture, expressed as a percent, measures the current absolute moisture relative to the maximum for that temperature. Specific humidity is a ratio of the water vapour content of the mixture to the total substance content on a mass basis.
At the most basic level electricity sensors (aka Electricity Meters, Watt-hour meters) measure energy consumption (usually measured in kWh), however they can measure much more depending upon their complexity, such as “demand”, or instantaneous power (usually measured in W), reactive power, harmonic distortion, etc. Meters can measure for a single phase (typical just for home usage) or for three phases.
Inventory representation - Single Phase Meter
In a managed object, a single phase electricity meter is modelled as a simple empty fragment:
c8y_Position reports the geographical location of an asset in terms of latitude, longitude and altitude. Altitude is given in meters. To report the current location of an asset or a device, “c8y_Position” is added to the managed object representing the asset or device. To trace the position of an asset or a device, “c8y_Position” is sent as part of an event of type “c8y_LocationUpdate”.
Properties “trackingProtocol” and “reportReason” are used by tracker agent and describes tracking context of positioning report: why the report was sent and in which protocol.
Common Capabilities
Relay Control
A relay is a kind of binary state switch which can be in the states “OPEN” or “CLOSED”. Relays can be used for many purposes, for example to connect or disconnect the consumer power supply through a smart energy meter.
Inventory representation
In a managed object, a relay control model includes the state of the control. When the control state changes, the inventory model should be updated to include the new state:
"c8y_Relay" :
{
"relayState" : "OPEN"
}
Operations
Operation
States
Description
state
OPEN, CLOSED
OPEN commands the relay in to the open position, CLOSED commands it to the closed position.
The operation representation is the same as the inventory representation:
"c8y_Relay" :
{
"relayState" : "OPEN"
}
Control an Array of Relays
The c8y_RelayArray operation provides the functionality to control multiple relays.
Inventory representation
In a managed object, an array of relays' control model includes the state of each relay. When the state changes, the inventory model should be replaced with the new state:
c8y_Mobile holds the information about the mobile connection status (e.g. cell information) and the sim card (e.g. ICCID) of the device. Whenever the status changes the fragment in the device should be updated. The assumption for not moving devices is that these values rarely change.
For more frequently changing mobile information (e.g. signal strength) a measurement can be used.