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

702 Comments

My spouse and i ended up being really peaceful when Raymond managed to deal with his homework through the entire ideas he had from your own blog. It is now and again perplexing just to possibly be releasing hints which the rest have been selling. And we also realize we have the writer to be grateful to for this. The specific explanations you made, the easy blog menu, the relationships you help to promote - it's most fantastic, and it's leading our son and our family imagine that that content is awesome, and that is quite pressing. Thank you for all!

I actually wanted to type a note so as to express gratitude to you for all of the fabulous guidelines you are writing here. My rather long internet search has at the end been honored with good quality strategies to write about with my company. I 'd express that most of us website visitors are unequivocally fortunate to exist in a remarkable community with so many awesome people with beneficial hints. I feel somewhat fortunate to have encountered your website page and look forward to tons of more exciting moments reading here. Thanks a lot once again for everything.

I in addition to my guys ended up going through the good helpful hints from your web site then quickly developed a terrible feeling I never thanked the blog owner for those strategies. Most of the young men are actually as a consequence very interested to read through all of them and have in actuality been taking pleasure in those things. I appreciate you for turning out to be simply kind and for figuring out such magnificent useful guides millions of individuals are really eager to be aware of. My sincere regret for not expressing gratitude to you earlier.

I needed to put you one little bit of note so as to say thank you yet again for those breathtaking opinions you've shown in this article. It was extremely open-handed of you giving easily just what a lot of people could have made available as an e book to end up making some bucks for themselves, primarily seeing that you could have tried it if you considered necessary. These techniques in addition served to be a fantastic way to comprehend most people have the identical dreams really like my personal own to figure out more and more around this matter. I know there are numerous more enjoyable situations up front for many who take a look at your site.

A lot of thanks for all of your hard work on this site. Gloria take interest in managing research and it is easy to understand why. I learn all about the powerful tactic you create sensible tricks via your web blog and therefore boost contribution from website visitors on that matter then our own simple princess is actually studying a lot. Enjoy the remaining portion of the year. You're the one doing a glorious job.

Thank you so much for giving everyone an extraordinarily spectacular possiblity to read articles and blog posts from this blog. It really is very beneficial and as well , stuffed with a great time for me and my office acquaintances to visit the blog the equivalent of thrice every week to read the new tips you have got. And of course, we are at all times satisfied for the sensational guidelines you serve. Certain 2 points in this article are without a doubt the very best we have all ever had.

I truly wanted to send a small note in order to thank you for all the remarkable ways you are writing at this website. My incredibly long internet investigation has at the end of the day been honored with really good facts and strategies to write about with my visitors. I 'd assume that we site visitors are very much fortunate to live in a remarkable place with very many perfect professionals with very beneficial tricks. I feel really fortunate to have discovered your entire web page and look forward to so many more fabulous minutes reading here. Thanks a lot again for a lot of things.

Thanks a lot for giving everyone remarkably spectacular chance to read critical reviews from this blog. It is usually very awesome plus jam-packed with amusement for me and my office peers to visit your site more than three times a week to read the new tips you have got. Of course, I'm also always contented with the superb tricks you serve. Selected 3 facts in this article are in reality the most beneficial we have had.

I have to get across my admiration for your kindness supporting those people who really want help on your subject matter. Your real dedication to getting the message along turned out to be quite advantageous and has consistently empowered employees just like me to arrive at their targets. This invaluable tips and hints implies a whole lot a person like me and much more to my office colleagues. Many thanks; from all of us.

Thanks for the wonderful posting! I actually relished reading through it, you're a wonderful author. I will make sure to bookmark your website and can often come back eventually. I choose to inspire a single to continue your terrific work, Possess a awesome night! sasilu.se/map39.php lock f?¶r ?¶rat yrsel

I actually wanted to make a message so as to say thanks to you for these great instructions you are placing at this site. My time consuming internet lookup has at the end been rewarded with excellent know-how to write about with my friends and family. I 'd declare that many of us readers are undoubtedly lucky to be in a fine network with many perfect individuals with useful pointers. I feel extremely lucky to have discovered the weblog and look forward to some more awesome times reading here. Thanks once more for everything.

I must show some appreciation to the writer just for rescuing me from such a crisis. As a result of scouting through the world-wide-web and meeting ideas that were not beneficial, I assumed my life was well over. Living minus the answers to the issues you've resolved all through your main website is a critical case, as well as ones which could have in a wrong way affected my career if I hadn't discovered your website. Your primary expertise and kindness in maneuvering all the things was useful. I don't know what I would have done if I hadn't discovered such a solution like this. I can at this time relish my future. Thanks a lot so much for this professional and sensible help. I will not hesitate to suggest the website to anyone who requires recommendations about this issue.

Thank you a lot for providing individuals with an exceptionally spectacular opportunity to discover important secrets from this website. It can be so nice plus stuffed with a great time for me personally and my office peers to search your website more than 3 times per week to study the newest issues you have. And indeed, we are at all times contented with your eye-popping points served by you. Some 3 areas in this posting are definitely the most impressive I have ever had.

I have to express thanks to you just for rescuing me from such a dilemma. Just after checking through the internet and seeing principles which are not helpful, I assumed my life was gone. Existing without the solutions to the difficulties you've solved by way of this article content is a crucial case, and those that might have in a wrong way affected my entire career if I had not discovered your blog post. The know-how and kindness in playing with almost everything was excellent. I don't know what I would've done if I hadn't encountered such a step like this. I can also at this moment look ahead to my future. Thanks a lot very much for this skilled and result oriented help. I will not be reluctant to suggest your site to anybody who ought to have recommendations on this issue.

I wish to express some thanks to this writer for bailing me out of this instance. Just after looking out through the world wide web and finding ideas which were not productive, I figured my entire life was over. Living minus the solutions to the problems you've solved by means of the article is a serious case, as well as the ones that would have negatively damaged my entire career if I had not encountered your website. Your understanding and kindness in taking care of every item was crucial. I am not sure what I would have done if I hadn't come across such a subject like this. I am able to now look ahead to my future. Thank you very much for this expert and results-oriented guide. I will not hesitate to refer your web sites to any individual who will need support about this area.

I'm also writing to make you be aware of of the really good experience my wife's princess developed using your site. She picked up a lot of details, which included how it is like to have an amazing coaching mindset to make folks really easily have an understanding of a variety of complicated matters. You undoubtedly did more than our own desires. I appreciate you for providing those warm and friendly, dependable, informative not to mention easy tips on your topic to Gloria.

I'm also writing to make you be aware of what a brilliant encounter my friend's child had reading your web page. She discovered lots of pieces, most notably what it is like to possess a very effective giving style to have men and women really easily understand specific problematic matters. You actually did more than our expectations. I appreciate you for supplying such useful, trusted, educational as well as easy thoughts on your topic to Kate.

Thank you for all of the efforts on this web site. Kate takes pleasure in engaging in research and it's simple to grasp why. Many of us notice all relating to the powerful manner you give vital techniques by means of the blog and as well boost contribution from other people on that situation then our own child is becoming educated a great deal. Enjoy the rest of the year. You're conducting a brilliant job.

I have to point out my affection for your kind-heartedness giving support to people that should have help with your matter. Your real commitment to getting the message all over had been exceptionally effective and have in every case enabled regular people much like me to realize their desired goals. The interesting tips and hints entails a whole lot a person like me and even further to my fellow workers. Many thanks; from each one of us.

Thanks a lot for giving everyone an exceptionally nice opportunity to discover important secrets from this site. It's always very sweet and full of a great time for me personally and my office acquaintances to visit your blog not less than thrice weekly to see the new guides you have got. Of course, we're at all times impressed with your dazzling advice served by you. Selected two facts in this post are in truth the finest I have ever had.

I simply had to thank you so much once again. I do not know the things that I might have carried out in the absence of these tips and hints documented by you directly on that question. It was actually the troublesome situation in my view, but considering your expert style you dealt with that took me to jump for joy. I'm happy for this help and sincerely hope you are aware of a great job you have been putting in training the rest via your web site. Probably you have never met all of us.

Thanks a lot for giving everyone a very remarkable possiblity to check tips from this web site. It can be so pleasing and as well , jam-packed with a lot of fun for me and my office acquaintances to search your site the equivalent of three times weekly to learn the latest issues you will have. And of course, I'm so at all times pleased with the attractive ideas you give. Certain 3 ideas in this posting are basically the most efficient I've ever had.

Thank you so much for providing individuals with remarkably brilliant opportunity to discover important secrets from this site. It is often so amazing and also packed with amusement for me personally and my office acquaintances to search your blog on the least 3 times per week to see the fresh guidance you have. Not to mention, I'm so always happy with the breathtaking ideas you serve. Selected 4 tips in this post are definitely the most impressive we have all had.

I want to express appreciation to this writer for bailing me out of this particular scenario. As a result of searching through the online world and finding methods which are not beneficial, I assumed my entire life was well over. Living without the presence of strategies to the problems you have solved by way of your article content is a serious case, and ones which might have negatively affected my career if I had not noticed your website. Your main natural talent and kindness in taking care of all the pieces was very helpful. I'm not sure what I would have done if I had not come across such a point like this. I am able to at this point relish my future. Thanks so much for this skilled and result oriented guide. I won't be reluctant to recommend your web blog to any individual who wants and needs recommendations on this matter.

Thank you for all of your efforts on this web page. My niece delights in getting into investigations and it is simple to grasp why. A number of us know all regarding the dynamic manner you create advantageous guidelines via the blog and therefore cause participation from people on the theme and my princess is truly becoming educated so much. Take pleasure in the remaining portion of the new year. You are performing a remarkable job.

I definitely wanted to construct a simple word to be able to express gratitude to you for all of the pleasant guides you are writing on this site. My time intensive internet look up has at the end of the day been recognized with high-quality strategies to share with my guests. I would say that most of us readers actually are very much endowed to dwell in a superb community with so many marvellous individuals with useful principles. I feel extremely blessed to have seen your web page and look forward to so many more entertaining minutes reading here. Thanks once more for everything.

I really wanted to type a remark in order to say thanks to you for these precious ideas you are sharing here. My long internet look up has finally been honored with professional facts to go over with my classmates and friends. I would point out that we readers are very much endowed to live in a great network with very many wonderful individuals with useful basics. I feel truly grateful to have come across your entire site and look forward to plenty of more fun times reading here. Thank you again for all the details.

My spouse and i have been quite thrilled Raymond managed to conclude his studies using the precious recommendations he discovered through your web pages. It's not at all simplistic to just happen to be releasing tips and tricks that many a number of people might have been trying to sell. We really fully understand we now have you to give thanks to for that. The most important illustrations you've made, the straightforward blog menu, the friendships your site make it easier to instill - it's most spectacular, and it is assisting our son and the family understand that idea is satisfying, which is incredibly indispensable. Thank you for everything!

I definitely wanted to type a small word to be able to appreciate you for those awesome techniques you are posting on this site. My extensive internet look up has at the end of the day been compensated with incredibly good details to share with my neighbours. I would state that that we readers actually are definitely endowed to dwell in a useful place with many lovely individuals with great principles. I feel very grateful to have used the webpage and look forward to plenty of more awesome moments reading here. Thank you once more for everything.

I want to get across my love for your generosity in support of persons that require help with the content. Your personal dedication to getting the solution along became extraordinarily powerful and has specifically helped somebody like me to realize their desired goals. Your own useful recommendations denotes much a person like me and far more to my mates. Best wishes; from each one of us.

I wish to show some thanks to the writer just for bailing me out of this particular circumstance. Just after looking out through the world-wide-web and meeting principles which were not pleasant, I was thinking my life was over. Existing devoid of the strategies to the problems you have fixed by means of your good post is a crucial case, and the ones that might have in a negative way damaged my entire career if I hadn't encountered the website. Your knowledge and kindness in taking care of all the stuff was very helpful. I'm not sure what I would've done if I had not encountered such a solution like this. It's possible to at this moment relish my future. Thank you very much for the impressive and amazing guide. I will not be reluctant to endorse your site to anyone who wants and needs counselling on this issue.

I would like to get across my respect for your generosity supporting folks that really need guidance on this one subject matter. Your very own commitment to passing the solution all-around became really beneficial and have consistently helped guys and women like me to achieve their ambitions. Your own interesting advice implies this much a person like me and further more to my colleagues. Warm regards; from all of us.

Thanks a lot for providing individuals with remarkably special chance to read articles and blog posts from here. It is always very cool plus jam-packed with a great time for me personally and my office fellow workers to visit your website at minimum thrice a week to learn the latest items you will have. And indeed, I am certainly fulfilled with the tremendous techniques you serve. Selected two areas in this post are indeed the simplest we have had.

I wish to show my appreciation to the writer just for bailing me out of this type of predicament. Right after researching throughout the the web and seeing basics which were not productive, I believed my life was over. Being alive minus the answers to the difficulties you have resolved by means of your good write-up is a crucial case, as well as those which could have in a wrong way damaged my entire career if I had not come across your web page. Your actual talents and kindness in maneuvering every part was invaluable. I am not sure what I would have done if I had not come across such a step like this. I am able to now look forward to my future. Thank you very much for the impressive and amazing guide. I will not be reluctant to suggest your web sites to anyone who wants and needs recommendations about this topic.

I just wanted to send a quick note so as to appreciate you for some of the marvelous tips you are writing on this site. My time-consuming internet search has at the end been recognized with high-quality points to talk about with my colleagues. I 'd declare that most of us readers are undoubtedly lucky to dwell in a really good site with many special people with insightful tricks. I feel quite privileged to have come across the website page and look forward to so many more fabulous times reading here. Thanks again for a lot of things.

I and my friends have already been looking at the best recommendations found on your web blog then at once got an awful suspicion I had not expressed respect to the web blog owner for those secrets. These people appeared to be absolutely warmed to see all of them and have in effect clearly been having fun with those things. Thanks for simply being indeed helpful as well as for obtaining some fine topics millions of individuals are really desirous to be informed on. Our sincere regret for not expressing gratitude to you earlier.

My husband and i ended up being quite more than happy that Chris managed to finish up his researching through the precious recommendations he was given while using the web pages. It is now and again perplexing just to always be giving for free tips which usually others might have been trying to sell. We really see we now have the writer to appreciate because of that. All the explanations you have made, the simple site menu, the friendships you assist to create - it's got mostly great, and it's aiding our son in addition to the family recognize that the article is thrilling, and that is very important. Many thanks for all the pieces!

I have to point out my gratitude for your generosity supporting those individuals that require guidance on the field. Your real dedication to passing the message up and down became rather beneficial and have always helped men and women much like me to reach their objectives. The invaluable instruction denotes so much to me and still more to my mates. Warm regards; from each one of us.

I just wanted to compose a brief message in order to appreciate you for those precious recommendations you are giving at this website. My incredibly long internet lookup has finally been honored with useful suggestions to write about with my good friends. I 'd suppose that we visitors are extremely endowed to dwell in a notable place with many lovely professionals with helpful tips. I feel really happy to have come across your entire web pages and look forward to some more entertaining moments reading here. Thank you once again for everything.

I intended to post you that tiny word so as to give thanks once again on your awesome techniques you have shared here. It was simply shockingly generous with people like you in giving publicly what some people might have made available as an ebook to help make some bucks for themselves, mostly considering that you could have tried it if you ever desired. The inspiring ideas also worked to become a easy way to be sure that other people online have the same desire just like my personal own to realize many more when considering this issue. I'm sure there are millions of more pleasurable periods up front for individuals who read carefully your blog post.

I enjoy you because of all of the labor on this site. Ellie delights in going through investigation and it is obvious why. Many of us know all about the compelling ways you provide great tactics via this web blog and even foster response from some other people on the content while my girl has always been being taught so much. Take advantage of the remaining portion of the year. You are conducting a glorious job.

A lot of thanks for your own hard work on this web page. Gloria take interest in going through internet research and it is easy to understand why. We notice all regarding the dynamic means you render very useful tricks on this website and improve participation from other individuals on the concept then our child is actually discovering a lot. Take pleasure in the remaining portion of the year. You have been doing a splendid job.

My husband and i ended up being quite contented when John managed to do his researching by way of the precious recommendations he came across in your weblog. It's not at all simplistic just to always be giving freely strategies which usually men and women may have been selling. We really fully understand we have the blog owner to appreciate because of that. The main illustrations you have made, the easy web site navigation, the relationships your site help create - it's got mostly unbelievable, and it is facilitating our son in addition to our family reason why the concept is excellent, and that's rather fundamental. Many thanks for the whole lot!

I'm just commenting to let you understand what a fine discovery my child encountered going through the blog. She mastered too many issues, with the inclusion of how it is like to possess an excellent teaching mood to make a number of people without problems learn some tortuous topics. You truly exceeded readers' expectations. Thanks for imparting those powerful, dependable, revealing and also cool tips on your topic to Ethel.

Needed to write you that little observation to be able to thank you very much once again with the pleasing concepts you have provided in this case. It was certainly particularly generous with you to allow extensively exactly what many people could have advertised as an e book to make some money for themselves, particularly now that you could possibly have done it if you wanted. Those good tips additionally acted like a fantastic way to be aware that other people online have the identical eagerness similar to mine to grasp somewhat more concerning this matter. I'm certain there are a lot more pleasant times in the future for people who start reading your site.

I want to show my passion for your kind-heartedness for those people that really need guidance on your question. Your real dedication to passing the solution all over came to be wonderfully useful and have continuously permitted people just like me to get to their dreams. This helpful key points implies so much to me and far more to my peers. Best wishes; from each one 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.