Home Assistant automation setting tutorial, practical cases teach you how to integrate sensors and home appliances – Home Assistant step-by-step tutorial EP 3

After reading this article, you may be considering joining Home Assistant or have just joined Home Assistant. At the same time, you are worried about the automation settings of Home Assistant because you are not familiar with them. Today, I will introduce to you how to set up automation in Home Assistant to help you. Your home can move by itself (free your hands! 🙌). Today, we will use "automatically turning on the air conditioner when someone comes home" as an example to teach you how to operate the automatic setting function of Home Assistant. I hope it will be helpful to you!

if you:


Three major elements of automation: trigger, condition, and action

Before entering the formal operation, you must first understand the three major elements of automation: trigger, judgment condition, and action. This is very similar to the process when people usually perform actions. Since you want to set up automation, the purpose is to make Home Assistant completes these three things for us. This tutorial will use the automation currently used by Dankeju to "automatically turn on the air conditioner when someone comes home" as an example. First of all, the effect that this automation wants to achieve is: when Ashan and I have one of The air conditioner is automatically turned on when a person arrives home, but it cannot be turned on even though the weather is very cold. Therefore, I set up the trigger, condition, and action as follows:

  • Trigger: Someone comes home
  • Judgment condition Condition: Indoor temperature is greater than 24°C
  • Action: Turn on the air conditioner

After understanding the three major automation elements of Trigger, Condition and Action, let's take a look at how to complete this automation setting in Home Assistant.


Step 1. Add automation

Step 1-1. Home Assistant ➜ "Settings" on the left ➜ "Automation and Scenes"

Home Assistant 設定自動化

Step 1-2. "Add automation"

Home Assistant 設定自動化
Home Assistant 設定自動化

Step 2. Set "Trigger"

Step 2-1. Select "Value change trigger"

Select "Add a trigger" ➜ "Value change trigger", because in this automation setting, we need to use the change in the number of people at home to trigger the automation.

Home Assistant 自動化設定觸發 Trigger

Step 2-2. Set "numeric value change trigger"

  • Select "Home" for "Entity": When you have set up family members in Home Assistant, and the Home Assistant APP is installed on the family members' mobile phones, the "Home" entity will instantly provide the value of "how many people are at home now".
  • "What is the value greater than?" is set to "fixed value" greater than "0".
  • "Continue" is set to "0:03:00".

In plain English, the effect of such a trigger setting is: this automation is triggered when the number of people at home changes from "0 people" to "more than 0 people" for 3 minutes.

Home Assistant 自動化設定觸發 Trigger

Step 3. Set "Trigger Judgment Condition"

Step 3-1. Select "Numerical Judgment"

Select "Add a Judgment" ➜ "Numerical Judgment". Here we need to judge the indoor temperature to decide whether to turn on the air conditioner.

Home Assistant 自動化設定判斷條件 Condition

Step 3-2. Set "Numerical Judgment"

  • "Entity" chooses the device used to determine the indoor temperature: Our home directly uses air conditioning to determine the indoor temperature. If you have an additional temperature sensor, you can also choose it here.
  • Select "Current Temperature" for "Properties": It depends on what properties are provided by the device you use to determine the temperature. Here I select "Current Temperature".
  • "What is the value greater than?" is set to "24".
Home Assistant 自動化設定判斷條件 Condition

Step 4. Set "post-trigger action"

Step 4-1. Select "Execution Service"

Select "Add an Action" ➜ "Execution Service". Here we will use two "Execution Services" to set the target temperature and fan mode respectively.

Home Assistant 自動化設定動作 Action

Step 4-2. Set target temperature

  • "Service" select "Temperature Control: Set Target Temperature"
  • "Target" selects your air conditioner via device or entity
    (If you are a Daikin air conditioner like me, you can refer to our video to install the WiFi control module:https://youtu.be/jabdFDyOcLs)
  • "Temperature" sets your ideal temperature, I set it to "24" (Sorry polar bear😅)
  • "HVAC Mode" is set to "Air Conditioning"
Home Assistant 自動化設定動作 Action

Step 4-3. Set fan mode

Here we need to add another action, refer to Step 4-1.

  • "Service" select "Temperature Control: Set Fan Mode"
  • "Target" selects your air conditioner via device or entity
  • "Wind speed mode" is set to "Auto" (of course it can also be adjusted as needed)
Home Assistant 自動化設定動作 Action

Step 5. Set "Name" and "Description"

Click "Save" in the lower right corner, and a dialogue window will appear on the screen. "Name" is required, and "Description" is optional.

In order to make it easy to maintain in the future, I am used to condensing triggers, judgment conditions, and actions in names. In today's example, I set the name to "Someone arrives home + indoor temperature > 24°C => turn on the air conditioner in the living room", so that in You can see it at a glance in the automation settings list.

Finally press "Save" and you're done!

Home Assistant 自動化設定

The above is the tutorial for setting up automation in Home Assistant! Because Home Assistant is really rich in functions, the interface is slightly more complicated than common smart home hubs such as Homekit, Google Home, etc., but it is because of this that Home Assistant can meet the needs of various situations. Try it out. Give it a try!

8 COMMENTS

  1. Hi Neil, I tried to follow your method, but I couldn't find the Home entity in the first step. Is the Home name fixed? Thanks!

    • Hi Eric,
      Go to "Settings > Areas, Labels and Partitions > Areas" to see if there is a Home location set. If you haven't added one here, you may have skipped the Home location setting during the initial settings.

  2. Hi Neil,
    I remember you said in your video that the current home detection method uses GPS. Does this mean the "Geocoded Location" entity?
    In addition, I just checked my "Home" entity. It has been >0 for the whole month. It has not detected that I left home normally. Have you made any settings adjustments?
    Thanks

    • Hi Aaron,
      I am using the "Home" entity, you may want to check:

      1. Personnel settings: If the same person has multiple devices but are set to different persons, the device may be regarded as someone being at home even if the device is not taken out.
      2. Permissions of mobile phone HA APP: You need to open the permissions related to positioning and GPS.

      If there is nothing wrong with the inspection, then open the HA APP after going out to see which person is at home. There may be a problem with the positioning of that person's device.

  3. Please ask Neo
    Currently, the vizo switch has been connected from z2m, and the device can also be operated through HA.
    I would like to ask about the automatic setting of dual control switches
    I can't find my switch device on the automation settings page tirgger
    You have to move to the z2m field to see it.
    I'm stuck here and don't know what to do next.
    I’ve browsed the forum but don’t know what keywords to search for.
    So let’s ask Neo

LEAVE A REPLY

Please enter your comment!
Please enter your name here

you might like

recent discussions

you might like