Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 3.07 KB

Readme.md

File metadata and controls

47 lines (30 loc) · 3.07 KB

Web of Things Quick Start Tutorial

This is a hands-on tutorial to teach simple Web of Things concepts. It involves interacting with different WoT Things over the Internet via different protocols.

Resources and Prerequisites

  • package.json with dependencies: This will install the dependencies needed. Please use npm install to install the dependencies.
  • index.js with boilerplate: You should fill this with your own code.

You can clone this repository or download only this folder via this service.

Prerequisites

Task

You want to automate a small part of your home. The room setup can be seen in the illustration below. Quickstart Setup

Each morning, when you wake up and go towards the kitchen area, you want the coffee to be brewed automatically. Your task is to write a script that brews the coffee of your choice when you pass in front the presence sensor in the kitchen if it is earlier than 13:00 but later than 5:00.

We have three WoT Things that are hosted by the Eclipse Thingweb project. Their TDs are linked below:

You can interact with them over the Internet and send requests. You should read their Thing Description to understand how to interact with them. The Node.js based library, node-wot, simplifies this process and will be installed as a dependency. It is the reference implementation of the WoT Scripting API, which has an example code here.

Alternatively, you can send requests manually. You can refer to the WoT Binding Templates that explains how to read forms in a TD as a human.

Solution

A solution is available in this folder. You can build other solutions and expand on them for other scenarios.

Self-hosting the Things

If you want, you can also self-host the Things used in this tutorial. They are available in the Eclipse Thingweb project at https://github.com/eclipse-thingweb/node-wot/tree/master/examples/quickstart.