Getting Started with ESPHome: How to Install and Integrate it with Home Assistant?

Getting Started with ESPHome

ESPHome is a simple yet powerful system that allows users to control ESP boards using YAML configuration files. It allows users to quickly and easily build custom firmware for sensors and devices without any programming skills. ESPHome supports a long list of devices, sensors, and protocols that can be configured with just a few lines of YAML. Apart from that, it can also control lights, displays, and even more. It can be integrated with Home Assistant in few clicks.

 

There are mainly two methods for installing ESPHome. The quickest and easiest way is using the Home Assistant add-on, the second way is to install through python using pip. In this tutorial, we are going to install ESPHome through the Home Assistant add-on. Once the installation is complete, we will test it by controlling an LED and reading DHT11 sensor data. If you are not familiar with Home Assistant, follow our previous tutorial on Getting Started with Home Assistant. You can also check our previous tutorial on Flashing Tasmota on ESP8266-01.

 

Components Required for Installing ESPHome

  • ESP8266-01
  • Arduino Uno
  • LED
  • DHT11
  • Jumper Wires

 

Installing ESPHome

Installing the ESPHome through the ESPHome Home Assistant add-on is very easy. To install ESPHome, first, navigate to Home Assistant Web UI and from there navigate to the Supervisor panel, then search for ESPHome in the “Add-on Store” tab.

ESPHome Home Assistant

 

Open the ESPHome and then simply click on the Install button in order to install it. After that, wait until the add-on is installed. Then start the add-on and switch on the ‘Show in Sidebar’ option for ease of access. After that, click “Open Web UI”.

 Installing ESPHome

 

Now you will be redirected to ESPHome Web UI. Click on the “+” icon to add a new device.

ESPHome Web UI

 

In the first step, enter the device or project name. The device name must be in lowercase and must not contain any spaces. For example, my device name is ‘office_temperature’ but you can choose any name you like.

ESPHome Node Name

 

In the second step, select the correct board type. Here, I am using an ESP-01 Wi-Fi board so I selected ‘Generic ESP8266’.

ESPHome Device Type

 

Then in the next step, enter the SSID and password of the Wi-Fi network. You can also set an additional password for future OTA firmware updates.

ESPHome Wi-Fi and Updates

 

Once you have entered your credentials, click Next and then click Submit in the next step to finish the process, and the device will be added to the ESPHome UI. It will then ask to select a port. If you are using a Board that has a USB interface, connect it to Laptop and select the port; else ignore it.

ESPHome UI

 

Now to create a configuration for the ESP-01 device, click on ‘Edit’ from the menu of the device. You will be presented with the YAML file. If the YAML page is blank then click on ‘Overview’ or any other tab and then click back to ESPHome and click ‘Edit’ again. You will see a YAML file currently configured for your device.

ESP-01 Device Configuration

 

Now in the next step, we are going to add a light component (LED) and binary sensor (DHT11) in the configuration file. ESPHome has tons of compatible sensors and devices that you can find on their website. Add the below lines of code to the configuration file:

# Web server
web_server:
  port: 80
  auth:
    username: admin
    password: 312124dc
# Sensors config
sensor:
  - platform: dht
    pin: GPIO0
    model: DHT11
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 20s
output:
  - platform: gpio
    pin: GPIO2
    id: main_relay
light:
  - platform: binary
    name: "Lamp 1"
    id: rele1
    output: main_relay
text_sensor:
  - platform: wifi_info
    ip_address:
      name: espname ESP IP Address

 

Now go ahead and click save. Then click on three dots in the top right corner and then click 'Compile'.

ESPHome Compilation

 

The compilation process may take a while. Once the compilation completes successfully, click on ‘Download Binary.’

Install ESPHome

 

Note: If you are using a board with a USB interface, then you can directly upload the code from ESPHome UI by selecting the serial port but as we are using an ESP-01 board, we will use Arduino Uno to upload the firmware.

 

Flashing ESPHome on ESP-01

There are generally two methods for flashing ESPHome on ESP8266. One is Over the Air (OTA) and the other is using FTDI or Arduino Uno. In this project, we are going to use Arduino Uno.

 

Step1: Preparing Hardware

To flash a new firmware on ESP-01, connect ESP-01 with Arduino Uno as per the circuit diagram.

ESP-01 with Arduino Uno

Connect the VCC and GND of ESP-01 to 3.3V and GND of Arduino; also connect CH_PD to 3.3V andGPIO_0 to GND of Arduino. Connect RX and TX of ESP-01 to RX & TX of Arduino Uno respectively. GPIO_0 is grounded to enable the flashing mode of ESP8266-01. After making the circuit as per the diagram, connect the Reset pin of the Arduino to GND to bypass the Arduino. It will disable Arduino and upload the firmware directly to the ESP-01. Connect RST pin of ESP-01 to ground, remove the RST after half a second (the blue LED flashes for some millisecond).

 

Step 2: Download and install Tasmotizer

Tasmotizer is a specifically designed flashing tool for Tasmota but here we will use it to Flash ESPHome. Download the latest Tasmota version for your platform. After downloading, double click the downloaded file and it'll start, no installation is required.

 

Step3: Flashing the Firmware

Now in the final step, select the port to which Arduino Uno is connected. Then browse to the ESPHome firmware binary you downloaded. You can take a backup of your original firmware by checking in the “Save original firmware” option. Click Tasmotize! and wait until it is done.

Flashing the ESPHome Firmware

Once the Flashing is done, disconnect the RX, TX, CH_EN pins and connect an LED to GPIO2 and DHT11 to GPIO0 of ESP-01 as shown in the image given.

 

Wait until the ESP-01 connects to Wi-Fi and then click on Configuration to load the configuration page, then go to Integrations.

Home Assistant Configuration

 

Now on the Integrations page, you will see that Home Assistant has already discovered the ESPHome device.

ESPHome Device

 

If you didn’t turn on the Edit mode on your Dashboard, ESPHome will already be visible on the overview page, otherwise, add it manually.

ESPHome with Home Assistant

 

You can even access the ESPHome Web UI without Home Assistant. For that enter the IP address of ESP8266 into the browser URL and click Enter. It will ask you to enter the Username and Password that you provided in the configuration file.

ESPHome Web UI without Home Assistant

 

After entering the User name and Password, click on Sign in and you will be redirected to ESPHome Web UI.

ESPHome Web Server API

This is how you can integrate ESPHome with Home Assistant. It's that easy to add sensors and devices using ESPHome. A complete working video is given below. If you have any questions, please let me know in the comments below.

Video

701 Comments

I wish to express my appreciation to the writer for bailing me out of this type of incident. Right after looking out through the search engines and getting concepts that were not powerful, I was thinking my life was gone. Existing devoid of the approaches to the issues you have solved through your good guideline is a crucial case, and the kind which could have adversely damaged my entire career if I hadn't discovered your blog post. Your main natural talent and kindness in playing with a lot of stuff was excellent. I don't know what I would've done if I had not discovered such a stuff like this. I can at this time look forward to my future. Thanks so much for the skilled and results-oriented help. I won't think twice to propose your web site to anybody who should get guidelines about this situation.

I want to express appreciation to the writer just for bailing me out of this particular setting. After exploring throughout the internet and getting views which were not beneficial, I thought my life was over. Being alive without the presence of solutions to the difficulties you have solved by way of your review is a crucial case, and the kind that would have negatively affected my career if I had not come across your web page. Your own personal know-how and kindness in dealing with all areas was tremendous. I don't know what I would've done if I hadn't come upon such a step like this. I'm able to at this moment look ahead to my future. Thank you very much for the expert and amazing help. I will not be reluctant to endorse your web site to any individual who needs guide on this issue.

I must express thanks to you for bailing me out of this type of problem. As a result of browsing through the world-wide-web and getting principles which are not productive, I believed my life was well over. Living without the answers to the issues you have fixed by way of your entire article content is a crucial case, as well as the kind which may have adversely affected my career if I had not discovered your website. Your own knowledge and kindness in playing with every part was valuable. I'm not sure what I would've done if I had not come across such a stuff like this. It's possible to at this moment relish my future. Thanks so much for your skilled and results-oriented guide. I won't hesitate to refer your blog post to any person who wants and needs support about this matter.

I wanted to post you one tiny remark to help say thanks yet again with the stunning things you have featured at this time. It's so pretty open-handed of people like you to provide freely all numerous people could possibly have advertised for an electronic book to generate some dough on their own, certainly given that you might well have tried it if you wanted. The concepts as well worked to become great way to be certain that other people have a similar fervor much like mine to see a lot more when considering this condition. I am sure there are thousands of more pleasant occasions up front for folks who examine your blog post.

I must convey my admiration for your generosity supporting men and women who require help with your content. Your personal dedication to getting the solution along turned out to be astonishingly valuable and has continually allowed girls just like me to realize their goals. Your useful recommendations denotes this much a person like me and somewhat more to my office colleagues. Regards; from all of us.

My spouse and i felt absolutely ecstatic when John managed to complete his web research from the ideas he grabbed while using the web site. It's not at all simplistic to simply always be making a gift of secrets that most people might have been making money from. We grasp we need the writer to appreciate because of that. Those illustrations you made, the easy site menu, the relationships you can aid to promote - it's got mostly fantastic, and it's letting our son and the family reason why the subject is awesome, and that is really important. Thank you for the whole lot!

I enjoy you because of all your efforts on this site. My niece take interest in managing internet research and it's easy to see why. We all hear all regarding the powerful mode you present both useful and interesting techniques by means of this web site and therefore increase contribution from some other people on the topic so our own child is actually becoming educated a lot of things. Take pleasure in the remaining portion of the new year. You are performing a fantastic job.

Thanks for all of your effort on this web page. Ellie delights in doing investigations and it's easy to see why. Almost all know all regarding the dynamic mode you deliver priceless ideas by means of the web site and inspire contribution from the others on this concern and our own child is truly studying a great deal. Enjoy the rest of the year. You have been doing a glorious job.

Thanks for your entire hard work on this site. Kim take interest in going through internet research and it's easy to understand why. We all learn all about the lively means you produce reliable guidelines through this website and as well as inspire contribution from the others on the theme while our simple princess is truly starting to learn a lot of things. Enjoy the rest of the year. You are doing a pretty cool job.

I would like to express thanks to this writer just for rescuing me from this type of incident. Because of looking throughout the internet and meeting advice that were not powerful, I thought my entire life was over. Being alive devoid of the approaches to the difficulties you have solved all through this short post is a critical case, as well as the kind that might have in a negative way affected my entire career if I had not encountered your site. Your good expertise and kindness in dealing with all things was precious. I don't know what I would've done if I hadn't come across such a thing like this. I can at this moment look ahead to my future. Thanks for your time very much for the skilled and effective help. I will not be reluctant to propose the blog to any individual who needs to have direction about this issue.

I抦 impressed, I must say. Actually hardly ever do I encounter a weblog that抯 each educative and entertaining, and let me tell you, you may have hit the nail on the head. Your idea is excellent; the difficulty is one thing that not sufficient individuals are speaking intelligently about. I'm very joyful that I stumbled throughout this in my seek for something referring to this.

Needed to create you one very small remark to be able to thank you so much once again for your personal pleasing tips you've documented here. It has been unbelievably generous with you to provide unreservedly just what a lot of people might have made available as an electronic book in order to make some bucks on their own, certainly considering the fact that you could have tried it if you ever decided. Those things also worked to be the fantastic way to fully grasp that the rest have similar dream just like mine to grasp more with reference to this matter. I think there are lots of more fun occasions up front for people who read through your blog.

I am commenting to let you be aware of of the excellent discovery my wife's daughter obtained reading through your web page. She mastered too many details, including what it is like to have an incredible helping mood to make folks with no trouble grasp certain extremely tough matters. You actually did more than visitors' expectations. Thank you for providing the insightful, safe, edifying not to mention cool guidance on that topic to Emily.

Thank you a lot for providing individuals with remarkably nice opportunity to read from this web site. It is often so pleasurable and full of amusement for me personally and my office acquaintances to visit the blog at a minimum thrice per week to read through the newest stuff you will have. And lastly, I am usually fascinated with all the excellent opinions served by you. Certain 4 ideas in this post are essentially the finest we have had.

I and my buddies ended up reading through the best ideas located on your web page and so suddenly got a horrible suspicion I had not expressed respect to the site owner for those tips. My boys are actually certainly stimulated to see them and have in effect clearly been taking pleasure in these things. Many thanks for being really thoughtful and for opting for variety of very good ideas millions of individuals are really needing to know about. My sincere regret for not saying thanks to you earlier.

Thank you a lot for giving everyone a very pleasant opportunity to read critical reviews from this web site. It can be so beneficial and full of a lot of fun for me personally and my office acquaintances to search your blog not less than 3 times in one week to find out the newest stuff you have got. And of course, I'm just actually fulfilled with your effective principles served by you. Selected 1 facts in this posting are really the very best I've had.

My husband and i ended up being now cheerful that Albert managed to complete his preliminary research from your ideas he obtained out of your web pages. It's not at all simplistic to just choose to be making a gift of ideas that other folks have been making money from. And now we fully grasp we have got the website owner to give thanks to because of that. The most important illustrations you have made, the straightforward site menu, the relationships you will help to create - it's everything great, and it's really facilitating our son in addition to our family reason why this idea is enjoyable, and that is quite fundamental. Thank you for everything!

A lot of thanks for all your work on this web page. Kate delights in conducting investigations and it's really obvious why. We learn all concerning the powerful tactic you convey both useful and interesting strategies on this blog and in addition strongly encourage participation from some others on the content and my daughter has always been understanding so much. Have fun with the rest of the year. You are doing a first class job.

Thanks a lot for providing individuals with a very memorable chance to read in detail from this web site. It's usually very brilliant and also jam-packed with fun for me and my office friends to search your blog nearly 3 times in 7 days to read through the fresh things you have got. And indeed, I am at all times fulfilled concerning the wonderful tricks served by you. Selected 1 facts in this article are essentially the most efficient I have had.

I needed to put you that very small note just to give thanks as before for these striking techniques you have shown at this time. It's certainly particularly generous with people like you to provide easily all many of us might have advertised for an e-book in making some profit for themselves, even more so given that you might well have done it in the event you wanted. The good ideas additionally worked to be the great way to fully grasp that other people have similar dreams like my personal own to find out a great deal more with regards to this problem. I am certain there are a lot more pleasant sessions in the future for those who read carefully your website.

A powerful share, I just given this onto a colleague who was doing a bit of evaluation on this. And he in truth bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading extra on this topic. If doable, as you change into experience, would you mind updating your blog with extra particulars? It is highly helpful for me. Massive thumb up for this weblog put up!

I just wanted to develop a simple note to be able to say thanks to you for those awesome strategies you are showing at this site. My extensive internet research has at the end of the day been honored with reliable strategies to write about with my good friends. I 'd assume that many of us website visitors are definitely blessed to exist in a really good place with many brilliant professionals with valuable points. I feel truly grateful to have used your entire site and look forward to many more enjoyable moments reading here. Thanks a lot again for all the details.

I simply needed to thank you very much once again. I'm not certain what I could possibly have used without the solutions documented by you regarding my area of interest. It had become a frightful problem in my circumstances, however , observing your specialized tactic you handled that took me to jump over joy. I'm thankful for your work as well as have high hopes you comprehend what a great job your are carrying out educating many others by way of your site. Probably you've never encountered all of us.

I must get across my admiration for your kind-heartedness supporting folks who need guidance on this important field. Your special dedication to passing the message all over was astonishingly significant and has constantly allowed regular people like me to attain their aims. The useful publication indicates a lot to me and extremely more to my mates. Many thanks; from everyone of us.

Thanks a lot for giving everyone a very spectacular chance to read articles and blog posts from this website. It really is very lovely and full of a great time for me and my office co-workers to search your site at minimum three times a week to find out the latest items you have. And definitely, we are usually satisfied for the powerful pointers you give. Some 2 areas in this article are really the best we've had.

I would like to point out my appreciation for your generosity supporting women who really want guidance on this particular field. Your very own commitment to passing the message throughout had been wonderfully useful and have regularly permitted most people like me to get to their ambitions. Your entire invaluable instruction indicates this much to me and still more to my fellow workers. Best wishes; from each one of us.

My husband and i were really joyful when Michael managed to deal with his homework by way of the ideas he was given using your weblog. It is now and again perplexing to just continually be handing out strategies which usually others may have been selling. And now we remember we have got you to thank because of that. The main explanations you made, the simple blog navigation, the friendships your site make it possible to engender - it's got mostly remarkable, and it is assisting our son in addition to us feel that the subject is excellent, which is tremendously indispensable. Thank you for the whole lot!

I have to voice my admiration for your kind-heartedness giving support to individuals who require guidance on this one field. Your special commitment to getting the message all around appears to be pretty valuable and have allowed people much like me to realize their goals. This informative hints and tips denotes this much a person like me and even more to my office colleagues. Warm regards; from everyone of us.

I just wanted to write a simple remark in order to say thanks to you for these pleasant suggestions you are posting at this website. My time intensive internet investigation has at the end been compensated with beneficial concept to share with my friends and classmates. I would repeat that most of us visitors are definitely lucky to dwell in a fine community with very many awesome professionals with useful basics. I feel truly grateful to have used your weblog and look forward to many more brilliant times reading here. Thanks a lot once more for everything.

I definitely wanted to make a remark so as to thank you for all the unique tips and hints you are posting at this site. My rather long internet lookup has at the end been compensated with beneficial concept to write about with my best friends. I would declare that we site visitors actually are unequivocally endowed to be in a remarkable site with very many marvellous individuals with interesting strategies. I feel very much lucky to have come across the webpage and look forward to some more fabulous minutes reading here. Thank you once again for everything.

I happen to be writing to make you be aware of what a cool experience my wife's child developed studying your blog. She figured out such a lot of issues, which included what it is like to possess an ideal helping character to get many others just completely grasp specific grueling subject matter. You undoubtedly did more than our expected results. Thank you for distributing these necessary, trustworthy, revealing and in addition cool guidance on the topic to Lizeth.

My spouse and i got quite joyful that Albert managed to do his basic research from the precious recommendations he acquired from your very own blog. It is now and again perplexing just to possibly be giving for free guidelines that many people today may have been trying to sell. And we know we have you to be grateful to for this. The entire explanations you have made, the simple website menu, the friendships you aid to create - it's mostly sensational, and it's making our son and the family reckon that that theme is interesting, and that is especially mandatory. Thank you for all!

Nice post. I study one thing more difficult on different blogs everyday. It should at all times be stimulating to learn content from different writers and practice a little bit one thing from their store. I抎 want to make use of some with the content material on my blog whether or not you don抰 mind. Natually I抣l offer you a hyperlink in your web blog. Thanks for sharing.

Thanks so much for giving everyone an extremely wonderful chance to read from this site. It is always so cool and also stuffed with amusement for me personally and my office friends to search your web site at minimum thrice in one week to find out the fresh secrets you will have. And of course, we are at all times astounded for the superb points served by you. Some 3 areas in this posting are clearly the simplest I've ever had.

Thanks a lot for providing individuals with such a pleasant opportunity to discover important secrets from this website. It's always so fantastic and as well , packed with fun for me and my office colleagues to visit your site the equivalent of 3 times weekly to find out the newest things you have. And of course, I am just at all times fascinated considering the surprising methods you give. Some two facts in this article are unequivocally the simplest we have had.

I simply desired to say thanks all over again. I do not know the things that I would've handled without those points shared by you on my subject matter. This has been a very alarming situation in my view, however , coming across a new specialized technique you solved the issue took me to cry with delight. I am grateful for your advice as well as sincerely hope you really know what an amazing job you have been accomplishing training the rest through your webblog. I know that you haven't encountered any of us.

I and also my buddies appeared to be examining the excellent techniques found on your website and then unexpectedly I got a horrible suspicion I never expressed respect to the website owner for those strategies. My ladies had been for this reason very interested to read through all of them and now have unquestionably been having fun with these things. Appreciation for really being simply kind and also for selecting variety of nice information most people are really needing to discover. Our own honest regret for not expressing gratitude to sooner.

A lot of thanks for all of your hard work on this site. Ellie delights in working on research and it's easy to understand why. A lot of people notice all relating to the compelling means you give insightful information by means of this web site and cause response from visitors on this area plus our own girl is without question being taught a lot. Have fun with the remaining portion of the year. You're the one carrying out a remarkable job.

I truly wanted to construct a small note so as to thank you for all the amazing advice you are posting on this site. My long internet search has at the end of the day been honored with professional content to go over with my best friends. I would assert that most of us site visitors are truly endowed to dwell in a decent network with so many lovely individuals with insightful solutions. I feel quite grateful to have come across your website page and look forward to really more brilliant times reading here. Thanks a lot again for all the details.

I actually wanted to construct a simple note in order to express gratitude to you for all of the awesome points you are placing here. My extensive internet investigation has at the end been rewarded with pleasant strategies to exchange with my co-workers. I 'd suppose that many of us visitors actually are undeniably fortunate to be in a wonderful website with so many perfect people with helpful basics. I feel extremely fortunate to have come across the website page and look forward to tons of more excellent moments reading here. Thanks once again for everything.

Thanks for all your effort on this site. Kate delights in setting aside time for investigations and it is simple to grasp why. My partner and i know all regarding the powerful way you deliver worthwhile information through this blog and as well strongly encourage contribution from people on the subject matter plus our favorite girl is certainly starting to learn a lot. Take advantage of the rest of the year. You are carrying out a splendid job.

My spouse and i ended up being so comfortable Raymond managed to finish up his analysis with the ideas he got when using the web pages. It's not at all simplistic just to always be making a gift of solutions which often the others might have been selling. And we all fully understand we have the website owner to appreciate for that. The entire illustrations you made, the simple website menu, the friendships you can assist to create - it's got everything exceptional, and it's really helping our son in addition to us feel that that issue is pleasurable, which is rather fundamental. Many thanks for everything!

I as well as my guys were found to be checking out the great tricks located on your web site and then came up with an awful feeling I never expressed respect to the site owner for those tips. My men were certainly thrilled to read through all of them and have in effect sincerely been tapping into them. Thanks for indeed being very accommodating as well as for picking out this kind of decent things millions of individuals are really needing to discover. My very own honest apologies for not saying thanks to you earlier.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.