The home assistant dashboard lets you see the status of your devices and to manually control them.
But how do you automatically control devices? The answer is via automations.
An automation consists of a trigger+condition(optional) + action as you will see in the wizard.
For example we can create an automation to send a message (action) when motion is detected (trigger) if it is between 9pm and 6am(condition)
There are two ways of configuring automations in home assistant.
- Manual edit of configuration.yaml file
- Using the Automation Wizard
Manual Edit
This is by far the hardest way of configuring automations and involves editing a file which is usually the automations.yaml file.
The configuration.yaml file is the general configuration file whereas the automations.yaml file is specific to automations.
You need to add a line in the configuration.yaml file to include the automations.yaml file if it is not there. The line looks like this:
automation: !include automations.yaml
Using the Wizard
This is by far the easiest way of configuring automations . You can find the wizard in Settings>Automations and Scenes.
When you click it you will see the current automations.You can click on the automation and edit it or click on the three dots to the right to manage it as shown below:
There is a big blue button at the bottom of the screen to create a new automation using the wizard.
The automations wizard stores the automation in the automations.yaml file ,and you can see the yaml code for each step of the automation in the editor.
Clicking on edit in yaml displays the code and you can edit it if required.
You can do this for each section of the wizard (triggers,conditions,action).
Video
The first part of this video shows you how do create an automation using the wizard (first part) and manually by editing the yaml file.
Related tutorials and resources:
- Home Assistant-Entities,Devices ,Platforms and Integrations
- Home Assistant Configuration.yaml File Basics
- Adding a MQTT Sensor To Home Assistant
- Adding an MQTT Device to Home Assistant
- Home Assistant Templates for Beginners