In the context of the Web of Things (WoT), a Binding Template is a blueprint that gives guidance on how to implement a specific IoT protocol, data format or IoT platform. The Core Binding Templates specification explains the overall mechanism and requirements for any binding to follow. This document gives implementation guidelines regarding BACnet [[BACnet]], a building automation and control networking protocol.
More specifically, this document defines a set of vocabulary terms that can be used inside a Thing Description document, and associated rules which allow to describe WoT operations using BACnet over the network. Additionally, relevant examples are provided to showcase different vocabulary terms and the associated behavior.
This document is a work in progress
BACnet® is a registered trademark of ASHRAE. This document has not been reviewed for publication by ASHRAE, and no endorsement by ASHRAE is implied.
BACnet [[BACnet]] is a building automation and control networking protocol for applications such as heating, ventilating, and air conditioning control, lighting control, access control, and fire detection systems.
This document describes how the Web of Things Thing Description [[WOT-THING-DESCRIPTION]] (TD) can be used to represent devices that use BACnet. In particular, the document explain how to create valid TD Forms for the different operations that BACnet can perform.
Forms of a Thing Description instance with BACnet Binding complies with this specification if it follows the normative statements in and .
A JSON Schema [[?JSON-SCHEMA]] to validate Thing Description instances containing BACnet Binding is provided in the GitHub repository.
It is assumed the reader of this document is familiar with the basic principles and mechanisms of the BACnet standard [[BACnet]].
The following subset of BACnet features is supported by this binding:
This protocol binding is intended to be used to enable web applications to interact with data and control affordances exposed by BACnet devices. It is not intended that this binding be used for device commissioning, onboarding, or device management.
WoT Interaction Affordances are mapped to BACnet Properties. If the BACnet property-identifier is not present in the URI element of the form, the object-identifier is used to interact with the BACnet Object, exposing the present-value Property.
When it is necessary to expose properties other than the present-value property, the property-identifier must be included in the URI element of the form.
Selected BACnet Service parameters are exposed as URI Variables to enable WoT consumers access to BACnet features, for example Command Priority.
In cases where a URI is needed to refer to data that is accessible using BACnet services, the 'bacnet' URI scheme provides a means to identify a property of an object in the scope of a BACnet device. The 'bacnet' URI scheme does not provide means to identify the BACnet network on which a device resides, or the network access method, physical media, or protocol service to use.
The 'bacnet' URI Scheme used herein is defined in Annex Q.8 of the BACnet Specification [[BACnet]].
The syntax for the 'bacnet' URI scheme is specified below in Augmented Backus-Naur Form (ABNF) [[RFC5234]]:
bacnet-URI = scheme ":" scheme-specific-part scheme = "bacnet" scheme-specific-part = "//" device-identifier "/" object-identifier [ "/" property-identifier [ "/" property-array-index ] ] device-identifier = number / ".this" object-identifier = object-type "," object-instance object-type = number / identifier object-instance = number property-identifier = number / identifier property-array-index = number number = "0" / non-zero-digit *decimal-digit non-zero-digit = %x31-39 ; "1" to "9" decimal-digit = %x30-39 ; "0" to "9" identifier = lowercase *alphanumeric *( "-" 1*alphanumeric ) alphanumeric = uppercase / lowercase / decimal-digit uppercase = %x41-5A ; "A" to "Z" lowercase = %x61-7A ; "a" to "z"
device-identifier
Component
The device
component specifies the device
instance number in decimal. A device
identifier
of .this
means "this device" so that it can be
used in static files that do not need to be changed when the
device identifier changes.
device-identifier = number / ".this"
A Protocol Binding conforming to this specification SHALL use number type for device-identifier.
object-identifier
Component
The object-identifier
component consist of two
sub-components: the object-type and the object-instance
number. The object-type is either a decimal number in the
range 0 to 210-1 (inclusive) or exactly equal to
the identifier text of one of the named items of the
BACnetObjectType enumeration defined in Clause 21 of
[[BACnet]]. The object-instance number is a decimal number
in the range 0 to 222-1 (inclusive).
object-identifier = object-type "," object-instance object-type = number / identifier object-instance = number
A Protocol Binding conforming to this specification SHALL use number type for object-type.
property-identifier
Component
The property-identifier
component is either a decimal
number or exactly equal to the identifier text of one of the
named items of the BACnetPropertyIdentifier enumeration
defined in Clause 21 of [[BACnet]]. If it is omitted, it
defaults to present-value
except for BACnet
File objects, where the absence of the property
component refers to the entire content of the file accessed
with Stream Access.
property-identifier = number / identifier
A Protocol Binding conforming to this specification SHALL use number type for property-identifier.
property-array-index
Component
The components of an array property may be individually
accessed (read or written) using an "array index".
The index
component is a decimal number.
property-array-index = number
An index of 0 (zero) identifies the count of the number of data elements. If the array index is omitted, it means that all the elements of the array are to be accessed. An array index N, greater than zero, identifies the Nth element in the sequence.
A decimal number consists of one or more decimal digits. The first digit is not permitted to be zero unless the number consists of a single digit.
number = "0" / non-zero-digit *decimal-digit non-zero-digit = %x31-39 ; "1" to "9" decimal-digit = %x30-39 ; "0" to "9"
An identifier conforms to the definition of an identifier in ASN.1 notation (Clause 12.3 of [[X.680]]). It begins with a lowercase letter and is followed by zero or more letters, digits, and hyphens. A hyphen is not permitted to be the last character, nor is it to be followed by another hyphen. The case of letters in an identifier is significant.
identifier = lowercase *alphanumeric *( "-" 1*alphanumeric ) alphanumeric = uppercase / lowercase / decimal-digit uppercase = %x41-5A ; "A" to "Z" lowercase = %x61-7A ; "a" to "z"
This section describes the vocabulary used in BACnet. A protocol binding implementation should use the vocabulary defined in this section to describe the different configurations that can be used to exchange data between Web of Things clients, devices, and services.
This vocabulary is fully defined in the BACnet ontology published with this document.
Until the JSON-LD context is published, this document will use the example URI "https://example.org/bacnet"
for the context with the prefix "bacv"
.
Vocabulary term | Description | Range | Domain |
---|---|---|---|
bacv:CommandPriority |
Sets CmdPrio for Writes |
IntegerSchema with "minimum":0 and possibly with a default value.
|
td:forms |
bacv:covIncrement |
Sets minimum change for reporting |
NumberSchema with
"minimum":0 and possibly with a default value.
|
td:forms |
bacv:usesService |
Indicates the BACnet service to use |
string
(one of |
td:forms |
bacv:isISO8601 |
This data uses ISO8601 format |
boolean
|
bacv:Sequence |
bacv:hasBinaryRepresentation |
Points to the binary representation of the resource |
string
(one of |
bacv:OctetString |
bacv:hasMember |
Member of a Sequence or List | bacv:DataType | bacv:Sequence, bacv:List |
bacv:hasNamedMember |
Named Member of a Sequence or Choice | bacv:NamedMember | bacv:Sequence, bacv:Choice |
bacv:hasFieldName |
Name of a Named Member of a Sequence or Choice |
string
|
bacv:NamedMember |
bacv:hasContextTags |
Context Tage for a Sequence or Choice |
boolean
|
bacv:Sequence, bacv:Choice |
bacv:hasMapEntry |
An value map entry mapping an Enumerated value to text | bacv:ValueMapEntry | bacv:ValueMap |
bacv:hasLogicalVal |
Logical Value for a ValueMap | integer or string or boolean |
bacv:ValueMapEntry |
bacv:hasProtocolVal |
Protocol Value for a ValueMap | integer |
bacv:ValueMapEntry |
bacv:hasValueMap |
Value map for an Enumeration | bacv:ValueMap | bacv:Boolean, bacv:Enumerated, bacv:Unsigned, bacv:BitString |
bacv:CommandPriority
and bacv:covIncrement
have Data Schema values.
This means that their values MAY be set by the application to communicate the parameters to the BACnet driver, using a consistent value according to the schema constraints.
If their schema contains a default
term, the application MAY not set a value and the driver SHOULD
use the value of default
.
This section describes the strategies and default values to use protocol specific concepts within the WoT Interaction model.
Operation | Default Binding | Variables and parameters |
---|---|---|
readproperty |
"bacv:service": "ReadProperty" |
|
writeproperty |
"bacv:service": "WriteProperty" |
CommandPriority |
observeproperty |
"bacv:service": "SubscribeCOVproperty" |
covIncrement |
unobserveproperty |
"bacv:service": "SubscribeCOVproperty" |
|
observeproperty |
"bacv:service": "SubscribeCOV" |
Note: BACnet driver must handle Status Flags |
unobserveproperty |
"bacv:service": "SubscribeCOV" |
BACnet Type | WoT Data Schema |
---|---|
bacv:SequenceOf |
{ "type":"array" } |
bacv:Sequence |
{ "type":"array" } |
bacv:List |
"type":"array" |
bacv:Choice |
{ "type":"array" } |
bacv:Date |
{ "type":"string" } |
bacv:Time |
{ "type":"string" } |
bacv:WeekNDay |
{ "type":"string" } |
bacv:Unsigned |
{ "type":"integer", "minimum": 0 } |
bacv:Signed |
{ "type":"integer" } |
bacv:Real |
{ "type":"number" } |
bacv:Double |
{ "type":"number" } |
bacv:Boolean |
{ "type":"boolean" } |
bacv:Enumerated |
{ "type":"array", "items": { "type": "integer", "minimum": 0 }} |
bacv:String |
{ "type":"string" } |
bacv:OctetString |
{ "type":"array" } |
bacv:BitString |
{ "type":"array", "uniqueItems": true } |
bacv:Any |
{ "anyOf": [
{ "type":"array" },
{ "type":"number" },
{ "type":"string" },
{ "type":boolean" },
{ "type": null }
]}
|
bacv:Null |
{ "type": null } |
bacv:ObjectIdentifier |
{ "type": null } |
This section will present a set of examples about how the terms defined in this document can be used to describe and configure a Form.
[[[#example-readproperty]]] shows the property with object type
analog-input
, object instance 1
, and
property identifier present-value
in the scope of a
BACnet device with device instance number 5
.
{ "@context": ["https://www.w3.org/2022/wot/td/v1.1", { "bacv": "https://example.org/bacnet" }], ... "properties": { "analog1": { "type": "number", "readOnly": true, "forms": [{ "op": [ "readproperty" ], "href": "bacnet://5/0,1/85", "bacv:service": "ReadProperty" }] } } }
{ "@context": ["https://www.w3.org/2022/wot/td/v1.1", { "bacv": "https://example.org/bacnet" }], ... "properties": { "analog1": { "type": "number", "readOnly": true, "forms": [{ "op": "observeproperty", "href": "bacnet://5/0,1/85", "bacv:service": "subscribeCOVproperty", "bacv:covIncrement":{ "type": "number", "minimum": 0 } }] } } }
{ "@context": ["https://www.w3.org/2022/wot/td/v1.1", { "bacv": "https://example.org/bacnet" }], ... "properties": { "analog1": { "type": "number", "readOnly": true, "forms": [{ "op": "observeproperty", "href": "bacnet://5/0,1/85", "bacv:service": "subscribeCOVproperty", "bacv:covIncrement":{ "type": "number", "minimum": 0, "default":0.2 } }] } } }