Web of Things Japanese Community Group
website·Indexed 29 days ago
https://wot-jp-cg.netlify.app/Documentation and resources from the WoT-JP CG focused on the W3C Web of Things (WoT) standard. It provides guides on Thing Descriptions, interaction patterns (Property, Action, Event), and practical examples for integrating devices like Philips Hue, SwitchBot, and Raspberry Pi using Node-RED and the Node Generator for Node-RED.
What's inside WoT-JP CG
- The Web of Things Japanese Community Group (WoT-JP CG), established in January 2021, focuses on promoting the awareness and utilization of Web of Things (WoT) standard technologies, supporting standardization efforts, assisting in the creation of new businesses using WoT, and fostering a sustainable community primarily communicating in Japanese.
Overview of W3C Web of Things (WoT) Standard
The W3C Web of Things (WoT) is a standard designed to achieve interoperability between different IoT platforms using Web technologies. Instead of defining a new platform to implement, WoT enables interconnection by describing existing IoT platforms using machine-readable documents called 'Thing Descriptions'. Its primary goal is to standardize the description of 'things' at the Web level to ensure interoperability across IoT platforms and application domains.Overview of Node Generator for Node-RED
Node Generator is a helper tool for Node-RED that allows developers to convert a Web of Things (WoT) Thing Description into Node-RED nodes. These generated nodes enable a Node-RED flow to interact with a WoT Thing (performing properties, actions, or events) by receiving messages and sending the results of those interactions to subsequent nodes in the flow.Overview of Web of Things (WoT) Specification Components
The Web of Things (WoT) framework consists of eight primary specifications divided into Normative and Informative deliverables. The foundation is built upon the WoT Architecture and Thing Description, supplemented by Discovery and Profile specifications.Overview of WoT Thing Description components
A WoT Thing Description (TD) is a JSON-LD based model that acts as the entry point for a physical or virtual device. It consists of four primary components:
- Interaction Affordances: Definitions of how to interact with the Thing (Properties, Actions, and Events).
- Metadata: Textual information about the Thing.
- Schemas: Machine-understandable definitions of the data exchanged.
- Web Links: Formal or informal relationships to other Things or documents on the web.
Understand Web of Things (WoT) and Thing Descriptions
Web of Things (WoT) is a standardization of how 'Things' are described at the Web level to enable interoperability across different IoT platforms and applications. The central component is the Thing Description (TD), a protocol-independent meta-framework (similar to an index.html for a website) that describes what a thing is and how to access it.Reference the WoT Normative Specifications
The normative specifications define the core standards for the Web of Things. These include:
- Web of Things (WoT) Architecture: Describes the overall architecture of IoT systems using WoT.
- Web of Things (WoT) Thing Description (TD): Explains how to write TD documents to describe IoT devices.
- Web of Things (WoT) Discovery: Defines methods for discovering the URLs of Thing Descriptions using existing mechanisms and directory APIs.
- Web of Things (WoT) Profile: Defines constraints (profiles) to clarify the functional scope that Things and Consumers must support.
Prerequisites for Sensirion SHT3x sensor integration
To use the Sensirion SHT3x series temperature and humidity sensor with Node-RED, the following hardware and software are required:
Hardware:
- Raspberry Pi 3 or later
- Sensirion SHT3x series sensor
- Jumper wires and breadboard
Software:
- Node-RED v2.0 or later
node-red-contrib-sht31node module (for SHT3x control)node-red-nodegen(Node Generator)
Generate and install Node-RED nodes from a Thing Description
To create Node-RED nodes from a WoT Thing Description (TD), follow these steps:
- Generate the node source: Run the
node-red-nodegencommand pointing to your TD JSON-LD file. Ensure the hostnames in the TD are updated to the correct IP address or hostname of your Thing. - Install the generated node: Navigate to the Node-RED user directory (typically
~/.node-red) and install the generated package using npm. - Restart: Restart Node-RED to load the new nodes.
# Step 1: Generate source files node-red-nodegen /path/to/thing/description.jsonld # Step 2: Install into Node-RED user directory cd ~/.node-red npm install /path/to/node-red-contrib-wotmyfirstledlamp- Generate the node source: Run the
Describe Properties in a Thing Description
Properties are defined within thepropertiesobject. Each property includes metadata (title, type) and aformsarray that specifies how to interact with the property via a URI (href), the supported operations (opsuch asreadpropertyorwriteproperty), and thecontentType."properties": { "led": { "title": "LED status", "titles": { "en": "LED status", "ja": "LEDの状態" }, "type": "object", "properties": { "value": { "type":"number" } }, "forms": [ { "href": "http://example.com:1880/led", "op": [ "readproperty", "writeproperty" ], "contentType": "application/json" } ] } }Install the BMP280 Node-RED module
Install thenode-red-contrib-bme280module via the Node-RED palette manager to enable control of the BMP280 sensor.# Search for node-red-contrib-bme280 in the Palette Manager and installConsume a WoT Thing
Consuming a Thing means reading its Thing Description to understand how to interact with it. This can be done programmatically or via tools:
- Node-RED: Use the Node-RED Node Generator to automatically create nodes in Node-RED based on a Thing Description, allowing for graphical orchestration of IoT solutions.
- TypeScript: Use
node-wotto interact with Things as TypeScript objects.