This repository hosts a Docker-based Internet of Things Simulator — a platform to explore and interact with both local and remote IoT devices. Its primary goal is to help users understand the W3C Web of Things standard through hands-on experimentation.
The Web of Things standard promotes interoperability, standardization of data formats, and secure communication between devices by defining abstract descriptions of Things. This application allows users to define multiple devices via configuration files, interact with them, and observe communication flows.
The system consists of three components:
- Frontend: User interface for uploading files and viewing logs.
- Backend: Central coordinator for logging, device lifecycle, and API routing.
- Docker Playground: Simulated WoT devices launched as containers.
Interaction flow:
- Users upload configuration and playbook files via the frontend.
- Backend initializes containers based on configuration.
- Frontend displays interactive representations of devices (Things).
- Users trigger actions or property updates via the Thing API.
- Logs and outputs are centrally collected for transparency.
Run everything with one command using Docker.
- Docker (≥ 20.2.0, tested as root)
- Docker Compose
- Git
git clone https://git.tu-berlin.de/f2499r/web-of-things-playground.git
cd web-of-things-playground
docker-compose upIn order to install the playground clone the repository.
git clone https://github.com/OliverStoll/web-of-things-playground.git
Change the directory
cd web-of-things-playground
Run the application via docker compose
docker-compose up
The Docker Images will be initialized automatically and afterwards the the application will be available under the following url:
http://localhost:5173/
This section explains how to use the Playground to simulate Web of Things (WoT) scenarios. Sample files are included for each feature.
A configuration file must define:
devices: A list of local Things with required fields:title,description,properties,actions, andevents.externalDevices: (optional) A list of URLs pointing to remote Things' descriptions.
{
"devices": [
{
"title": "Thing title",
"description": "This is a Thing",
"properties": {
...
},
"actions": {
...
},
"events": {
...
}
}
],
"externalDevices": [
"http://plugfest.thingweb.io:8083/smart-coffee-machine"
]
}
For further examples: See examples/scenario.json.
Upload via drag-and-drop or by selecting the file. After processing, local Things are shown as created, remote ones as added. The interface marks remote Things accordingly.
- Click on a Thing to view its
properties,actions, andevents. - Property values load automatically.
- To update: click the field, enter a new value, and press Enter.
- Logs will reflect the changes and display all triggered requests.
For reduced log verbosity, use a playbook (see below).
Two types are supported:
- Without parameters: Click the action directly.
- With URI parameters: Edit the pre-filled string (e.g.,
makeDrink?drinkId=espresso&size=s&quantity=3) and press Enter.
Actions with parameters in the body are not supported.
Things can interact with each other using the remote icon at the top-right of each Thing.
- Open the interaction menu.
- Select a target Thing.
- Trigger properties or actions like usual.
- Choose an event in the interaction menu.
- The Thing subscribes and waits.
- Trigger the corresponding event from the emitting Thing (via action call).
Playbooks automate multi-step interactions.
A playbook must contain:
steps: an array of action/property steps withdeviceId,type, andvalue.- Optional: a
sleepstep to add a delay (in seconds).
Here is an example based on the examples/scenario.json Configuration file:
{
"steps": [
{
"deviceId": "Coffee-machine",
"type": "property",
"value": "temperature"
},
{
"deviceId": "Coffee-machine",
"type": "action",
"value": "brew_coffee"
},
{
"deviceId": "Smart Fridge",
"type": "action",
"value": "make_request?method=GET&url=http://localhost:3000/coffee-machine/properties/temperature"
},
{
"sleep": 5
}
]
}
Further example available in examples/playbook_scenario.json.
Upload a playbook using the file upload interface. Steps will be executed sequentially. You may upload another playbook after completion.
Click the Download button at the top-right of the log window to save logs as a .txt file.
Click Shutdown to terminate all simulated Things. This stops and removes the containers. You can then upload a new configuration or exit Docker Compose.
Controller API docs are accessible at:
http://localhost:5001/api-docs
To run the frontend and backend locally (without Docker Compose):
Backend:
cd backend
npm install
npx nodemon
Frontend:
cd frontend
npm install
npm run dev
Refer to the individual README files in each folder for more.
