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
  • Jerry 2025/04/14Thank you very much Neil for your selfless sharing. The websites you provided are of great help to me. I will save it first and digest it slowly^^ I also look forward to Neil's industry news and teaching articles in the futureHome Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Neil 2025/04/13Hi Jerry, I usually get information about HA from these places: Website: – Home Assistant official Release notes – Automata – Home Automation Community – Weijia Home Intelligence FB Group: – Taiwan Home Assistant enthusiasts exchange – Home Assistant YouTube channel: – Smart Home Solver – Everything Smart Home – Home Assistant Programming language: Strictly speaking, YAML is not really a programming language (let me make this clear in case some people mind 🤣), but if we include these data formats or style languages that “look like” programming languages, and sort them by depth of use in HA (the deeper the bottom, the deeper the bottom): – YAML (data format): a language for configuration files used in many places in the HA environment. – CSS (style language): used to adjust the interface style (font size, color, image, position, etc.). – JSON (data format): If you use Node-RED, you will probably come across it. – Jinja2 (Python template syntax): You may encounter it when you explore automation or Dashboard in depth. ※ But in fact, even if HA does not know the above, it can still make a smart home complete. You don’t have to put so much pressure on yourself, but if you are interested, it is also good to know more. It is actually difficult to generalize about the support of devices. Now, even if the home appliances themselves do not support it, there are still many different ways to connect traditional home appliances to HA. In addition, cases like Haier do require in-depth research. What I usually do is to crawl a lot of information on the Internet, and usually find attempts made by others. It just so happens that when I was looking up other information recently, I saw someone sharing how Haier water heaters were connected to HA. But it is indeed like what you said, if you get involved for a while, you will understand these details more and more. 🤣Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Jerry 2025/04/10Hello Neil: After observing for 1 or 2 days, everything seems to be normal. Maybe it’s because the system was not stable during the initial setup period!? The more I play, the deeper I feel. I also find that I still have many shortcomings. I wonder if Neil can share and teach everyone how to fish? For example, recommend good websites, forums, FB groups, youtube videos, or give some guidance. In addition to the YAML language, would it be helpful to know some CSS syntax? Do I need to know other languages? I can even start a new teaching direction. When I see non-big-name products that claim to support APP (such as products from mainland China), I can teach everyone how to identify whether they can be connected to HA and how to ask customer service? Where can I see supported articles or platforms? This kind of experience sharing, I think, will be very helpful to everyone. I am currently looking to buy a heat pump water heater from Haier. Haier is a big manufacturer in the world and has its own APP. I have also found Haier's kit from HACS, but it does not seem to support heat pump water heaters. Does that mean it cannot be connected to HA? Or is there any channel to check it? There are also many flat panel lights and fan function lamps on the other side of the strait, which also claim to support APP connection, but they are all small manufacturers and it is difficult to tell whether they can be connected to HA. These are the problems I am facing now. If the home appliances I buy are different from what Neil shared, I don’t know where to start. Maybe I'm still too inexperienced. If I play for a few more months, maybe the above problems won't be a problem anymore, haha^^Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Neil 2025/04/09Hi Jerry, I tested it myself and it was fine, but please note that because it is controlled through the cloud, there is an extra layer of brand mediation, so it is not suitable for fast switching. I tested it myself and it took about 1 second to complete the synchronization after clicking. Remember to put the entity in entities, otherwise the status display may have problemsHome Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Jerry 2025/04/07Thanks Neil for clarifying this. I tested it later and found that when using the "button panel" to control the switch of the Electrolux air conditioner (the same model as Neil), the device will respond to turning on or off in about 1 second, but the "status icon" for turning on is much slower, and it takes about 30 seconds. The "status icon" for turning off is normal, and the "status icons" of other negative ion switches and the "status icons" of the monitoring light switch are also normal, which made me think there was a problem with the synchronization. I'll test it again, maybe it's caused by the wrong setting.Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Neil 2025/04/07Hi Jerry, 1. This method is through cloud integration, which is actually using HA to call Xiaomi/Electrolux to control the device. 2. It is not normal. If this happens, you may need to check whether the entity you display on the floor plan can truly represent the status of the device. If not, you may need to try other entities of the same device.Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Jerry 2025/04/07The problem is solved. Thanks again to Neil for his help^^ I have two more questions about concepts. Neil, do I have any misunderstandings? 1. I connected Xiaomi and Electrolux devices to HA through HACS. Is it still connected through WiFi? Before connecting, you need to obtain API key and Access Token from the official. This means that the communication between HA and the device still needs to go through the official. It’s just that the official APP can be replaced and all integrated into the HA APP for control? 2. After testing, when controlling the device through physical operation or the original official APP, the HA app cannot know the status of the device synchronously, but it can know the opposite. Is this normal? For example, the Xiaomi electric fan at home was turned on by someone physically before going out, but when the person is outside, he cannot know through the HA app that the device was forgotten to be turned off. He has to connect to the Xiaomi app to know!?Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
  • Ghost 2025/04/07Xiaomi Home currently does not support Taiwan. For now, you can only use Xiaomi Miot Auto. As for Xiaomi Cloud Map Extractor, I currently have a 2FA problem. There seems to be no simple solution. I haven’t tried it successfully yet.Home Assistant must-install HACS plug-in installation steps detailed explanation – Home Assistant step-by-step tutorial EP 17
  • Neil 2025/04/07Jerry, it seems that the click action cannot penetrate the part where the picture changes because of the overlapping pictures. Try adding pointer-events: none to the style.Home Assistant Floor plan A new experience in smart home control with visual floor plan! – Home Assistant step-by-step tutorial EP 6
you might like