MCPSERV.CLUB
WebThings Gateway

WebThings Gateway

Self-Hosted

Self‑hosted smart home hub for privacy and control

Active(88)
2.6kstars
0views
Updated 4 days ago
WebThings Gateway screenshot 1
1 / 5

Overview

Discover what makes WebThings Gateway powerful

WebThings Gateway is a self‑hosted, browser‑based hub that aggregates heterogeneous IoT devices into a single Web of Things (WoT) compliant interface. It exposes each device as a **Thing** that implements the WoT *Thing Description* JSON schema, allowing developers to interact with sensors, actuators, and services through standard HTTP/JSON APIs. The application is designed for privacy‑first deployments; all traffic can be confined to a local network or routed through HTTPS, and the gateway itself is open source under the MPL‑2.0 license.

Smart Home Hubs

Industrial Edge Monitoring

Custom Automation Platforms

Educational Labs

Overview

WebThings Gateway is a self‑hosted, browser‑based hub that aggregates heterogeneous IoT devices into a single Web of Things (WoT) compliant interface. It exposes each device as a Thing that implements the WoT Thing Description JSON schema, allowing developers to interact with sensors, actuators, and services through standard HTTP/JSON APIs. The application is designed for privacy‑first deployments; all traffic can be confined to a local network or routed through HTTPS, and the gateway itself is open source under the MPL‑2.0 license.

Technical Stack & Architecture

The core of WebThings Gateway is written in JavaScript (Node.js), leveraging the Node‑WebKit environment to provide a lightweight runtime on ARM and x86 platforms. The server layer is built with the Express framework, while the front‑end uses a modular React‑based UI that consumes the gateway’s REST endpoints. Device discovery and communication are handled by a set of addon adapters written in Python (via the gateway_addon package) or JavaScript, which expose device protocols such as Zigbee, Z-Wave, MQTT, and Bluetooth. The gateway stores configuration and state in a LevelDB key‑value store bundled with the Node runtime, ensuring zero‑config persistence across restarts.

Core Capabilities & APIs

Developers can programmatically create, update, and delete Things through the /api/things endpoint. Each Thing publishes a Thing Description that includes its properties, actions, and events, enabling automatic UI generation or integration with external WoT clients. The gateway also offers a rules engine that lets users define event‑driven automations via a drag‑and‑drop interface; the underlying implementation exposes a WebSocket channel for real‑time event propagation. Additionally, the gateway’s logging subsystem records property changes to a time‑series store that can be queried via HTTP or exposed as an MQTT topic.

Deployment & Infrastructure

WebThings Gateway is optimized for single‑board computers such as Raspberry Pi, but it also runs on any Linux distribution with Node.js support. Deployment options include:

  • Pre‑built SD card images for ARM devices
  • Docker images (both amd64 and armhf) on Docker Hub
  • Snap packages for Ubuntu Core
  • Manual source builds from the GitHub repository

Because the gateway is stateless beyond its local LevelDB, it scales horizontally by running multiple instances behind a reverse proxy with sticky sessions or by using container orchestration (Docker Compose, Kubernetes) for high‑availability setups. The lightweight nature of the runtime keeps memory footprints under 200 MiB on a Pi, making it suitable for edge deployments.

Integration & Extensibility

Extending the gateway is straightforward: developers write addons that implement the WoT adapter API. Addons can be distributed via npm or Python’s pip, and they register themselves with the gateway at startup. The addon system supports webhooks for external services, allowing developers to trigger actions in SaaS platforms or custom microservices. The gateway also offers a RESTful API for third‑party applications to read sensor data, control actuators, or manipulate the rules engine programmatically. Custom UI components can be injected into the React front‑end by publishing them as separate npm packages, enabling bespoke dashboards.

Developer Experience

The project’s documentation is organized into a Getting Started guide, user manual, and an extensive wiki that covers addon development. The API surface is documented with OpenAPI specifications, and the source code follows a clear modular structure that makes it easy to trace data flow. Community support is active on Discourse and Matrix, with contributors regularly reviewing PRs for addon compatibility. The MPL‑2.0 license ensures that any derivative work can remain open or proprietary without licensing conflicts.

Use Cases

  • Smart Home Hubs: A homeowner can deploy WebThings Gateway on a Raspberry Pi to unify Zigbee, Z-Wave, and Wi‑Fi devices under one secure web interface.
  • Industrial Edge Monitoring: An engineer can expose factory sensors via MQTT adapters, collect time‑series logs, and trigger alerts through the rules engine.
  • Custom Automation Platforms: A developer can build a headless instance that serves as the backend for a mobile app, exposing only the necessary subset of Things via OAuth‑protected endpoints.
  • Educational Labs: Instructors can demonstrate WoT concepts by having students write their own adapters and observe real‑time interaction through the gateway UI.

Advantages

WebThings Gateway offers a standards‑first approach, ensuring interoperability across vendors while giving developers full control over device protocols. Its lightweight Node.js core and Python addon bridge make it accessible to both JavaScript and Python developers. The built‑in rules engine and event system reduce the need for external orchestrators, and the open source license removes vendor lock‑in. Compared to commercial hubs, it delivers comparable functionality with no subscription fees and the flexibility to run on inexpensive hardware.

Open SourceReady to get started?

Join the community and start self-hosting WebThings Gateway today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
cloud-platforms
License
MPL-2.0
Stars
2.6k
Technical Specs
Pricing
Open Source
Docker
Official
Supported OS
LinuxmacOSDocker
Author
WebThingsIO
WebThingsIO
Last Updated
4 days ago