# Automation

> A rule that performs actions when a trigger happens and its conditions are met, like turning on the lights at sunset when someone is home.

Source: https://contributors.home-assistant.io/glossary/automation/

- In code: `automation`, `automations.yaml`
- Also: automations

Users build automations in the UI or write them in YAML. Under the hood, an automation is an entity too: it can be turned off, and it remembers when it last ran.

## Related terms

- [Trigger](https://contributors.home-assistant.io/glossary/trigger/): What starts an automation, like a state change, a time, or an event.
- [Condition](https://contributors.home-assistant.io/glossary/condition/): A check an automation or script does before it continues, like whether someone is home.
- [Action](https://contributors.home-assistant.io/glossary/action/): Something Home Assistant can do, like turning on a light or sending a notification. Automations, scripts, and dashboards perform actions.
- [Script](https://contributors.home-assistant.io/glossary/script/): A named sequence of actions that can run from an automation, a dashboard, or by voice.
- [Blueprint](https://contributors.home-assistant.io/glossary/blueprint/): An automation, script, or template entity with blanks to fill in, so others can reuse it, like a motion light that only needs the motion sensor and the lamp.
