A Domain-Specific Language for programming IoT automation scenarios in smart environments. Built with Python and textX.
- ECA Automations — Event-Condition-Action rules with
triggers,terminates, and status-based coordination - Multi-Protocol Sources — MQTT, AMQP, Redis brokers and REST endpoints
- Virtual Entity Generation — Generate executable sensor simulators with configurable value and noise generators
- Model Compilation — Compile
.automodels into executable Python - CLI — Validate, compile, and generate from the command line
git clone https://github.com/robotics-4-all/smauto-dsl
cd smauto-dsl
pip install .Broker<MQTT> home_broker
host: "localhost"
port: 1883
auth:
username: ""
password: ""
end
Entity motion_sensor
type: sensor
freq: 2
uri: "bedroom.motion"
source: home_broker
attributes:
- detected: bool -> replay([false, false, true, true, false], -1)
end
Entity bedroom_light
type: actuator
uri: "bedroom.light"
source: home_broker
attributes:
- power: bool
- brightness: int = 0
end
Automation turn_on_light
when
motion_sensor.detected is true
then
bedroom_light.power <- true
bedroom_light.brightness <- 100
config
continuous: true
end
Automations track execution status (IDLE, RUNNING, SUCCESS, FAILED, FINISHED, TERMINATED), enabling inter-automation coordination:
Automation arm_system
when
system_clock.time >= 22:00
then
smart_lock.locked <- true
config
continuous: true
triggers
detect_intrusion
end
Automation detect_intrusion
when
(arm_system.status == SUCCESS) AND
(motion_sensor.detected is true)
then
alarm.active <- true
config
enabled: false
end
See examples/ for 8 progressive real-world scenarios.
smauto validate model.auto # Validate a model
smauto gen model.auto # Compile automations to Python
smauto genv model.auto # Generate virtual entities (per-entity)
smauto genv -m model.auto # Generate virtual entities (merged)Ships with tx-lsp for LSP and REST API support.
make build # Build image
make up # Start (API :8080, LSP :2087)
make up API_KEY=mysecret # With authentication
make down # StopSee Deployment Guide for REST API usage and configuration.
- Language Reference — Brokers, REST Endpoints, Entities, Automations, Conditions, Actions, Value Generators
- Deployment Guide — Docker, REST API, Makefile targets
- Formal Semantics — Abstract syntax, type system, operational semantics
- Examples — 8 progressive IoT automation scenarios

