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

856 Comments

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.

I really wanted to type a brief comment to appreciate you for some of the precious steps you are giving out here. My rather long internet look up has at the end of the day been recognized with high-quality details to exchange with my classmates and friends. I 'd claim that many of us site visitors actually are undoubtedly fortunate to live in a superb website with many marvellous individuals with insightful advice. I feel somewhat fortunate to have discovered your entire site and look forward to plenty of more enjoyable times reading here. Thanks once again for all the details.

I am writing to let you know of the useful experience my wife's princess developed studying your site. She picked up several things, including what it is like to have a great helping character to get other individuals clearly have an understanding of certain specialized issues. You undoubtedly exceeded her expectations. I appreciate you for rendering those effective, healthy, edifying and also easy tips about that topic to Lizeth.

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!

I not to mention my pals appeared to be examining the excellent points on your site then before long I had a terrible feeling I never thanked the site owner for those techniques. My people had been as a result excited to study all of them and already have definitely been using these things. Thank you for getting well kind and also for choosing variety of superb ideas most people are really desirous to discover. Our honest regret for not saying thanks to you sooner.

I have to show my admiration for your generosity supporting men and women that absolutely need help on this particular idea. Your special dedication to passing the solution all around had been surprisingly beneficial and have always helped girls much like me to reach their goals. Your personal warm and helpful instruction entails a lot a person like me and far more to my mates. Best wishes; from everyone of us.

I intended to create you one very small observation so as to give many thanks once again over the precious pointers you've shown above. It was remarkably open-handed of you to present extensively precisely what many people could possibly have marketed for an ebook to end up making some money for their own end, notably since you might have done it if you ever decided. The good ideas also worked as a great way to realize that other people have the identical dream really like my personal own to learn good deal more on the subject of this matter. I am sure there are thousands of more fun times up front for individuals who read through your website.

I'm just writing to let you know of the beneficial discovery our princess gained reading yuor web blog. She even learned many details, which include what it's like to possess a very effective giving nature to let folks with no trouble fully understand a variety of grueling issues. You really surpassed our desires. Many thanks for rendering these important, trusted, edifying as well as unique tips about your topic to Lizeth.

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.

Thank you a lot for providing individuals with an extraordinarily remarkable chance to read from this site. It is often so terrific and also jam-packed with a good time for me personally and my office mates to visit your site minimum thrice in a week to read the newest secrets you have. And lastly, I'm actually fascinated with all the fabulous information served by you. Certain two points in this posting are easily the simplest I've had.

I precisely had to thank you very much all over again. I am not sure what I could possibly have followed in the absence of those pointers documented by you on such a theme. Entirely was a very terrifying scenario in my opinion, nevertheless being able to see your well-written style you dealt with it took me to weep for delight. Now i'm happier for your guidance and in addition hope you are aware of an amazing job you have been getting into educating the rest with the aid of your webblog. I know that you've never got to know all of us.

Thanks a lot for providing individuals with an extremely marvellous possiblity to discover important secrets from this web site. It's always very fantastic and also stuffed with a lot of fun for me personally and my office co-workers to search the blog not less than 3 times in one week to find out the new stuff you have got. And of course, I'm at all times fulfilled considering the superb ideas you serve. Some 4 facts in this posting are particularly the simplest we've had.

I precisely needed to say thanks again. I am not sure the things that I would have taken care of in the absence of those secrets documented by you directly on that area of interest. It had become an absolute scary matter in my view, however , considering the professional form you handled it took me to leap for delight. Now i'm thankful for this guidance as well as believe you find out what a great job you are providing teaching people through your web site. I am certain you have never encountered any of us.

My wife and i were quite contented Ervin managed to deal with his researching via the ideas he had through the web pages. It is now and again perplexing to simply possibly be making a gift of tricks the rest might have been trying to sell. Therefore we do know we have got the website owner to appreciate for that. Those explanations you have made, the easy site menu, the friendships you can help create - it's got many overwhelming, and it's leading our son and us believe that the topic is brilliant, and that is exceptionally indispensable. Many thanks for everything!

I simply wished to say thanks all over again. I'm not certain the things that I would have handled without the type of ways contributed by you on my concern. It seemed to be an absolute daunting issue in my circumstances, nevertheless noticing a expert manner you processed it forced me to cry over gladness. I'm happy for this information and as well , pray you are aware of a great job you are always accomplishing teaching people via your blog. Most probably you haven't met any of us.

I would like to express appreciation to you for rescuing me from this matter. As a result of browsing throughout the world-wide-web and coming across strategies which were not powerful, I assumed my entire life was well over. Living without the presence of strategies to the issues you have fixed all through this short article is a crucial case, and ones which could have in a negative way affected my career if I hadn't encountered your web page. Your understanding and kindness in touching every part was valuable. I am not sure what I would've done if I hadn't encountered such a step like this. I am able to at this time look forward to my future. Thank you very much for the professional and result oriented guide. I will not hesitate to endorse the blog to any individual who should receive guide about this area.

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 glad for commenting to make you know what a notable encounter my princess encountered browsing yuor web blog. She even learned lots of issues, which included what it is like to have an awesome giving nature to get the rest without difficulty know some hard to do topics. You really exceeded my expectations. I appreciate you for delivering those priceless, trustworthy, edifying and even fun thoughts on the topic to Jane.

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.