├── .github
└── ISSUE_TEMPLATE
│ ├── bug-report.md
│ ├── question.md
│ ├── requirement.md
│ └── use-case.md
├── .pr-preview.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── charter
├── README.md
├── index.html
└── w3c.json
├── index.html
├── requirements
├── images
│ ├── cloud_deployment_model.png
│ ├── cloud_deployment_model2.png
│ ├── direct_deployment_model.png
│ ├── gateway_deployment_model.png
│ └── gateway_deployment_model2.png
└── index.html
└── w3c.json
/.github/ISSUE_TEMPLATE/bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug Report
3 | about: Report a bug with the Web Thing Protocol specification
4 | title: 'Bug: '
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: Ask a question about the Web Thing Protocol
4 | title: 'Question: [One line description]'
5 | labels: question
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/requirement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Requirement
3 | about: Propose a technical requirement for the Web Thing Protocol specification
4 | title: 'Requirement: '
5 | labels: requirement
6 | assignees: ''
7 |
8 | ---
9 |
10 | [MUST/SHOULD/MAY]
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/use-case.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Use Case
3 | about: Propose new use cases of the Web Thing Protocol
4 | title: 'Use Case: [One line description]'
5 | labels: use case
6 | assignees: ''
7 |
8 | ---
9 |
10 | As a
35 | To submit feedback, please use GitHub issues.
36 |
51 | The mission of this group is to define a common protocol for communicating with connected devices over the web, to enable ad-hoc interoperability on the Web of Things.
52 | Deliverables of the group may include use cases, requirements and specifications. This includes: Key use cases include: Protocol bindings/sub-protocols for non-web or non-internet protocols.
93 | The group may produce other Community Group Reports within the scope of
94 | this charter but that are not Specifications, for instance use cases,
95 | requirements, or white papers.
96 |
101 | The group MAY produce test suites to support the Specifications. Please
102 | see the GitHub LICENSE file for test suite contribution licensing
103 | information.
104 |
118 | The group operates under the Community and Business
120 | Group Process. Terms in this Charter that conflict with those of the
121 | Community and Business Group Process are void.
122 |
124 | As with other Community Groups, W3C seeks organizational licensing
125 | commitments under the W3C Community
127 | Contributor License Agreement (CLA). When people request to
128 | participate without representing their organization's legal interests,
129 | W3C will in general approve those requests for this group with the
130 | following understanding: W3C will seek and expect an organizational
131 | commitment under the CLA starting with the individual's first request to
132 | make a contribution to a group Deliverable.
133 | The section on Contribution Mechanics describes
134 | how W3C expects to monitor these contribution requests.
135 |
138 | The W3C Code of
139 | Ethics and Professional Conduct applies to participation in
140 | this group.
141 |
147 | The group will not publish Specifications on topics other than those
148 | listed under Specifications above. See
149 | below for how to modify the charter.
150 |
155 | Substantive Contributions to Specifications can only be made by Community
156 | Group Participants who have agreed to the W3C Community
158 | Contributor License Agreement (CLA).
159 |
161 | Specifications created in the Community Group must use the
163 | W3C Software and Document License. All other documents produced by
164 | the group should use that License where possible.
165 |
167 | Community Group participants agree to make all contributions in the
168 | GitHub repo the group is using for the particular document. This may be
169 | in the form of a pull request (preferred), by raising an issue, or by
170 | adding a comment to an existing issue.
171 |
173 | All Github repositories attached to the Community Group must contain a
174 | copy of the CONTRIBUTING
176 | and LICENSE
178 | files.
179 |
184 | The group will conduct all of its technical work in public. If the group
185 | uses GitHub, all technical work will occur in its GitHub repositories
186 | (and not in mailing list discussions). This is to ensure contributions
187 | can be tracked through a software tool.
188 |
190 | Meetings may be restricted to Community Group participants, but a public
191 | summary or minutes must be posted to the group's public mailing list, or
192 | to a GitHub issue if the group uses GitHub.
193 |
198 | This group will seek to make decisions where there is consensus. Groups
199 | are free to decide how to make decisions (e.g. Participants who have
200 | earned Committer status for a history of useful contributions assess
201 | consensus, or the Chair assesses consensus, or where consensus isn't
202 | clear there is a Call for Consensus [CfC] to allow multi-day online
203 | feedback for a proposed course of action). It is expected that
204 | participants can earn Committer status through a history of valuable
205 | contributions as is common in open source projects. After discussion and
206 | due consideration of different opinions, a decision should be publicly
207 | recorded (where GitHub is used as the resolution of an Issue).
208 |
210 | If substantial disagreement remains (e.g. the group is divided) and the
211 | group needs to decide an Issue in order to continue to make progress, the
212 | Committers will choose an alternative that had substantial support (with
213 | a vote of Committers if necessary). Individuals who disagree with the
214 | choice are strongly encouraged to take ownership of their objection by
215 | taking ownership of an alternative fork. This is explicitly allowed (and
216 | preferred to blocking progress) with a goal of letting implementation
217 | experience inform which spec is ultimately chosen by the group to move
218 | ahead with.
219 |
221 | Any decisions reached at any meeting are tentative and should be recorded
222 | in a GitHub Issue for groups that use GitHub and otherwise on the group's
223 | public mail list. Any group participant may object to a decision reached
224 | at an online or in-person meeting within 7 days of publication of the
225 | decision provided that they include clear technical reasons for their
226 | objection. The Chairs will facilitate discussion to try to resolve the
227 | objection according to the decision process.
228 |
230 | It is the Chairs' responsibility to ensure that the decision process is
231 | fair, respects the consensus of the CG, and does not unreasonably favour
232 | or discriminate against any group participant or their employer.
233 |
238 | Participants in this group choose their Chair(s) and can replace their
239 | Chair(s) at any time using whatever means they prefer. However, if 5
240 | participants, no two from the same organisation, call for an election,
241 | the group must use the following process to replace any current Chair(s)
242 | with a new Chair, consulting the Community Development Lead on election
243 | operations (e.g., voting infrastructure and using RFC 2777).
245 |
261 | Participants dissatisfied with the outcome of an election may ask the
262 | Community Development Lead to intervene. The Community Development Lead,
263 | after evaluating the election, may take any action including no action.
264 |
269 | The group can decide to work on a proposed amended charter, editing the
270 | text using the Decision Process described above.
271 | The decision on whether to adopt the amended charter is made by
272 | conducting a 30-day vote on the proposed new charter. The new charter, if
273 | approved, takes effect on either the proposed date in the charter itself,
274 | or 7 days after the result of the election is announced, whichever is
275 | later. A new charter must receive 2/3 of the votes cast in the approval
276 | vote to pass. The group may make simple corrections to the charter such
277 | as deliverable dates by the simpler group decision process rather than
278 | this charter amendment process. The group will use the amendment process
279 | for any substantive changes to the goals, scope, deliverables, decision
280 | process or rules for amending the charter.
281 | This document defines a WebSocket sub-protocol called the Web Thing
36 | Protocol, for monitoring and controlling connected devices over the
37 | World Wide Web. The Web Thing Protocol is intended as a dedicated
38 | real-time protocol for the Web of
39 | Things, to enable a WoT
40 | Consumer
41 | to communicate with one or more WoT
42 | Things
43 | over a WebSocket connection.
44 | This document defines a WebSocket [[WEBSOCKETS-PROTOCOL]] sub-protocol for
60 | monitoring and controlling connected devices over the Web.
61 | The Web of Things (WoT) is a
63 | collection of standardised technology building blocks that help provide
64 | interoperability on the
65 | Internet of
66 | Things (IoT). The WoT Thing Description specification
67 | [[wot-thing-description11]] defines a metadata format for
68 | describing the capabilities of "Things" (connected
69 | devices) on the Web. The WoT Discovery specification [[wot-discovery]]
70 | defines mechanisms for discovering Things on the Web. This
71 | specification complements those building blocks by
72 | defining a dedicated real-time protocol for communicating with Things over the
73 | Web.
74 | WebSockets [[WEBSOCKETS-PROTOCOL]] provide a way to upgrade a
76 | standard HTTP [[HTTP11]] request to a full-duplex, persistent, real-time
77 | communication channel over a single TCP connection. This can be used to
78 | create a versatile and efficient two-way channel with which a WoT
79 | Consumer
80 | can communicate with one or more
81 | Things
82 | [[wot-architecture11]] to carry out the full set of WoT
83 | operations.
84 | However, since a WebSocket is essentially just a raw TCP socket with no
85 | semantics of its own, a sub-protocol needs to be defined in order for a
86 | Consumer and Thing to communicate.
87 | Whilst many other WebSocket
89 | sub-protocols exist, what makes the Web Thing Protocol unique
90 | is that it is specifically designed around the Web of Things
91 | information
92 | model and
93 | set
94 | of operations [[wot-thing-description11]], as well as being
95 | targeted specifically at Web of Things use cases [[wot-usecases]]. It
96 | can therefore be thought of as being native to the Web of Things.
97 |
99 | The sub-protocol defines message payload formats for each of the
100 | well-known
101 |
102 | operation types defined in the WoT
103 |
104 | interaction model [[wot-architecture11]], and other messages needed for
105 | WebSocket communication.
106 |
108 | This specification is intended to complement deliverables of the
109 | WoT Working Group, including WoT
110 | Architecture [[wot-architecture11]], WoT Thing Description
111 | [[wot-thing-description11]], WoT Discovery [[wot-discovery]],
112 | WoT Binding Templates [[wot-binding-templates]] and WoT Profile
113 | [[wot-profile]]. It is intended to implement use cases and requirements
114 | defined in the
115 | Web
117 | Thing Protocol Use Cases & Requirements community report.
118 | Whilst this document is not on a standards track, the Web Thing Protocol
120 | is intended to eventually join a standards track at the W3C or another
121 | standards body such as the IETF.
122 | Fundamental WoT terminology such as Thing or Web Thing, Consumer or WoT
131 | Consumer, WoT Thing Description or Thing Description, Interaction Model,
132 | Interaction Affordance, Property, Action and Event are defined in
133 | the
134 | Terminology
135 | section of the WoT Architecture specification [[wot-architecture11]].
136 | In order to communicate with a Web Thing,
144 | a WoT Consumer [[wot-architecture11]] MUST
145 | locate one or more WebSocket [[WEBSOCKETS-PROTOCOL]] endpoints provided by the Thing for a given set of
146 | Interaction Affordances
147 | [[wot-thing-description11]].
148 | The URL of a WebSocket endpoint to be used for a given interaction MUST be obtained from a Thing
150 | Description
151 | [[wot-architecture11]] by locating a Form inside
152 | the corresponding Interaction Affordance for which:
153 |
32 | Web Thing Protocol Community Group Charter
33 |
34 |
38 |
47 |
48 | Mission
49 |
50 |
55 | Scope
56 |
57 |
59 |
64 |
(or support of the Web of Things Working Group in defining this sub-protocol and ensuring consistency with the WebSocket sub-protocol where appropriate)
66 |
70 |
71 |
72 | Out of Scope
73 |
74 |
76 | Deliverables
77 |
78 |
79 | Specifications
80 |
81 |
82 |
89 |
84 |
88 |
(or reference to an HTTP sub-protocol in the Web of Things (WoT) Thing Description specification.)
90 | Non-Normative Reports
91 |
92 |
98 | Test Suites and Other Software
99 |
100 |
106 | Dependencies or Liaisons
107 |
108 |
109 |
114 |
115 | Community and Business Group Process
116 |
117 |
144 | Work Limited to Charter Scope
145 |
146 |
152 | Contribution Mechanics
153 |
154 |
181 | Transparency
182 |
183 |
195 | Decision Process
196 |
197 |
235 | Chair Selection
236 |
237 |
247 |
260 |
266 | Amendments to this Charter
267 |
268 | Web Thing Protocol
32 | WebSocket Sub-protocol
33 |
34 | Introduction
59 | Terminology
130 | WebSocket Connection
141 | Protocol Handshake
143 |
154 |
163 | base
URL
156 | [[wot-thing-description11]] where applicable, the URI scheme [[RFC3986]] of the value of its href
member
158 | [[wot-thing-description11]] is "ws"
or &"wss"
subprotocol
161 | member has a value of "webthingprotocol"
To open a WebSocket on a Thing, an HTTP GET
request [[RFC9110]] MUST be upgraded to
166 | a WebSocket connection using a standard WebSocket protocol handshake [[WEBSOCKETS-PROTOCOL]],
168 | specifying the "webthingprotocol" sub-protocol.
169 |
171 | GET wss://mythingserver.com/things/robot 172 | Host: mythingserver.com 173 | Origin: https://mythingserver.com 174 | Upgrade: websocket 175 | Connection: Upgrade 176 | Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== 177 | Sec-WebSocket-Protocol: webthingprotocol 178 | Sec-WebSocket-Version: 13 179 |180 |
181 | HTTP/1.1 101 Switching Protocols 182 | Upgrade: websocket 183 | Connection: Upgrade 184 | Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= 185 | Sec-WebSocket-Protocol: webthingprotocol 186 |187 |
188 | Sub-protocol name to be confirmed, see IANA Considerations. 189 |
190 |A WebSocket can be opened from a web page using the JavaScript WebSocket API [[WEBSOCKETS-API]] 191 | which will take care of the handshake detailed above and allow messages to be sent and received. 192 |
193 |194 | const socket = new WebSocket('wss://mywebthingserver/things/robot', 'webthingprotocol'); 195 |196 | 197 | 198 |
A single WebSocket [[WEBSOCKETS-PROTOCOL]] connection from a WoT Consumer MAY be shared between multiple 201 | Interaction 202 | Affordances of a Thing. A single WebSocket connection from a WoT Consumer MAY also be shared 203 | between multiple Things. 204 |
205 |Before opening a new WebSocket connection, a WoT Consumer SHOULD check whether it already has an open 206 | connection to the same WebSocket endpoint URL.
207 |If an existing connection to the same WebSocket endpoint URL exists, then that connection SHOULD be re-used 208 | rather than opening an additional socket.
209 |If an existing connection to the same WebSocket endpoint URL exists but is using a different set of credentials
210 | for its given SecurityScheme
212 | [[wot-thing-description11]] (e.g. a different Bearer Token), then the WoT Consumer MUST NOT re-use the
213 | connection.
All messages MUST be a JSON object [[JSON]].
220 | 221 |Member | 226 |Type | 227 |Assignment | 228 |Description | 229 |
---|---|---|---|
thingID |
234 | string | 235 |Mandatory | 236 |The ID (URI) of the Thing to which the message relates. | 237 |
messageID |
240 | string | 241 |Mandatory | 242 |A unique identifier (UUID) for the current message. | 243 |
messageType |
246 | string | 247 |Mandatory | 248 |A string which denotes the type of message (one of request , response or
249 | notification ).
250 | |
251 |
operation |
254 | string | 255 |Mandatory | 256 |A string which denotes the type of WoT operation
258 | [[wot-thing-description11]] to which the message relates (one of
259 | readproperty , writeproperty , observeproperty ,
260 | unobserveproperty , invokeaction , queryaction ,
261 | cancelaction , subscribeevent , unsubscribeevent ,
262 | readallproperties , writeallproperties , readmultipleproperties ,
263 | writemultipleproperties , observeallproperties ,
264 | unobserveallproperties , subscribeallevents , unsubscribeallevents , or
265 | queryallactions ).
266 | |
correlationID |
269 | string | 270 |Optional | 271 |A unique identifer (UUID) which is shared between messages corresponding to the same operation, e.g. a 272 | request and a response. | 273 |
The top level JSON object MUST contain a thingID
member with the value set to a unique identifier of
278 | the Web Thing to which the message relates.
279 | If the Thing Description of the Web Thing contains an id
member then the value of that
280 | id
member MUST be used as the unique identifier assigned to thingID
.
281 | If the Thing Description of the Web Thing does not contain an id
member then the URL
282 | [[URL]] from which the Thing Description was retrieved MAY be used as the thingID
value
283 | instead. The value of the thingID
member MUST be a valid URI [[URI]] serialised as a string.
284 |
The top level JSON object MUST contain a messageID
member with the value set to a unique identifier
286 | for the current message in UUIDv4 format [[rfc9562]].
The top level JSON object MUST contain a messageType
member, with its value set to one of
288 | request
, response
or notification
.
289 |
Message type | 297 |Direction | 298 |Description | 299 |
---|---|---|
request |
304 | Consumer ➡ Thing | 305 |A message sent from a Consumer to a Thing (e.g. to request a reading of a property, invoke an 306 | action or subscribe to an event) | 307 |
response |
310 | Thing ➡ Consumer | 311 |A message sent from a Thing to a Consumer in response to a request (e.g. to respond with a property 312 | reading, provide the final response to an action or confirm a subscription to an event) | 313 |
notification |
316 | Thing ➡ Consumer | 317 |A message pushed from a Thing to a Consumer (e.g. an event, change in property value, or 318 | change in action state) | 319 |
The top level JSON object MUST contain an operation
member, with its value set to one of the
324 | well-known WoT operation names from
325 | the Thing Description specification [[wot-thing-description11]].
The lifecycle of an operation consists of a series of messages in a sequence (e.g. a request followed by a 327 | response, or a request followed by a response then one or more notifications). Each type of operation follows a 328 | particular sequence of message types, outlined in the table below:
329 | 330 |Operation | 335 |Lifecycle | 336 |
---|---|
readproperty |
341 | request, response | 342 |
writeproperty |
345 | request, response | 346 |
The top level JSON object MAY contain a correlationID
member which provides a unique identifier in
351 | UUIDv4 format [[rfc9562]] which is shared between messages corresponding to the same WoT operation (e.g. a
352 | property read request and response, or an event subscription request and event notification). If a request message
353 | contains a correlatonID
member then any response and notification messages which correspond to the
354 | same operation SHOULD also include a correlationID
member with the same value.
All date and time values MUST use the date-time
format
357 | defined in [[RFC3339]].
358 |
360 | 2025-01-15T12:08:00.42Z
361 |
362 | 363 | In order to reduce ambiguity, RFC 3339 only permits an hour with a value 364 | between 00 and 23 (not 24), and time zones expressed as a numerical 365 | offset relative to UTC. The suffix "Z" when applied to a time denotes a 366 | UTC offset of 00:00. 367 |
368 |readproperty
To request a property reading from a Thing, a Consumer MUST send a message to the Thing 374 | which contains the following members:
375 |Member | 380 |Type | 381 |Assignment | 382 |Description | 383 |
---|---|---|---|
messageType |
388 | string | 389 |"request" | 390 |A string which denotes that this message is a request sent from a Consumer to a Thing. | 391 |
operation |
394 | string | 395 |"readproperty" | 396 |A string which denotes that this message relates to a readproperty operation. |
397 |
name |
400 | string | 401 |Mandatory | 402 |The name of the Property to read, as per its key in the properties member of
403 | the Thing Description.
404 | |
405 |
409 | { 410 | "thingID": "https://mythingserver.com/things/mylamp1", 411 | "messageID": "c370da58-69ae-4e83-bb5a-ac6cfb2fed54", 412 | "messageType": "request", 413 | "operation": "readproperty", 414 | "name": "on", 415 | "correlationID": "5afb752f-8be0-4a3c-8108-1327a6009cbd" 416 | } 417 |418 |
When a Thing receives a message from a Consumer with messageType
set to
419 | request
and operation
set to readproperty
it MUST
420 | attempt to read the value of the Property with the given name
.
421 |
Upon successfully reading the value of the requested Property, the Thing MUST send a message to the
426 | requesting Consumer
containing the following members:
Member | 432 |Type | 433 |Assignment | 434 |Description | 435 |
---|---|---|---|
messageType |
440 | string | 441 |"response" | 442 |A string which denotes that this message is a response sent from a Thing to a Consumer. 443 | | 444 |
operation |
447 | string | 448 |"readproperty" | 449 |A string which denotes that this message relates to a readproperty operation.
450 | |
451 |
name |
454 | string | 455 |Mandatory | 456 |The name of the Property being read, as per its key in the properties member of
457 | the
458 | Thing Description.
459 | |
460 |
value |
463 | any | 464 |Mandatory | 465 |The current value of the Property being read, with a type and structure conforming to the data 466 | schema of the corresponding PropertyAffordance in the Thing Description. | 467 |
timestamp |
470 | string | 471 |Optional | 472 |A timestamp in date-time format [[RFC3339]] set to the time the property reading took place. | 473 |
477 | { 478 | "thingID": "https://mythingserver.com/things/mylamp1", 479 | "messageID": "79057736-3e0e-4dc3-b139-a33051901ee2", 480 | "messageType": "response", 481 | "operation": "readproperty", 482 | "name": "on", 483 | "value": true, 484 | "timestamp": "2024-01-13T23:20:50.52Z", 485 | "correlationID": "5afb752f-8be0-4a3c-8108-1327a6009cbd" 486 | } 487 |488 |
writeproperty
To set the value of a Property of a Thing, a Consumer MUST send a message to the Thing which contains the following members:
497 |Member | 502 |Type | 503 |Assignment | 504 |Description | 505 |
---|---|---|---|
messageType |
510 | string | 511 |"request" | 512 |A string which denotes that this message is a request sent from a Consumer to a Thing. | 513 |
operation |
516 | string | 517 |"writeproperty" | 518 |A string which denotes that this message relates to a writeproperty operation. |
519 |
name |
522 | string | 523 |Mandatory | 524 |The name of the Property whose value should be set, as per its key in the
525 | properties member of the Thing Description.
526 | |
527 |
value |
530 | any | 531 |Mandatory | 532 |The desired new value of the Property, with a type and structure conforming to the data schema 533 | of the corresponding PropertyAffordance in the Thing Description. | 534 |
538 | { 539 | "thingID": "https://mythingserver.com/things/mylamp1", 540 | "messageID": "97d22676-6d45-4435-aef5-dd87467a0c44", 541 | "messageType": "response", 542 | "operation": "writeproperty", 543 | "name": "on", 544 | "value": true, 545 | "correlationID": "f6cf46a8-9c96-437e-8b53-925b7679a990" 546 | } 547 |548 |
When a Thing receives a message from a Consumer with messageType
set to
553 | request
and operation
set to writeproperty
it MUST
554 | attempt to set the Property with the name provided in the name
member to
555 | the value provided in the value
member.
556 |
Upon successfully submitting the value of the requested Property, the Thing MUST send a message to the
558 | requesting Consumer
containing the following members:
Member | 564 |Type | 565 |Assignment | 566 |Description | 567 |
---|---|---|---|
messageType |
572 | string | 573 |"response" | 574 |A string which denotes that this message is a response sent from a Thing to a Consumer. 575 | | 576 |
operation |
579 | string | 580 |"writeproperty" | 581 |A string which denotes that this message relates to a writeproperty operation.
582 | |
583 |
name |
586 | string | 587 |Mandatory | 588 |The name of the Property being written, as per its key in the properties member of
589 | the
590 | Thing Description.
591 | |
592 |
value |
595 | any | 596 |Optional | 597 |The value which has been successfully assigned to the Property being written, with a type and 598 | structure conforming to the data schema of the corresponding PropertyAffordance in the Thing 599 | Description. 600 | | 601 |
timestamp |
604 | string | 605 |Optional | 606 |A timestamp in date-time format [[RFC3339]] set to the time the property write took place. | 607 |
611 | { 612 | "thingID": "https://mythingserver.com/things/mylamp1", 613 | "messageID": "db25fe4f-bee8-43a7-8ff0-3a1ff6e620b0", 614 | "messageType": "response", 615 | "operation": "writeproperty", 616 | "name": "on", 617 | "value": true, 618 | "timestamp": "2024-01-13T23:20:50.52Z", 619 | "correlationID": "f6cf46a8-9c96-437e-8b53-925b7679a990" 620 | } 621 |622 |
If the Thing can confirm that the requested value has been set successfully then the response message
623 | to a writeproperty
request SHOULD contain a value
member with its value set to the
624 | value which has been successfully set.
625 |
If the Thing can not confirm that the requested value has been set successfully (e.g. in the case of a
627 | write-only property or a device that is temporarily asleep so the write has been queued) then
628 | the response message to a writeproperty
request MUST NOT contain a
629 | value
member.
630 |
If a Consumer attempts to set the value of a numerical Property to a value which conforms to the 632 | Property's data schema but to a level of precision the Thing does not support, (e.g. 3.14159), then the 633 | Thing MAY respond with the actual value set (e.g. 3.14). 634 |
635 | 636 |This specification proposes the registration of a sub-protocol in the IANA "WebSocket Subprotocol Name Registry". 660 | The name of the sub-protocol and the published URL of its definition are to be confirmed, but currently the name 661 | "webthingprotocol" and this document are used as a placeholder and draft proposal.
662 |This document outlines the use cases and requirements for a common sub-protocol for the Web of Things to enable ad-hoc interoperability between Web Things and their Consumers. This includes requirements for an HTTP sub-protocol and a WebSocket sub-protocol which define a standard way to monitor and control a connected device over the World Wide Web.
34 |The goal of the Web of Things (WoT) is to counter the fragmentation of the Internet of Things (IoT) using web technologies. By providing standardised metadata and other re-usable technological building blocks, W3C WoT enables easy integration across IoT platforms and application domains.
41 |The W3C WoT Thing Description [[wot-thing-description]] specification defines the first building block of the Web of Things, by defining an information model and JSON-based representation format for describing the capabilities of connected devices and the interfaces with which to communicate with them.
42 |The Thing Description specification is designed to be protocol-agnostic and flexible enough to describe a wide range of existing ("brownfield") IoT devices, rather than specifying a fixed protocol or application programming interface (API) which all devices must implement. The downside of this open ended flexibility is that it makes ad-hoc interoperability on the Web of Things very difficult, because it's nearly impossible to create a single WoT Consumer which is guaranteed to be able to communicate with any Web Thing [[wot-architecture]] out of the box.
43 |The Web Thing Protocol specification will be designed to complement the WoT Thing Description specification [[wot-thing-description]] by defining a common sub-protocol for the Web of Things such that any WoT Consumer and Web Thing which implement the specification will be guaranteed to be able to communicate with each other other out of the box, without device-specific customisation.
44 |The Web Thing Protocol specification (or specifications) will define:
45 |This document outlines the use cases and requirements for such a specification, based on existing Web of Things implementations and the collective experience of members of the Web Thing Protocol Community Group.
50 |In addition to the WoT Thing Description, the Web Thing Protocol Community Group should aim for the Web Thing Protocol specification to complement other deliverables in progress by the WoT Working Group where possible, including WoT Discovery [[wot-discovery]], WoT Binding Templates [[wot-binding-templates]] and WoT Profile [[wot-profile]]. It's possible some of the requirements below may be fulfilled by those specifications. The Web Thing Protocol specification itself, or subsections of it, are intended to eventually join a standards track at the W3C or another standards body such as the IETF.
51 |Below are a selection of use cases of the Web Thing Protocol from a range of different application domains.
57 |A larger set of use cases for the Web of Things in general can also be found in Web of Things (WoT): Use Cases and Requirements [[wot-usecases]].
58 |As the manufacturer of a smart home device I want to know that any compliant smart home software application will be able to communicate with my device without device-specific customisation, so that I can maximise the size of the market for my product.
63 |As a retailer of smart home devices I want to be able to tell my customers that a device will work with their existing smart home app, hub or cloud service so that I can sell more devices.
64 |As a customer looking to buy a smart home device, I want to be sure that the device is compatible with my existing smart home app, hub or cloud service.
65 |As the manufacturer of a smart home hub I want my hub to be compatible with as many devices as possible in order to maximise the size of the market for my product.
69 |As the manufacturer of a smart home hub, I want to bridge a wide range of different smart home protocols to a single standardised interface so that they can be consumed by a single client software application.
70 |As the user of a smart home hub, I want my hub to be compatible with as many devices as possible so that I'm not locked in to a single hardware vendor and can easily integrate devices from different vendors together in order to automate my home.
71 |As the developer of a smart home cloud service I want to be able to monitor and control a wide range of smart home devices from different vendors in order to maximise the size of the market for my service.
75 |As a smart home user I want to have a choice of third party services to help monitor and automate my home so that I am not locked into a single service provider and can find the best value service for my needs.
76 |As the developer of an IoT software library, I want my library to work with a wide range of different IoT devices without needing per-device customisation so that I can maximise the audience for my software.
80 |As the developer of a smart home mobile app I want to offer my users out-of-the-box interoperability with a wide range of smart home devices so that I can maximise the audience for my app.
81 |As a user of a smart home mobile app I want to know that I will be able to monitor and control any conformant smart home device so that I don't need a different app per device or device-specific customisations.
82 |As the manufacturer of a smart building device I want to know that any compliant building management system will be able to communicate with my device without device-specific customisation, so that I can maximise the size of the market for my product.
89 |As a facilities manager of a commercial building, I want to know that a given IoT device will seamlessly integrate with my existing building management system without device-specific customisation.
90 |As the manufacturer of a smart building hub for commercial buildings, I want my hub to be compatible with as many devices as possible in order to maximise the size of the market for my product.
94 |As the manufacturer of a smart building hub for commercial buildings, I want to bridge a wide range of different building management systems to a single standardised interface that my smart building software can consume.
95 |As a facilities manager of a commercial building I want to consolidate my multi-vendor building management system into a single standardised interface that I can use for command, control, automation and analytics for my building.
96 |As the developer of a cloud service which provides digital twins of commercial buildings, I want to be able to consume data from a wide range of devices and building management systems in order to maximise the size of the market for my service.
100 |As a facilities manager of a commercial building, I want to have a choice of third party services which can provide analytics for the data from my building management system so that I am not locked into a single service provider and can find the best value service for my needs.
101 |As the developer of an IoT software library, I want my library to work with a wide range of different IoT devices without needing per-device customisation so that I can maximise the audience for my software.
105 |As a facilities manager of a commercial building I want to monitor and control the HVAC, lighting, safety and security systems of my building all through a single desktop or tablet application, so that I don't have to piece together information from multiple separate systems in order to get a full picture of the operations of my building.
106 |As a technician working on a smart city project for a public body, I want to be able to consolidate data from a wide range of different public and private sources into a standardised format in order to create a real time digital twin of a whole city to be used for city planning.
111 |As a factory worker I want to be able to consume data from all of the devices on my factory floor in a single standardised format so that I can build a digital twin of the factory in order to model how it's running and identify optimisations.
115 |As a technician at a renewable energy company, I want to create digital twins of a range of different assets in order to monitor the performance and efficiency of my energy network in real time and carry out predictive maintenance.
119 |As an operations manager at a bus company, I want to monitor the location and condition of a range of different assets over the internet in order to monitor the efficiency of my bus network and carry out predictive maintenance.
123 |As a farmer I want to integrate a range of different sensors (e.g. temperature, light, soil moisture) and actuators (e.g. sprinklers and window openers) from different vendors in order to automate a greenhouse on my farm and maximise crop yields.
127 |The Web Thing Protocol will need to operate within three key deployment models depending on whether a Web Thing is hosted by a connected device, by an on-premises Web of Things gateway, or an off-premises Web of Things cloud service.
132 |These three deployment models are common across a range of different application domains.
133 |For a broader discussion of deployment models for the Web of Things in general, see Common Deployment Patterns in Web of Things (WoT) Architecture 1.1 [[wot-architecture11]].
134 |The direct deployment model is when a Consumer communicates directly with an IoT device using the Web Thing Protocol.
137 |In this deployment model, the IoT device itself must act as an HTTP server which serves its own Thing Description and can respond to HTTP requests or maintain a WebSocket connection with a Consumer.
142 |The gateway deployment model is when a Consumer communicates with a connected device via a gateway on the same premises as the device, which bridges another protocol to the Web Thing Protocol.
146 |In this deployment model, a gateway acts as an HTTP server which exposes a Web Thing for a connected device and translates HTTP and/or WebSocket messages into messages of the device's native protocol (e.g. Zigbee, Z-Wave, HomeKit, Modbus or BACnet) over a local area network (LAN) or personal area network (PAN).
151 |A gateway can also act as a Consumer which consumes Web Things using the direct deployment model, and can be used to proxy a Web Thing from one network to another.
152 |The cloud deployment model is when a Consumer communicates with an IoT device via cloud service on the internet, which communicates with the device using some other protocol on the back end.
160 |In this deployment model, a cloud service hosted in a data centre acts as an HTTP server which exposes a Web Thing for an IoT device and translates HTTP and/or WebSocket messages into messages using another IoT protocol (e.g. AMQP or MQTT).
166 |The cloud deployment model differs from the gateway deployment model in that the Web Thing is hosted on different premises to the IoT device it represents and communicates with the device over the internet.
167 |A cloud service can also act as a Consumer which consumes Web Things that use the direct or gateway deployment model, and can be used to proxy a Web Thing from one origin to another.
168 |The HTTP Sub-protocol may be defined by the W3C WoT Profile specification [[wot-profile]].
179 |The HTTP sub-protocol SHOULD define the [[HTTP11]] requests and responses a WoT Consumer and Web Thing would use in order to carry out the set of operations described below, including methods, headers, payloads and expected response codes. Resources SHOULD be retrieved using the HTTP protocol [[HTTP11]] and serialised in JSON [[JSON]].
180 |The WebSocket sub-protocol SHOULD define the WebSocket [[websockets-protocol]] messages that a WoT Consumer and Web Thing would use to carry out the following set of operations, including the messages types, payloads, error conditions and how they should be used. Messages SHOULD be serialised in JSON [[JSON]].
232 |The following requirements are considered out of scope for the Web Thing Protocol specification:
334 |