I was looking for a simple, lightweight, extendable (really extendable or easily programmable) and opensource software for building my own home automation system. I found WebThings Gateway and especially WebThingsIO community!
Simple
Responsive web interface with essentials features well organized.
- Things: it gives me a global view of all my devices
- Rules: it lets me easily create simple and powerful rules
- Logs: store my sensors data and it shows me just in a plot
- Floorplan: add your floorplan as image and organize things
- Settings: a good settings section, the add-ons are really powerful
- Log out: oh yeah, security! You must have credentials to access
Special feature: WebThingsIO offers you a custom subdomain on webthings.io fully auto-configured by the gateway software and you don’t need to create port-mapping rules on your router
Easy to install on linux and raspberry. On linux you enable it at startup by systemctl.
Lightweight
WebThings Gateway uses about 300MB of RAM.
WebThings Node uses about 60MB of RAM. What is “WebThings Node”? It is the Node server installed on raspberry, but let see it in deep in the following paragraph.
Extendable
At the beginning I installed WebThings Gateway on my RaspberryPi until I discovered WebThings Node: there are no needs to install gateway on the Raspberry you are using as a device, just use the raspberry as device and install the gateway somewhere else!
The Gateway is the central point. It connects to every compatible device. Compatible devices are such device that implement compatible protocol/interface such as WebThings protocol.
WebThings Node expose things and you can create any-things! Do you want to expose your RaspberryPi led? Just expose it via WebThings Node and code the link with the GPIO. Here an example.
Do you need a button? Create the JavaScript class like this.
Idea: why to expose physical device only? Why don’t expose a smart read-only switch?
Video Camera
I spent a lot of time and energy on this chapter. There are no so much documentations on this, but you can read the source code because it is OpenSource!
I read the code of WebThings Gateway and I found the way to create a “thing” as video camera with snapshot and live streaming feature (HLS and DASH).
You can have a look at the code here.
My infrastructure
MacBook5,1 with:
- Arch Linux
- WebThings Gateway
Raspberry Pi Model B with:
- BerryClip+
- Relay
- MPL115A2 barometric sensor
- DHT11 temperature and humidity sensor
- Raspberry Pi OS Lite
- WebThings NodeJS
- My WebThings server
Raspberry Pi Model B+ with:
- Relay
- Camera Pi
- Raspberry Pi OS Lite
- WebThings NodeJS
- My WebThings server