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

When I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I receive 4 emails with the exact same comment. There has to be a way you are able to remove me from that service? Thank you!|

I and also my buddies appeared to be following the excellent tips located on your web blog and then the sudden got a horrible feeling I had not thanked the web blog owner for them. Those boys became absolutely excited to read them and have seriously been enjoying those things. Many thanks for really being well thoughtful and then for opting for this sort of important areas most people are really wanting to be aware of. Our own honest apologies for not expressing gratitude to sooner.

Thank you so much for providing individuals with an extraordinarily nice possiblity to read critical reviews from this blog. It is always so lovely and also full of fun for me and my office colleagues to visit the blog at least 3 times in a week to read through the latest stuff you have got. And indeed, I am always fascinated with the magnificent opinions served by you. Some 2 points in this posting are basically the most suitable we have had.

I just wanted to write a brief note so as to express gratitude to you for these stunning items you are showing at this site. My time-consuming internet lookup has at the end been rewarded with reasonable ideas to talk about with my company. I would believe that most of us site visitors are rather endowed to live in a remarkable website with very many wonderful people with very beneficial guidelines. I feel pretty happy to have encountered the webpages and look forward to really more brilliant minutes reading here. Thanks a lot again for all the details.

I must show appreciation to this writer for rescuing me from such a crisis. As a result of looking out throughout the search engines and finding principles which were not powerful, I assumed my life was well over. Being alive devoid of the approaches to the issues you've sorted out all through this write-up is a critical case, as well as ones which could have badly damaged my career if I had not come across the blog. Your primary talents and kindness in dealing with a lot of stuff was precious. I don't know what I would've done if I hadn't encountered such a point like this. I can now relish my future. Thanks for your time so much for your specialized and amazing guide. I won't think twice to refer your site to any person who ought to have recommendations on this situation.

Thank you for your whole hard work on this blog. Debby really loves conducting investigation and it is simple to grasp why. My spouse and i hear all relating to the dynamic way you deliver informative suggestions via your blog and attract response from the others on this subject matter plus my simple princess is always learning so much. Take advantage of the rest of the year. You're performing a superb job.

I together with my friends appeared to be analyzing the best thoughts found on your web blog and so quickly developed a horrible feeling I never thanked the blog owner for those strategies. All of the men appeared to be absolutely happy to read them and have in actuality been loving them. Appreciation for getting very helpful as well as for going for these kinds of fabulous themes millions of individuals are really desirous to know about. My honest regret for not saying thanks to you sooner.

I precisely needed to appreciate you all over again. I am not sure the things that I would've handled without the type of aspects discussed by you over such field. Completely was a frightening scenario in my circumstances, but observing the very expert avenue you treated that made me to cry for happiness. I will be grateful for the assistance and thus hope that you comprehend what a powerful job you have been getting into teaching men and women through the use of your blog. Most probably you have never met all of us.

Thank you so much for giving everyone remarkably brilliant opportunity to read articles and blog posts from here. It's usually so terrific and as well , jam-packed with a good time for me personally and my office colleagues to search the blog particularly thrice a week to read the fresh guidance you will have. Not to mention, I am just always amazed with your exceptional solutions served by you. Some 4 areas in this posting are absolutely the simplest I have ever had.

I and my guys were viewing the nice thoughts on your website while all of a sudden developed a horrible feeling I had not expressed respect to you for those techniques. Most of the young men were certainly glad to read through them and have in effect extremely been taking advantage of these things. I appreciate you for truly being so thoughtful and for using this sort of good subject areas most people are really wanting to understand about. My honest apologies for not expressing gratitude to you sooner.

I precisely needed to appreciate you all over again. I do not know what I might have achieved without the type of hints contributed by you regarding my concern. Certainly was a very fearsome concern in my opinion, nevertheless discovering a well-written fashion you processed the issue made me to weep with delight. Now i'm grateful for the assistance and as well , believe you realize what an amazing job you're undertaking instructing others via your web site. More than likely you haven't come across any of us.

I am only writing to let you be aware of what a cool encounter my cousin's princess went through browsing your web site. She picked up several details, which include what it's like to possess a wonderful coaching spirit to have the rest clearly completely grasp a number of complicated issues. You actually did more than our own desires. Thank you for displaying those warm and helpful, dependable, edifying and also easy tips on this topic to Mary.

I wanted to put you a tiny observation in order to thank you the moment again for all the precious information you've shown above. It has been certainly tremendously open-handed with you in giving unhampered just what a lot of folks would have marketed as an e-book to earn some profit on their own, precisely now that you might well have tried it if you desired. The techniques in addition acted to be a easy way to be sure that most people have a similar dream just like mine to see whole lot more related to this issue. I'm certain there are millions of more pleasurable sessions up front for individuals who scan your blog.

I simply desired to say thanks once more. I'm not certain the things I might have carried out without the entire methods documented by you concerning this field. This has been an absolute frightening crisis in my position, but taking note of this specialised mode you treated it made me to cry with delight. Extremely thankful for this information and thus hope you find out what a great job that you are doing instructing the rest through the use of your site. Probably you haven't got to know all of us.

I happen to be writing to make you be aware of what a really good discovery my friend's princess went through checking yuor web blog. She came to understand so many pieces, most notably what it's like to possess a wonderful teaching mood to get folks with ease know specific hard to do things. You really exceeded my expected results. Thank you for supplying these important, safe, revealing and even fun thoughts on the topic to Emily.

I must convey my admiration for your kindness in support of folks who must have guidance on that field. Your real commitment to getting the message all around turned out to be certainly useful and have without exception enabled guys and women just like me to get to their ambitions. This important guidelines means much a person like me and much more to my fellow workers. Thanks a ton; from each one of us.

I really wanted to construct a remark to appreciate you for all the remarkable tips and tricks you are writing here. My considerable internet lookup has at the end of the day been recognized with excellent strategies to share with my friends and classmates. I 'd assert that many of us visitors actually are truly blessed to be in a really good site with very many outstanding individuals with good ideas. I feel pretty happy to have seen the web pages and look forward to really more amazing times reading here. Thanks again for a lot of things.

My spouse and i were quite delighted when John managed to carry out his studies from the precious recommendations he was given while using the blog. It's not at all simplistic to just possibly be freely giving secrets that many others have been making money from. Therefore we understand we have got the writer to thank because of that. Those explanations you have made, the straightforward web site navigation, the friendships you will assist to foster - it's mostly astounding, and it is leading our son in addition to our family know that this idea is amusing, and that is especially vital. Thank you for everything!

I want to express my love for your kindness supporting those people that really want help with the topic. Your special commitment to getting the message up and down appears to be pretty useful and has constantly encouraged folks like me to get to their goals. Your personal useful instruction implies a whole lot a person like me and much more to my peers. Many thanks; from everyone of us.

My husband and i were very glad when Ervin managed to carry out his research by way of the precious recommendations he gained using your site. It's not at all simplistic to simply find yourself handing out hints that many some people may have been making money from. And we all do know we've got the blog owner to thank for that. The explanations you made, the easy web site navigation, the friendships you assist to foster - it's all astounding, and it's really helping our son and the family consider that the issue is thrilling, and that is very important. Thank you for all the pieces!

I am commenting to let you understand of the outstanding encounter my daughter found visiting your web site. She mastered too many issues, with the inclusion of how it is like to possess a very effective teaching nature to make many more very easily completely grasp various complex issues. You undoubtedly did more than our own expected results. Many thanks for displaying the essential, trusted, educational and even unique tips on the topic to Julie.

I simply needed to appreciate you again. I am not sure the things that I could possibly have used without the creative ideas revealed by you over such a concern. It actually was a troublesome scenario in my view, however , looking at a new specialized style you processed it made me to weep over joy. I will be happier for this help and in addition hope you realize what an amazing job you are always doing educating others through your blog. Probably you've never met all of us.

Thank you a lot for giving everyone a very splendid opportunity to read from this blog. It's always so good plus stuffed with a lot of fun for me personally and my office fellow workers to search the blog at minimum three times in a week to read the latest guidance you have got. Of course, I'm just at all times pleased considering the awesome creative concepts you serve. Some 4 points on this page are in reality the most effective we have had.

I and also my pals were reviewing the nice advice located on the website and so suddenly developed an awful feeling I never thanked the web blog owner for those strategies. These ladies had been absolutely joyful to read all of them and have now surely been tapping into them. Appreciation for getting so accommodating as well as for settling on certain notable subject matter millions of individuals are really wanting to know about. My very own sincere apologies for not expressing appreciation to you earlier.

I am just writing to let you be aware of of the fabulous experience my princess gained viewing your web site. She even learned too many things, which include what it is like to possess a great helping nature to have folks completely master specified advanced topics. You actually exceeded readers' expectations. Many thanks for rendering the warm and friendly, healthy, edifying and also unique tips about that topic to Jane.

I must express my thanks to the writer just for rescuing me from such a trouble. After searching through the search engines and finding tips which are not productive, I figured my entire life was gone. Existing devoid of the solutions to the issues you've fixed through your main article is a serious case, and ones that could have in a wrong way damaged my career if I had not come across your website. Your natural talent and kindness in handling all the pieces was invaluable. I don't know what I would have done if I hadn't come across such a step like this. I can also now look forward to my future. Thanks so much for your specialized and results-oriented help. I will not be reluctant to endorse your web site to anybody who would like guidelines about this problem.

I must express my thanks to the writer for rescuing me from this problem. Because of surfing around throughout the search engines and obtaining ways which are not helpful, I believed my life was done. Being alive without the presence of answers to the problems you've resolved through your post is a serious case, as well as the kind that might have in a negative way damaged my career if I had not encountered the website. That ability and kindness in maneuvering all things was vital. I am not sure what I would have done if I had not come upon such a thing like this. I can also now relish my future. Thanks a lot so much for your expert and effective help. I will not hesitate to endorse your blog post to anybody who needs and wants guidelines about this subject.

I and also my guys were going through the great secrets on your site and so suddenly came up with a horrible feeling I never thanked the web blog owner for those tips. The young boys were as a consequence thrilled to read through them and have in effect clearly been loving these things. Appreciation for turning out to be quite kind and also for considering certain great ideas most people are really needing to know about. My honest apologies for not expressing gratitude to earlier.

I actually wanted to develop a brief word so as to say thanks to you for some of the remarkable tactics you are writing on this website. My considerable internet investigation has at the end of the day been honored with sensible facts and strategies to exchange with my good friends. I would mention that many of us website visitors actually are really fortunate to dwell in a perfect community with very many lovely people with valuable tips and hints. I feel truly lucky to have used your website and look forward to really more entertaining times reading here. Thank you once again for everything.

I simply wanted to develop a simple remark so as to appreciate you for some of the precious ways you are giving out on this site. My considerable internet search has at the end been recognized with brilliant tips to exchange with my classmates and friends. I 'd assume that most of us visitors are extremely blessed to dwell in a fantastic site with very many brilliant people with great pointers. I feel extremely lucky to have used your web site and look forward to some more cool times reading here. Thanks again for everything.

I as well as my friends were found to be studying the excellent items from your web blog while all of the sudden developed an awful feeling I never expressed respect to you for those secrets. Most of the women are already for this reason excited to learn them and already have honestly been taking pleasure in those things. Thanks for genuinely very considerate and for having variety of fine tips millions of individuals are really desperate to be informed on. Our own sincere regret for not expressing appreciation to you earlier.

I wish to express my appreciation to this writer just for rescuing me from this challenge. Just after browsing through the search engines and getting opinions which are not pleasant, I figured my entire life was done. Living without the strategies to the issues you have fixed by way of your entire report is a serious case, as well as ones which could have negatively affected my entire career if I had not discovered your blog post. Your personal natural talent and kindness in handling a lot of stuff was helpful. I don't know what I would've done if I had not come across such a step like this. I can also now look forward to my future. Thank you so much for the reliable and results-oriented guide. I won't be reluctant to refer your web blog to anyone who needs to have counselling on this topic.

I wish to get across my affection for your generosity supporting folks that really need assistance with your issue. Your personal dedication to getting the message around came to be surprisingly productive and have surely made workers much like me to realize their pursuits. Your own helpful tutorial implies so much to me and much more to my office workers. Thanks a ton; from all of us.

Thank you for all your valuable labor on this web page. Ellie take interest in doing research and it is easy to see why. Most of us learn all regarding the lively mode you offer valuable tactics on your website and in addition recommend participation from visitors about this content plus our favorite simple princess is without a doubt being taught a great deal. Have fun with the remaining portion of the year. You're doing a stunning job.

Needed to send you the very small word to be able to thank you very much once again for these marvelous solutions you have discussed above. It is quite generous with people like you to grant without restraint precisely what a few people might have advertised as an e book to generate some dough for themselves, mostly considering the fact that you could have tried it if you decided. The basics likewise acted to provide a great way to realize that the rest have the identical desire the same as my own to understand good deal more concerning this problem. I believe there are several more pleasurable situations up front for folks who look over your blog.

I simply wanted to appreciate you yet again. I do not know the things that I would have handled in the absence of the aspects provided by you regarding such a subject matter. It was actually a real distressing situation in my position, but considering a specialized form you managed that forced me to weep with joy. I am thankful for this information and as well , wish you are aware of a powerful job you are always providing instructing most people via your web blog. I am certain you've never come across all of us.

I wish to voice my appreciation for your kind-heartedness in support of visitors who absolutely need help on your study. Your special commitment to passing the solution around ended up being remarkably valuable and have truly made most people much like me to attain their pursuits. Your personal invaluable hints and tips indicates a whole lot to me and extremely more to my mates. Many thanks; from everyone of us.

Thanks for all of the labor on this web site. Betty really likes making time for internet research and it's really obvious why. My spouse and i notice all about the compelling tactic you convey very important information through your web site and as well inspire participation from website visitors on the article so our own daughter is truly starting to learn a lot of things. Have fun with the rest of the year. You have been doing a splendid job.

I needed to put you a tiny observation to be able to say thank you yet again on the splendid tips you have shared above. This is quite extremely generous of people like you to supply easily just what a lot of people would've supplied as an electronic book in order to make some cash for themselves, precisely given that you could possibly have done it if you ever considered necessary. Those creative ideas additionally served like a good way to fully grasp other people have a similar passion like my personal own to see a whole lot more regarding this condition. I believe there are some more pleasant situations ahead for folks who looked over your site.

I am commenting to make you know what a really good encounter our princess developed visiting your site. She noticed several pieces, most notably what it's like to have a great giving spirit to get certain people with no trouble understand selected specialized topics. You actually did more than visitors' expectations. Thanks for delivering these useful, trustworthy, informative and easy tips on that topic to Evelyn.

I as well as my pals happened to be digesting the great items from your site then then I got an awful suspicion I had not thanked the blog owner for those techniques. All the young men became for this reason joyful to read all of them and have surely been making the most of them. Appreciate your truly being well helpful as well as for using these kinds of incredible subject matter millions of individuals are really wanting to know about. My sincere apologies for not saying thanks to you earlier.

I precisely desired to appreciate you once more. I do not know the things I might have handled in the absence of the entire tips provided by you concerning such theme. Previously it was an absolute distressing concern in my view, nevertheless discovering the very expert manner you handled it made me to jump for joy. I am happy for your information as well as have high hopes you find out what a powerful job you were undertaking training many people through the use of your web site. I know that you've never encountered all of us.

Thanks for all your work on this web site. Kim loves engaging in investigations and it is obvious why. A lot of people know all relating to the powerful manner you make worthwhile techniques by means of this web blog and even strongly encourage response from other individuals on that content while my simple princess is always studying a lot. Take advantage of the remaining portion of the year. You have been conducting a wonderful job.

Thank you a lot for giving everyone such a marvellous possiblity to discover important secrets from this site. It can be very beneficial and also full of a great time for me and my office mates to search your site nearly 3 times in 7 days to study the new stuff you have got. And of course, we're actually fascinated with the magnificent information served by you. Certain 1 tips in this post are really the very best we have all had.

I not to mention my buddies came following the excellent tricks from the blog and then I had a terrible suspicion I never expressed respect to the website owner for them. Most of the women came glad to study them and have in effect in reality been taking advantage of those things. We appreciate you actually being very considerate and then for selecting such fantastic tips most people are really needing to know about. My personal sincere apologies for not expressing gratitude to earlier.

Thanks a lot for providing individuals with remarkably nice chance to read in detail from this web site. It's always very fantastic and full of fun for me and my office co-workers to visit your website not less than thrice every week to learn the fresh secrets you have. Not to mention, I am actually amazed concerning the good points you serve. Selected 2 tips in this posting are certainly the most beneficial we have ever had.

I simply desired to thank you very much again. I do not know the things that I would have made to happen without these secrets documented by you over such concern. Completely was an absolute scary concern in my circumstances, nevertheless noticing the well-written fashion you solved that forced me to cry for happiness. Now i'm grateful for your service and in addition hope you are aware of a great job you are putting in instructing some other people thru your web page. Probably you have never met all of us.

I wish to point out my passion for your kindness supporting those individuals that really want guidance on this situation. Your personal dedication to getting the solution throughout had become surprisingly interesting and has usually allowed associates like me to attain their aims. Your warm and helpful help and advice means much a person like me and somewhat more to my peers. Thanks a ton; from each one of us.

Thank you so much for giving everyone a very spectacular chance to read articles and blog posts from here. It is usually so fantastic and as well , packed with a lot of fun for me personally and my office peers to visit your site particularly thrice weekly to read through the new guides you have got. And definitely, I'm so certainly satisfied with the surprising creative concepts served by you. Selected 2 points in this post are particularly the most effective I have had.

I want to point out my love for your kindness in support of folks that really want guidance on in this niche. Your very own dedication to getting the message all over had been quite practical and have continually helped many people just like me to get to their goals. Your personal invaluable help and advice indicates a whole lot a person like me and somewhat more to my colleagues. With thanks; from everyone of us.

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.