Automations in Home Assistant
Make devices respond to events in your home.
Which app do we recommend?
Start with the built-in Home Assistant editor. You do not need another app for lighting, notifications, presence or many other everyday automations. Choose Node-RED if you prefer drawing branching flows. Choose AppDaemon if you know Python and want to program reusable logic.
Our difficulty scores are practical estimates, not official ratings. They cover a first useful automation, including installation and troubleshooting. Complex projects can become difficult in any environment.
| Application | Approach | Difficulty |
|---|---|---|
| Home Assistant | Visual editor; recommended starting point | 1/5 - Beginner |
| Node-RED | Visual flows with nodes and messages | 3/5 - Technical |
| AppDaemon | Python code with callbacks and schedules | 5/5 - Coding experience |
Home Assistant: a user-friendly start
Difficulty: 1/5 · No additional installation · No coding skills needed
Build a rule from a trigger, optional conditions and actions. For example: motion detected, it is dark, turn the light on. The same editor also offers choices, repeats and waits. YAML and templates are optional for those who want to go further; YAML is configuration, not a full programming language.

Advantages
- Available directly in Home Assistant; choose devices and actions from your installation.
- No separate automation service to maintain; blueprints help with reusable rules.
Disadvantages
- Many branches can make a long rule harder to follow.
- Complex calculations or specific logic sometimes need templates or YAML.
How to start
Open Settings > Automations & scenes and create a new automation. Choose your sensor as the trigger, add a darkness condition and select a light action. Save the rule, then test an actual sensor change. Traces show which steps ran.
Node-RED: technical, visual flows
Difficulty: 3/5 · Additional community app · Basic knowledge of messages and logic
In Node-RED, connect nodes on a workspace. A message travels through your flow: from an event to checks and then an action. It is visual, but not free of technical concepts. Learn what a message contains and how to handle branches, timers and errors; JavaScript is available for custom logic.


Advantages
- Branches and a message’s path are visible; Debug helps you inspect data.
- Import, export and split flows into reusable subflows.
Disadvantages
- An extra runtime, updates and the Home Assistant connection require maintenance.
- A large canvas can become cluttered; messages, JSON and sometimes JavaScript still need understanding.
How to start
On Home Assistant OS, install the Node-RED community app through the app store; older versions call it an add-on. Open its web interface and check the Home Assistant connection. The community app includes the Home Assistant nodes. For a separate installation, use node-red-contrib-home-assistant-websocket and follow its connection guide.
First create a flow with Events: state for motion, a Current state check for darkness and an Action node for the light. Connect a Debug node to inspect messages. Check the entities and select Deploy to activate changes. Only then add a switch-off timer; test repeated motion too.
AppDaemon: program automations in Python
Difficulty: 5/5 · Additional community app · Python skills required
AppDaemon runs Python apps that react to Home Assistant events and schedules. Write functions and callbacks in a code editor, such as Visual Studio Code. AppDaemon is the runtime service, not the editor. It suits custom algorithms and shared logic; the built-in editor is usually quicker for a simple light rule.

Advantages
- Extensive flexibility for calculations, custom functions and reusable Python classes.
- Text files work well with version control; isolated logic can be tested directly.
Disadvantages
- You maintain code, configuration, dependencies and errors yourself.
- Timers, reconnection and restart behaviour need care; code errors can prevent actions.
How to start
Install the AppDaemon community app for Home Assistant OS and check its connection to Home Assistant. Create a Python file with an app class and register it in the app configuration. Start with a log message before controlling real devices. Then write a motion callback that checks the darkness condition and performs the light action.
Design and test a reliable flow
A flow is the path from an event to a result. Start on paper: what starts it, when may it continue, what should happen and how does it stop? A scene stores desired device states; a script groups actions. An automation can call that scene or script. Homey Flow is a different application, not a built-in Home Assistant app.
- Start with one sensor and one light. First check manual light control and that the sensor state changes.
- Test both passing and blocked conditions. Running actions alone does not prove that your trigger and conditions are correct.
- Test new motion while a timer is running, an unavailable sensor and a restart. Decide deliberately whether an existing run should be replaced or retained.
- Use Traces in Home Assistant, Debug in Node-RED or AppDaemon logs. Keep a backup and document your entities and purpose.
Do not let two apps control the same light with the same rule: duplicate automations can conflict. Node-RED and AppDaemon are separate services that must remain available. HACS is for community integrations and dashboard extensions; it is not needed for the built-in editor and is not where you install these Home Assistant OS apps.
Trigger, condition and action
An automation starts with a trigger, such as sunset or a device changing state. A condition determines whether the action may run. The action is what happens next, such as turning on lights.
Set up without programming
The visual editor helps you choose devices and services and build an automation. This approach requires no coding. Start with a simple rule and check the result before adding more conditions.
Start with a blueprint
A blueprint is a reusable automation template. You fill in your own sensor and light, for example. The community shares blueprints for many applications; check whether the template suits your devices.
Connect devices first
Automations use devices and services already available in Home Assistant. Learn how integrations make that connection.
Create your first rule
- Open Settings > Automations & scenes and create a new automation.
- Under When choose the event that starts the rule.
- Under And if add an optional condition.
- Under Then do choose the action and target, such as a light or room.
- Give the rule a recognisable name and save it.
A condition does not trigger an automation
A trigger starts the rule; a condition only checks whether the action may run at that moment. Suppose you want light when you arrive home after dark. Arriving earlier will not cause it to turn on later at sunset. For that, also add sunset as a trigger and check whether someone is home.
Try it yourself
Start with a notification when the back door opens, for example. Only add a time condition after a successful test. Write down what should happen if the door opens several times in succession. Keep the first version small: a clear goal makes the result easier to check.
Source: Home Assistant, Home Assistant: basics, Home Assistant: editor, Home Assistant: testing, Home Assistant: demo, Node-RED: editor, Node-RED: Home Assistant, Node-RED: first flow, Node-RED: community app, AppDaemon: Python, AppDaemon: installation, AppDaemon: community app