This web page describes a repository of Web of Things capability schemas to be used as optional semantic markup in Web Thing Descriptions.
To use a schema from this repository, a Thing Description must define a @context
of "https://webthings.io/schemas", define one or more device capability types as a
top level @type
array and define at least the required properties, actions and
events for those capabilities with an appropriate @type
annotation.
{
"@context": "https://webthings.io/schemas/",
"@type": ["Light", "OnOffSwitch"],
"id": "https://mywebthingserver.com/things/lamp",
"title":"My Lamp",
"description": "A web connected lamp",
"properties": {
"on": {
"@type": "OnOffProperty",
"type": "boolean",
"title": "On/Off",
"description": "Whether the lamp is turned on",
"links": [{"href": "/things/lamp/properties/on"}]
},
"brightness" : {
"@type": "BrightnessProperty",
"type": "integer",
"title": "Brightness",
"description": "The level of light from 0-100",
"minimum" : 0,
"maximum" : 100,
"links": [{"href": "/things/lamp/properties/brightness"}]
}
},
"actions": {
"fade": {
"@type": "FadeAction",
"title": "Fade",
"description": "Fade the lamp to a given level",
"input": {
"type": "object",
"properties": {
"level": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"duration": {
"type": "integer",
"minimum": 0,
"unit": "milliseconds"
}
}
},
"links": [{"href": "/things/lamp/actions/fade"}]
}
},
"events": {
"overheated": {
"title": "Overheated",
"@type": "OverheatedEvent",
"type": "number",
"unit": "degree celsius",
"description": "The lamp has exceeded its safe operating temperature",
"links": [{"href": "/things/lamp/events/overheated"}]
}
},
"links": [
{
"rel": "properties",
"href": "/things/lamp/properties"
},
{
"rel": "actions",
"href": "/things/lamp/actions"
},
{
"rel": "events",
"href": "/things/lamp/events"
},
{
"rel": "alternate",
"href": "wss://mywebthingserver.com/things/lamp"
},
{
"rel": "alternate",
"mediaType": "text/html",
"href": "/things/lamp"
}
]
}
A device which alerts the user with an audio or visual indicator. E.g. A smoke alarm, CO alarm, burglar alarm or alarm clock.
Type | Read-Only | Required |
---|---|---|
AlarmProperty | See note | Yes |
Note: An AlarmProperty
MUST be read-only if the alarm can be neither dismissed nor triggered by the user.
None.
Type | Required |
---|---|
AlarmEvent | Yes |
Capability to monitor air quality. Usually monitors the concentration of harmful gases (such as CO2, CO or VOCs) together with PM2.5, PM10 dust particulates.
Type | Read-Only | Required | Notes |
---|---|---|---|
ConcentrationProperty | Yes | Yes | At least one ConcentrationProperty or DensityProperty should be defined, with a separate property for each sensed gas or particulate class. |
DensityProperty | Yes | Yes | At least one ConcentrationProperty or DensityProperty should be defined, with a separate property for each sensed gas or particulate class. |
None.
None.
A device which can measure the barometric pressure.
Type | Read-Only | Required |
---|---|---|
BarometricPressureProperty | Yes | Yes |
None.
None.
A simple sensor with an active (true) and inactive (false) state.
Type | Read-Only | Required |
---|---|---|
BooleanProperty | Yes | Yes |
None.
None.
A device which can capture images.
Type | Read-Only | Required |
---|---|---|
ImageProperty | Yes | Yes |
None.
None.
The ability to set a color, e.g. for a colored light.
Type | Read-Only | Required |
---|---|---|
ColorModeProperty | See note | No |
ColorProperty | No | No |
ColorTemperatureProperty | No | No |
Note: A device implementing the ColorControl
capability MUST include either a ColorProperty
or a ColorTemperatureProperty
. If both are included, the device MUST also include a ColorModeProperty
.
Note: A ColorModeProperty
may be read-only if the device cannot handle changing the mode directly, in which case it will serve as a status indicator.
None.
None.
A device which detects a color.
Type | Read-Only | Required |
---|---|---|
ColorProperty | Yes | Yes |
None.
None.
A device which detects whether a door or window is open or closed.
Type | Read-Only | Required |
---|---|---|
OpenProperty | Yes | Yes |
None.
None.
Capability to monitor current energy usage.
Type | Read-Only | Required |
---|---|---|
InstantaneousPowerProperty | Yes | Yes |
InstantaneousPowerFactorProperty | Yes | No |
VoltageProperty | Yes | No |
CurrentProperty | Yes | No |
FrequencyProperty | Yes | No |
None.
None.
Capability to monitor the current humidity.
Type | Read-Only | Required |
---|---|---|
HumidityProperty | Yes | Yes |
None.
None.
A device which detects whether a water or gas leak has occurred.
Type | Read-Only | Required |
---|---|---|
LeakProperty | Yes | Yes |
None.
None.
A device which emits light, can be turned on and off and optionally have its brightness, color and color temperature controlled.
Type | Read-Only | Required |
---|---|---|
OnOffProperty | No | Yes |
BrightnessProperty | No | No |
ColorModeProperty | Yes | No |
ColorProperty | No | No |
ColorTemperatureProperty | No | No |
Type | Required |
---|---|
ToggleAction | No |
FadeAction | No |
Type | Required |
---|---|
OverheatedEvent | No |
A device which fastens or secures an opening (e.g. a door or window).
Type | Read-Only | Required |
---|---|---|
LockedProperty | Yes | Yes |
Type | Required |
---|---|
LockAction | No |
UnlockAction | No |
None.
A device which detects moving objects.
Type | Read-Only | Required |
---|---|---|
MotionProperty | Yes | Yes |
None.
None.
A sensor with a range of values.
Type | Read-Only | Required |
---|---|---|
LevelProperty | Yes | Yes |
None.
None.
A fader or dimmer switch with a range of levels.
Type | Read-Only | Required |
---|---|---|
LevelProperty | No | Yes |
OnOffProperty | No | No |
Type | Required |
---|---|
FadeAction | No |
None.
A simple switch which has an on state and an off state.
Type | Read-Only | Required |
---|---|---|
OnOffProperty | No | Yes |
Type | Required |
---|---|
ToggleAction | No |
None.
A momentary switch which can be pushed and returns to an un-pushed state when released.
Type | Read-Only | Required |
---|---|---|
PushedProperty | Yes | No |
None.
Type | Required |
---|---|
PressedEvent | Yes |
DoublePressedEvent | No |
LongPressedEvent | No |
A plug or mains outlet which can control power output and optionally monitor energy usage.
Type | Read-Only | Required |
---|---|---|
OnOffProperty | No | Yes |
LevelProperty | No | No |
InstantaneousPowerProperty | Yes | No |
InstantaneousPowerFactorProperty | Yes | No |
VoltageProperty | Yes | No |
CurrentProperty | Yes | No |
FrequencyProperty | Yes | No |
Type | Required |
---|---|
ToggleAction | No |
FadeAction | No |
None.
A device which detects smoke as part of a fire alarm system.
Type | Read-Only | Required |
---|---|---|
SmokeProperty | Yes | Yes |
None.
None.
A device which can measure temperature.
Type | Read-Only | Required |
---|---|---|
TemperatureProperty | Yes | Yes |
None.
None.
A device which regulates temperature. E.g. For space heating, cooking or refrigeration.
Type | Read-Only | Required |
---|---|---|
TemperatureProperty | Yes | Yes |
TargetTemperatureProperty | No | Yes |
HeatingCoolingProperty | Yes | No |
ThermostatModeProperty | No | No |
Note: A device may have multiple properties of the type TargetTemperatureProperty
, e.g. to provide separate heating and cooling setpoints.
None.
None.
A device which can capture video, and optionally still images.
Type | Read-Only | Required |
---|---|---|
VideoProperty | Yes | Yes |
ImageProperty | Yes | No |
None.
None.
type | boolean |
---|
type | number/integer |
---|---|
unit | hectopascal |
type | boolean |
---|
type | number/integer |
---|---|
minimum | 0 |
maximum | 100 |
unit | percent |
Defines the current color mode of the device.
type | string |
---|---|
enum | ["color", "temperature"] |
type | string (hexadecimal RGB color code, e.g. #FF0000) |
---|
type | integer |
---|---|
unit | kelvin |
A concentration of a gas or other volatile (like dust particulates). Used in air quality sensors.
type | number |
---|---|
minimum | 0 |
unit | ppm |
type | number/integer |
---|---|
unit | ampere |
A density of a gas or other volatile (like dust particulates). Used in air quality sensors.
type | number |
---|---|
minimum | 0 |
unit | micrograms per cubic metre |
type | number/integer |
---|---|
unit | hertz |
Defines the current state of a heating or cooling device. e.g. a thermostat, heater or air conditioner. Must support an "off" state and may support a "heating" state, a "cooling" state, or both.
type | string |
---|---|
enum | ["off", "heating", "cooling"] |
type | number/integer |
---|---|
minimum | 0 |
maximum | 100 |
unit | percent |
type | null/undefined |
---|
Note: The primitive type
of an ImageProperty
is null
or undefined
(omitted), but it must provide a mediaType
in one or more link relations which link to binary representations of the image property resource.
The Power Factor describes the relationship between active and reactive power used by the circuit.
type | number |
---|---|
minimum | -1 |
maximum | 1 |
This is the active or real power measurement (see Wikipedia)
type | number/integer |
---|---|
unit | watt |
A LeakProperty
is like a BooleanProperty
, but
with the added semantics that true
means "leak" and
false
means "no leak".
type | boolean |
---|
type | number/integer |
---|---|
minimum | number/integer |
maximum | number/integer |
unit | (optional) |
Defines the current state of a lock type device which can be locked, unlocked or some intermediate state. Must support a "locked" and "unlocked" state. May optionally support an "unknown" and/or "jammed" state.
type | string |
---|---|
enum | ["locked", "unlocked", "unknown", "jammed"] |
A MotionProperty
is like a BooleanProperty
, but
with the added semantics that true
means "motion" and
false
means "no motion".
type | boolean |
---|
An OnOffProperty
is like a BooleanProperty
, but
with the added semantics that true
means "on" and
false
means "off".
type | boolean |
---|
An OpenProperty
is like a BooleanProperty
, but
with the added semantics that true
means "open" and
false
means "closed".
type | boolean |
---|
A PushedProperty
is like a BooleanProperty
, but
with the added semantics that true
means "pushed" and
false
means "not pushed".
type | boolean |
---|
A SmokeProperty
is like a BooleanProperty
, but
with the added semantics that true
means "smoke detected" and
false
means "no smoke".
type | boolean |
---|
A TargetTemperatureProperty
is like a TemperatureProperty
, but defines a desired temperature rather than a current temperature.
type | number/integer |
---|---|
unit | degree celsius |
type | number/integer |
---|---|
unit | degree celsius |
Defines the current setting of a thermostat type device which can switch on and off a heating device and/or cooling device based on a current and desired temperature. Must support an "off" state and must support one or more of a "heat" state, "cool" state and "auto" state, where "auto" means either "heat" or "cool" depending on target and current temperatures.
type | string |
---|---|
enum | ["off", "heat", "cool", "auto"] |
type | null/undefined |
---|
Note: The primitive type
of a VideoProperty
is null
or undefined
(omitted), but it must provide a mediaType
in one or more link relations which link to binary representations of the video property resource.
type | number/integer |
---|---|
unit | volt |
Fades a multi level switch to a given level over a given duration.
type | object |
---|---|
properties |
|
Transitions a lock type device to a "locked" state.
None.
Toggles a boolean state on and off.
None.
Transitions a lock type device to an "unlocked" state.
None.
Indicates an alarm has been triggered.
Indicates a button has been double-pressed.
Indicates a button has been long-pressed.
Indicates a device has exceeded its safe operating temperature.
type | number/integer |
---|---|
unit | degree celsius |
Indicates a button has been single-pressed.