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

439 Comments

I intended to create you the little note just to say thank you as before about the stunning tips you've documented on this page. This is certainly generous with you to provide extensively precisely what most of us could possibly have marketed for an e book to get some profit for themselves, mostly since you could possibly have done it in case you considered necessary. The good ideas additionally acted to be a great way to fully grasp that most people have the identical eagerness the same as mine to understand a good deal more on the subject of this problem. I'm certain there are millions of more pleasant times ahead for many who start reading your blog post.

I precisely wanted to thank you so much again. I'm not certain the things that I could possibly have taken care of in the absence of these tactics discussed by you about my area of interest. Completely was an absolute distressing difficulty in my position, however , viewing a specialized form you treated it took me to weep with delight. Extremely happier for this advice as well as have high hopes you comprehend what a great job you have been doing educating the others by way of your webblog. I know that you've never encountered all of us.

I would like to point out my admiration for your kindness supporting individuals who should have help with this study. Your special dedication to passing the message around was exceedingly powerful and has consistently allowed girls like me to attain their goals. The informative guide means a great deal to me and further more to my mates. Thanks a lot; from all of us.

A lot of thanks for your entire hard work on this web site. Ellie really loves participating in research and it's really simple to grasp why. My partner and i learn all about the lively medium you convey practical thoughts by means of your web site and in addition increase participation from other individuals about this concern so my simple princess is actually being taught a great deal. Have fun with the rest of the new year. You're doing a tremendous job.

I must express some thanks to this writer just for bailing me out of this particular difficulty. Because of browsing throughout the online world and coming across methods which are not beneficial, I believed my life was gone. Being alive minus the answers to the difficulties you have solved as a result of your post is a critical case, as well as those which may have in a wrong way damaged my career if I hadn't encountered the website. Your actual expertise and kindness in handling every item was important. I am not sure what I would have done if I had not come upon such a point like this. I'm able to at this point relish my future. Thanks for your time so much for your specialized and sensible guide. I won't hesitate to propose your blog post to any individual who should receive support about this area.

I not to mention my guys have been checking the best guidelines on your web blog then the sudden I had a horrible suspicion I never expressed respect to the web site owner for those strategies. All of the people happened to be as a result stimulated to see all of them and have sincerely been having fun with those things. Thank you for actually being quite kind and for obtaining such useful ideas millions of individuals are really desperate to be informed on. My sincere apologies for not expressing appreciation to earlier.

I am writing to let you know of the helpful experience our princess had checking your site. She even learned a wide variety of issues, with the inclusion of what it's like to have an incredible coaching nature to make certain people without hassle thoroughly grasp specific complicated subject areas. You actually exceeded my expectations. Many thanks for producing such powerful, dependable, explanatory as well as unique thoughts on that topic to Ethel.

A lot of thanks for all your valuable hard work on this website. My mother delights in engaging in research and it's easy to understand why. My spouse and i learn all of the compelling ways you give both useful and interesting thoughts on this blog and therefore improve response from some other people about this topic while our own girl is without question becoming educated a lot. Have fun with the remaining portion of the year. Your carrying out a powerful job.

I am commenting to let you know of the incredible discovery my wife's girl gained reading through your web site. She came to understand lots of things, including what it is like to possess a great helping heart to have the mediocre ones without problems fully grasp specific extremely tough matters. You truly exceeded people's expected results. I appreciate you for coming up with such invaluable, healthy, educational and also unique tips on your topic to Gloria.

I together with my buddies were actually digesting the nice helpful tips from your site and before long developed an awful feeling I never thanked the web site owner for those tips. All of the boys ended up consequently glad to read all of them and have in effect without a doubt been enjoying those things. Thanks for genuinely indeed thoughtful and also for selecting this kind of quality subject areas most people are really eager to learn about. Our sincere regret for not expressing appreciation to you sooner.

I together with my buddies were found to be looking through the excellent key points from your web page and so before long developed a terrible feeling I had not expressed respect to the website owner for those secrets. My ladies are actually for this reason excited to see them and have in effect certainly been using these things. Thank you for indeed being so accommodating as well as for utilizing varieties of important ideas millions of individuals are really desperate to discover. Our own honest apologies for not expressing appreciation to sooner.

I simply desired to say thanks once more. I'm not certain what I might have worked on without the type of techniques contributed by you regarding that problem. It truly was a very intimidating problem in my opinion, however , encountering this expert technique you treated it forced me to cry over gladness. Now i am happy for the work and then expect you recognize what an amazing job you were putting in teaching most people using your web site. I am certain you've never got to know any of us.

I simply wished to appreciate you once again. I do not know what I could possibly have created in the absence of those thoughts shared by you over this subject. It previously was a very frightening scenario for me personally, but viewing the well-written manner you dealt with that took me to cry for joy. Extremely grateful for your help and in addition hope you really know what an amazing job you are always providing educating men and women all through a site. More than likely you haven't encountered any of us.

I have to point out my respect for your kindness supporting those individuals that really want help on this content. Your real dedication to getting the message up and down had been definitely beneficial and has truly encouraged those like me to attain their desired goals. Your entire informative recommendations means so much to me and somewhat more to my colleagues. Regards; from all of us.

I and also my buddies came digesting the best hints on your site then suddenly got a terrible suspicion I never thanked the website owner for them. All the men had been consequently joyful to see them and have in effect extremely been tapping into them. We appreciate you genuinely well accommodating as well as for selecting this kind of exceptional subject areas most people are really eager to learn about. My sincere apologies for not saying thanks to you earlier.

Thank you for all your labor on this web page. Kate take interest in going through investigation and it's obvious why. My partner and i hear all concerning the lively method you produce rewarding tactics through this blog and as well as recommend participation from other people on the area plus my simple princess is really learning a whole lot. Have fun with the remaining portion of the new year. You are always carrying out a dazzling job.

I not to mention my buddies appeared to be studying the excellent tricks from the blog then all of the sudden I had a horrible feeling I never thanked the web blog owner for those secrets. The ladies had been for that reason thrilled to see them and now have in actuality been having fun with these things. Appreciate your being well helpful and also for obtaining certain good areas millions of individuals are really eager to be informed on. My very own honest regret for not expressing gratitude to you earlier.

I wanted to write you one little bit of note in order to give thanks again for these splendid basics you have contributed in this article. It was quite shockingly open-handed with you to offer unreservedly just what a number of people might have made available for an electronic book to help make some money for themselves, most importantly given that you might well have tried it if you decided. These ideas additionally served to be the fantastic way to understand that some people have a similar eagerness just as my personal own to learn much more with respect to this condition. I believe there are numerous more pleasant periods in the future for those who go through your blog.

I needed to create you a very little remark to be able to thank you once again just for the nice methods you have provided in this case. This has been certainly strangely generous with people like you giving unreservedly all some people might have supplied for an e-book to make some profit on their own, mostly now that you could possibly have tried it in case you considered necessary. Those suggestions in addition worked to become fantastic way to know that many people have a similar fervor similar to my very own to realize many more on the subject of this matter. I'm sure there are many more fun instances ahead for individuals that examine your blog post.

I have to express appreciation to you for rescuing me from this particular situation. Just after searching through the the web and getting ideas that were not beneficial, I assumed my entire life was over. Being alive without the presence of approaches to the problems you've solved by way of the post is a serious case, and those that might have badly affected my career if I hadn't noticed your website. Your personal mastery and kindness in taking care of all the pieces was invaluable. I am not sure what I would've done if I hadn't encountered such a solution like this. I'm able to at this time look ahead to my future. Thanks a lot so much for this professional and amazing help. I will not hesitate to propose the website to anyone who will need tips about this subject.

Thanks for your own labor on this blog. My niece take interest in engaging in internet research and it's really obvious why. Most people hear all regarding the dynamic tactic you give very useful strategies through this website and as well attract response from other individuals on this topic so our favorite child is always discovering a lot. Have fun with the remaining portion of the new year. You are always carrying out a first class job.

I must show my passion for your kindness giving support to folks who actually need help with in this niche. Your very own commitment to passing the message up and down had been particularly valuable and have without exception permitted guys and women much like me to achieve their endeavors. Your interesting advice indicates a great deal to me and especially to my office workers. Thanks a ton; from everyone of us.

I am just writing to make you understand what a nice discovery our child developed viewing the blog. She figured out too many details, with the inclusion of what it's like to possess a wonderful teaching mood to let many others completely have an understanding of some grueling topics. You truly exceeded our desires. Thanks for producing these beneficial, dependable, educational and even unique tips about this topic to Ethel.

ich habe alles installiert und compeliert. Auf den D1_mini übertragen und dann tat sich nichts mehr . im Wifi-Netz wird kein Modul angezeigt. Mit dem Ergebniss kann ich nicht arbeiten. Fertige Bin-Files, die ich testen kann finde ich brauchbarer. Bin entteucht.

I wish to express my respect for your generosity supporting individuals that really need assistance with in this issue. Your personal dedication to getting the message all around had become surprisingly useful and has usually permitted regular people much like me to reach their endeavors. The interesting help and advice denotes a lot to me and extremely more to my colleagues. Thanks a lot; from everyone of us.

Thank you for your entire effort on this blog. My niece enjoys working on internet research and it's obvious why. Most of us learn all about the dynamic tactic you deliver valuable tricks through the website and as well attract contribution from some others on the topic then my girl is truly discovering so much. Have fun with the remaining portion of the year. You are always conducting a superb job.

I wanted to put you this very small note just to give thanks the moment again on your pleasant knowledge you've documented at this time. It was really tremendously generous of you to present without restraint just what numerous people could have supplied for an ebook to earn some dough on their own, even more so given that you might have done it if you desired. The advice likewise served to become a fantastic way to know that most people have the same fervor similar to my personal own to realize way more in terms of this matter. I think there are numerous more pleasurable situations ahead for many who discover your blog.

I'm just writing to make you be aware of of the fabulous experience our child undergone studying your site. She realized numerous pieces, with the inclusion of what it's like to possess a great helping nature to make other individuals very easily thoroughly grasp certain problematic issues. You really surpassed visitors' expected results. Many thanks for displaying these beneficial, dependable, informative and also fun thoughts on that topic to Ethel.

I not to mention my friends have already been reviewing the good items located on your web site while quickly I got an awful feeling I had not expressed respect to the website owner for those secrets. All the young boys had been absolutely joyful to study them and have in effect sincerely been using those things. Appreciate your being simply thoughtful as well as for obtaining such great subject matter most people are really needing to know about. My personal honest apologies for not expressing gratitude to you sooner.

A lot of thanks for each of your labor on this web site. Kate enjoys going through internet research and it is simple to grasp why. Almost all know all regarding the dynamic ways you create sensible solutions on the web site and boost contribution from some other people on the area so our own girl is becoming educated a great deal. Enjoy the remaining portion of the new year. Your conducting a brilliant job.

Thanks a lot for providing individuals with an extremely memorable possiblity to read in detail from this website. It really is very kind and also full of a good time for me personally and my office co-workers to visit your website on the least three times in a week to read the latest items you have. And indeed, we're certainly fulfilled with the magnificent hints you serve. Some 1 areas in this article are without a doubt the finest I have ever had.

I precisely needed to appreciate you all over again. I'm not certain the things I would have done in the absence of those pointers discussed by you on my concern. It actually was a real distressing issue in my circumstances, however , finding out the specialized manner you managed the issue forced me to cry over happiness. Extremely thankful for the information and then believe you really know what a powerful job you're getting into instructing the mediocre ones through your site. I am certain you have never met all of us.

I precisely needed to thank you so much yet again. I am not sure the things that I might have worked on without the type of techniques discussed by you about that concern. Completely was a real horrifying problem in my position, nevertheless looking at a new specialised form you resolved it took me to weep for gladness. I will be happier for the information as well as hope you know what an amazing job your are accomplishing teaching the rest all through your blog post. Probably you haven't encountered any of us.

I must express some appreciation to you for rescuing me from this type of circumstance. Right after scouting throughout the online world and finding methods which are not powerful, I assumed my entire life was done. Being alive without the presence of strategies to the issues you have sorted out by means of your good posting is a critical case, and the ones which could have in a negative way affected my entire career if I had not encountered your website. That mastery and kindness in playing with all the things was vital. I'm not sure what I would've done if I hadn't come across such a subject like this. I can now look forward to my future. Thanks for your time very much for the skilled and results-oriented guide. I won't hesitate to endorse the sites to anybody who would like guidelines about this matter.

I have to express some appreciation to the writer just for rescuing me from this circumstance. Right after browsing through the the net and meeting concepts that were not powerful, I was thinking my life was well over. Living without the answers to the problems you have solved by means of your good article is a crucial case, and the kind which could have in a wrong way affected my career if I had not noticed your website. The talents and kindness in maneuvering all the stuff was very helpful. I'm not sure what I would have done if I had not come upon such a solution like this. It's possible to at this time look ahead to my future. Thank you very much for your high quality and sensible help. I will not be reluctant to refer your site to anybody who needs and wants care about this subject matter.

My husband and i got really contented that Jordan could round up his reports with the ideas he gained through your blog. It is now and again perplexing to just always be giving for free tactics that some others have been selling. And now we take into account we now have the blog owner to be grateful to for that. The specific explanations you've made, the easy site menu, the relationships you aid to promote - it's many overwhelming, and it is assisting our son and the family recognize that the matter is enjoyable, which is extraordinarily essential. Thanks for all the pieces!

I wanted to send you one bit of note so as to give thanks the moment again regarding the pleasing secrets you've shown here. It has been particularly open-handed of you to convey without restraint precisely what many of us could have marketed as an e-book to help make some bucks on their own, and in particular since you could possibly have done it if you ever desired. These tips also served like the good way to realize that the rest have a similar dreams similar to mine to realize more on the subject of this problem. I believe there are lots of more pleasant times in the future for many who find out your website.

Thank you for your whole hard work on this site. Debby really likes getting into internet research and it's really easy to see why. My spouse and i hear all regarding the compelling method you present practical suggestions through your web blog and in addition strongly encourage participation from some others on the concept so our girl is actually discovering a lot. Take advantage of the rest of the year. You have been doing a fabulous job.

My spouse and i felt joyful when Albert managed to finish up his analysis from the ideas he gained through your blog. It's not at all simplistic just to be releasing techniques which usually many others could have been making money from. And we discover we now have the website owner to appreciate because of that. Most of the explanations you have made, the easy web site menu, the relationships you will aid to engender - it's all astonishing, and it's assisting our son in addition to our family recognize that this subject is interesting, and that's rather indispensable. Many thanks for the whole thing!

My spouse and i have been quite cheerful that Emmanuel managed to round up his preliminary research from your precious recommendations he had from your own blog. It's not at all simplistic just to happen to be making a gift of concepts which men and women have been selling. And we all understand we now have you to give thanks to because of that. Those illustrations you made, the easy site navigation, the relationships you will aid to create - it's got most remarkable, and it's really leading our son in addition to the family imagine that the content is excellent, and that is truly important. Many thanks for all!

I must show some appreciation to you for rescuing me from this type of incident. After looking out through the the net and seeing suggestions which were not helpful, I believed my life was over. Existing without the solutions to the problems you have resolved by way of your website is a serious case, as well as ones that would have badly damaged my career if I had not discovered the blog. That understanding and kindness in maneuvering all the details was precious. I'm not sure what I would've done if I had not discovered such a point like this. It's possible to now look forward to my future. Thanks a lot so much for the high quality and result oriented guide. I won't hesitate to endorse your site to anyone who needs and wants direction on this subject.

My husband and i ended up being now glad when Raymond managed to carry out his inquiry out of the ideas he was given while using the web site. It's not at all simplistic just to always be making a gift of tips and hints the others could have been trying to sell. And we all fully understand we now have the blog owner to appreciate for this. The illustrations you have made, the simple website navigation, the relationships you make it easier to create - it's everything astonishing, and it's aiding our son and our family feel that that concept is pleasurable, and that's exceptionally vital. Thanks for all!

I would like to voice my passion for your generosity supporting individuals that require help on this area. Your real commitment to getting the solution up and down was astonishingly good and has truly helped women just like me to get to their targets. Your own insightful guideline means so much a person like me and even further to my office workers. Best wishes; from everyone of us.

Thank you for all your valuable labor on this website. My mum take interest in doing investigation and it is simple to grasp why. A number of us learn all concerning the lively form you give vital guidance by means of your website and in addition strongly encourage participation from other individuals on this issue and my child is in fact starting to learn a whole lot. Take advantage of the remaining portion of the year. Your doing a splendid job.

Thank you so much for providing individuals with an exceptionally brilliant opportunity to check tips from this blog. It is usually so great and stuffed with amusement for me personally and my office co-workers to visit your blog minimum 3 times weekly to read the fresh guides you have. Of course, I'm actually fascinated with your unbelievable creative concepts you serve. Selected two points in this post are honestly the most beneficial I have ever had.

I precisely wanted to thank you so much yet again. I'm not certain the things I would've gone through without those information shared by you over my topic. It had been a frustrating case for me, but being able to see a new specialised mode you resolved it made me to cry with happiness. I will be grateful for your assistance and expect you recognize what a great job you were undertaking training some other people using your webpage. Probably you've never got to know any of us.

I wanted to type a quick note to thank you for the magnificent suggestions you are showing here. My extended internet lookup has at the end been recognized with useful points to go over with my great friends. I 'd suppose that most of us site visitors actually are really blessed to live in a notable community with so many brilliant people with good opinions. I feel very much blessed to have come across your entire website and look forward to so many more entertaining times reading here. Thanks once more for a lot of things.

I enjoy you because of all of your hard work on this web page. My mother loves working on research and it is obvious why. Almost all hear all regarding the lively tactic you give both useful and interesting tricks through your web site and foster response from people about this article plus our simple princess is becoming educated a lot. Enjoy the rest of the new year. You're carrying out a fantastic job.

My husband and i got quite contented when Peter managed to do his preliminary research using the precious recommendations he obtained using your site. It is now and again perplexing just to choose to be giving away ideas which often people today could have been selling. Therefore we discover we've got the website owner to appreciate for this. All the explanations you made, the easy site menu, the friendships you can give support to create - it is everything remarkable, and it's assisting our son and our family recognize that the content is thrilling, and that is especially mandatory. Thank you for everything!

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.