A smart room built on VOLTTRON: Tuya air-quality sensors and smart plugs, each handled by its own agent, with readings flowing into dashboards and alerts.
One agent per job
The room uses Tuya indoor-air-quality (IAQ) sensors and smart plugs. Instead of one service that does everything, each responsibility is its own agent on the VOLTTRON message bus:
- TuyaIAQ polls CO₂, temperature, humidity, PM2.5, VOC and illuminance.
- TuyaSmartPlug manages the outlets, with remote on/off control.
- AlarmAgent checks readings against configurable thresholds and raises alerts.
- RESTAgent exposes HTTP endpoints, so outside systems can query status and control devices.
How data moves
Agents talk through VOLTTRON's VIP (VOLTTRON Interconnect Protocol) using publish/subscribe, so they stay loosely coupled and new ones can join without touching the rest. The message bus can run on either ZeroMQ or RabbitMQ.
Readings come in from the devices through the Tuya Cloud API, get processed by the agents, land in CrateDB as time series, and show up in Grafana dashboards like the one above.
Alerts on your phone
When a reading crosses a threshold, such as CO₂ climbing in a closed room, the AlarmAgent sends a push alert through LINE Notify.
Running it
Everything is deployed with Docker, so the stack behaves the same in development and production.
What it's a reference for
The project is a working example of patterns that carry over to smart building management, environmental monitoring and home automation:
- Agent-based microservices
- Event-driven communication
- Threshold-based alerting
- Integration with external APIs
Because each agent does one job, adding a new device type or a new processing step means adding an agent rather than changing the ones that already work.
