A Google Summer of Code 2025 project that enhances SmAuto — a Domain-Specific Language (DSL) for smart environment automation — and integrates it into Home Assistant as an open-source add-on.
SmAuto enables users to define complex automation scenarios through a textual, low-code interface. This project extends the DSL with new capabilities and brings it directly into the Home Assistant ecosystem, empowering users to design and deploy sophisticated automations with minimal coding expertise.
Extend the SmAuto DSL to support the REST protocol for accessing external data sources. This introduces a RESTSource concept in the TextX grammar, allowing automations to fetch and use data from external REST APIs.
RESTSource weather_api
url: "https://api.weather.com"
key: "temp"
endIntroduce new node types to enrich automation workflows:
- Delay — Pause execution for a specified duration (
Delay duration: 10s) - Switch — Toggle state based on conditions (
Switch state: bool) - Compute — Perform calculations on sensor data (
Compute output: float expression: "sensor1.value + sensor2.value")
Integrate SmAuto into Home Assistant as an open-source add-on, enabling users to:
- Design automations graphically using SmAuto's low-code environment
- Access and control Home Assistant entities directly from SmAuto models
- Deploy automations seamlessly via MQTT as the communication bus
┌─────────────────────────────────────────────────────┐
│ Home Assistant │
│ │
│ ┌──────────────┐ ┌──────────────────────┐ │
│ │ HA Entities │◄───────►│ SmAuto Add-on │ │
│ │ (sensors, │ MQTT │ (Web UI + Backend) │ │
│ │ actuators) │ │ │ │
│ └──────────────┘ └──────────┬───────────┘ │
│ │ │
└──────────────────────────────────────┼──────────────┘
│
┌────────▼────────┐
│ MQTT Broker │
│ (Mosquitto) │
└────────┬────────┘
│
┌────────▼────────┐
│ SmAuto REST │
│ API Server │
│ (Code Gen) │
└─────────────────┘
Components:
- SmAuto REST API Server — A FastAPI server (Docker) that receives SmAuto DSL models, generates Python automation scripts, and returns the code via REST API
- MQTT Broker (Mosquitto) — Central message bus bridging Home Assistant entities and SmAuto automation scripts
- SmAuto Add-on — Home Assistant add-on providing a web-based interface for authoring and deploying SmAuto automations
- Home Assistant Entities — Sensors and actuators mapped to SmAuto entities via MQTT topics
.
├── Dockerfile # Add-on Docker image definition
├── config.yaml # Home Assistant add-on configuration
├── run.sh # Add-on startup script
├── examples/
│ ├── automations.yaml # Example HA automations for MQTT bridging
│ └── smauto_model.auto # Example SmAuto DSL model
├── LICENSE
└── README.md
SmAuto uses a human-readable DSL to define automation scenarios. Here is an example that turns on a light when the temperature is high, and activates a thermostat when it's cold:
Metadata
name: HomeAssistantTestModel
version: "1.0.0"
author: "Your Name"
end
Broker<MQTT> home_broker
host: "localhost"
port: 1883
auth:
username: ""
password: ""
end
Entity weather_station
type: sensor
topic: "porch.weather_station"
broker: home_broker
attributes:
- temperature: float
- humidity: int
end
Entity office_light
type: actuator
topic: "office.light"
broker: home_broker
attributes:
- power: bool
- brightness: int
end
Automation turn_on_light_when_hot
condition:
(weather_station.temperature > 28) AND (office_light.power is false)
enabled: true
continuous: true
actions:
- office_light.power: true
- office_light.brightness: 80
endSee examples/smauto_model.auto for the full model including thermostat control.
- Docker
- Home Assistant (with MQTT integration enabled)
- A running SmAuto REST API server
docker run -d --name mosquitto -p 1883:1883 eclipse-mosquitto mosquitto -c /mosquitto-no-auth.conf# Clone and build from the SmAuto repository
git clone https://github.com/robotics-4-all/smauto.git
cd smauto
docker build -t smauto .
docker run -d --name smauto-api -p 8080:8080 smautoBuild and install the add-on in your Home Assistant instance:
# From this repository's root
docker build -t smauto-addon-local .For local development with Home Assistant Core, refer to the HA add-on development docs.
Add the example automations from examples/automations.yaml to your Home Assistant automations.yaml to bridge sensor and actuator events between HA and MQTT. Update topics and entity IDs to match your devices.
- Author — Write automation logic in SmAuto DSL (
.autofiles) - Generate — The SmAuto REST API compiles the DSL model into executable Python code
- Bridge (HA → SmAuto) — HA automations publish sensor state changes to MQTT topics
- Execute — The generated script subscribes to sensor topics, evaluates conditions, and publishes actuator commands
- Bridge (SmAuto → HA) — HA automations listen for MQTT actuator commands and call the corresponding HA services
- SmAuto — Konstantinos Panayiotou and the Robotics-4-All team
- Mentors — Konstantinos Panayiotou, Emmanouil Tsardoulias, Andreas Symeonidis
- Organization — ISSEL Research Team, Aristotle University of Thessaloniki
- Program — Google Summer of Code 2025
This project is licensed under the MIT License — see LICENSE for details.