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

358 Comments

I and my pals were actually looking at the best secrets on your site and so unexpectedly developed a terrible suspicion I never expressed respect to the blog owner for those techniques. These guys were definitely totally happy to learn them and have now in truth been enjoying those things. I appreciate you for truly being really accommodating as well as for settling on such fine resources most people are really wanting to discover. Our sincere regret for not expressing appreciation to you sooner.

I have to express appreciation to you just for bailing me out of such a scenario. After researching through the world wide web and obtaining tricks which are not pleasant, I assumed my entire life was over. Existing without the presence of approaches to the issues you have solved as a result of your good short article is a serious case, as well as ones that might have negatively damaged my entire career if I hadn't discovered your web blog. Your own knowledge and kindness in handling the whole thing was precious. I don't know what I would have done if I had not come upon such a subject like this. I can also at this moment look forward to my future. Thank you very much for the specialized and amazing help. I will not hesitate to refer your web sites to any individual who will need direction on this area.

I intended to compose you this very little observation to give many thanks over again on your great methods you've shown at this time. It was simply tremendously generous of people like you to provide unreservedly just what some people would have offered for sale as an e-book in order to make some dough for themselves, certainly given that you might well have tried it if you desired. Those secrets additionally worked to become fantastic way to realize that someone else have similar dreams much like my personal own to see very much more in terms of this problem. I am sure there are numerous more pleasant instances up front for people who examine your website.

I wanted to construct a simple message so as to say thanks to you for all of the fantastic advice you are posting at this site. My considerable internet research has finally been rewarded with extremely good ideas to exchange with my guests. I would say that most of us site visitors are very blessed to dwell in a fine community with so many special professionals with interesting basics. I feel rather blessed to have encountered your site and look forward to really more brilliant moments reading here. Thanks once more for a lot of things.

I simply needed to thank you very much yet again. I do not know what I would have accomplished without the methods discussed by you relating to such area of interest. Completely was a troublesome issue in my opinion, but considering your skilled style you managed it made me to weep with fulfillment. I'm just thankful for the support and as well , hope you recognize what a powerful job that you're putting in training other individuals via your websites. Most likely you haven't encountered any of us.

My husband and i ended up being ecstatic when Emmanuel could conclude his basic research while using the precious recommendations he grabbed while using the web site. It's not at all simplistic to just be giving away tactics which usually the rest might have been selling. We really understand we have got you to give thanks to for this. All the illustrations you made, the simple blog navigation, the friendships you will assist to create - it's many overwhelming, and it is leading our son and the family understand this article is enjoyable, which is extremely serious. Thank you for the whole thing!

Thank you for all your valuable effort on this site. Kate take interest in doing research and it is simple to grasp why. I hear all concerning the dynamic means you make insightful guidance via your blog and therefore strongly encourage contribution from website visitors about this matter then my girl is in fact becoming educated a great deal. Take pleasure in the rest of the year. You're the one carrying out a tremendous job.

I and my pals appeared to be reading through the good tactics on your web page and then all of the sudden got an awful feeling I had not expressed respect to the blog owner for those tips. My ladies had been as a consequence glad to see all of them and have in effect seriously been enjoying these things. I appreciate you for really being very kind as well as for selecting this kind of great things most people are really eager to learn about. Our own honest apologies for not saying thanks to you sooner.

A lot of thanks for all your valuable effort on this site. Kate loves working on internet research and it's really simple to grasp why. I notice all concerning the lively method you convey both interesting and useful solutions via your web site and even welcome participation from other people about this subject matter while our favorite girl is without a doubt starting to learn a whole lot. Enjoy the remaining portion of the new year. You're the one conducting a very good job.

I'm also commenting to let you know of the notable encounter my friend's daughter went through using your web page. She came to understand so many things, which included what it's like to have an excellent giving heart to make others with no trouble grasp selected advanced topics. You undoubtedly exceeded my expectations. Thank you for distributing the beneficial, healthy, informative not to mention cool tips about that topic to Sandra.

I simply needed to say thanks yet again. I do not know the things that I might have done in the absence of the information documented by you about that topic. It absolutely was a very daunting difficulty in my circumstances, but spending time with the expert fashion you solved it made me to leap over happiness. I'm just grateful for this support and then trust you recognize what a powerful job you're carrying out training people via a blog. Probably you haven't got to know all of us.

I must voice my admiration for your kindness giving support to visitors who need help with in this subject matter. Your very own commitment to getting the solution across came to be wonderfully functional and have helped employees much like me to realize their endeavors. Your new warm and friendly report denotes so much to me and far more to my office workers. Thanks a ton; from everyone of us.

My spouse and i have been joyous that Louis could deal with his researching with the ideas he received out of the web pages. It is now and again perplexing to just continually be giving freely things that people could have been selling. Therefore we figure out we have got you to be grateful to for this. All of the illustrations you made, the simple website navigation, the friendships you will assist to engender - it's most powerful, and it's really assisting our son in addition to our family know that the subject matter is fun, which is extremely fundamental. Thank you for everything!

Thank you for your own hard work on this site. My mother loves conducting research and it's really obvious why. My partner and i notice all regarding the dynamic method you present invaluable items by means of the website and even attract participation from some others on the area of interest while our child is now learning a great deal. Take pleasure in the remaining portion of the new year. Your conducting a great job.

I precisely desired to say thanks once again. I do not know what I would've undertaken without the type of methods documented by you about my topic. It was an absolute hard setting for me personally, but witnessing your professional manner you treated that forced me to cry with fulfillment. Extremely happier for this support and even wish you find out what a great job you were accomplishing instructing other individuals through the use of your website. I am certain you've never come across any of us.

I have to get across my affection for your generosity in support of folks that should have assistance with this niche. Your very own dedication to passing the solution throughout appeared to be amazingly helpful and has consistently empowered women like me to achieve their goals. This useful report can mean a lot a person like me and further more to my colleagues. Regards; from all of us.

I have to point out my passion for your generosity giving support to those people that should have help on this topic. Your real commitment to passing the message across came to be extremely interesting and have constantly enabled guys and women much like me to realize their goals. Your entire warm and helpful guidelines denotes so much a person like me and especially to my office workers. Many thanks; from all of us.

I enjoy you because of your entire labor on this web page. My mother really likes engaging in investigation and it is obvious why. My spouse and i know all concerning the powerful ways you render invaluable solutions through the blog and welcome contribution from visitors on the area of interest plus our own girl has always been learning so much. Enjoy the rest of the year. You're conducting a remarkable job.

I in addition to my pals were actually studying the good tips found on the blog and then suddenly developed a terrible suspicion I had not thanked you for those techniques. Those people ended up totally joyful to read through them and have undoubtedly been taking pleasure in them. We appreciate you indeed being indeed thoughtful and also for utilizing this kind of nice issues millions of individuals are really needing to be aware of. My very own sincere regret for not expressing appreciation to you earlier.

A lot of thanks for all your valuable effort on this blog. Gloria takes pleasure in doing investigation and it's simple to grasp why. A lot of people know all relating to the compelling manner you produce functional tricks via this web site and in addition foster participation from other ones on this idea and our own simple princess is always becoming educated a lot. Have fun with the rest of the year. You have been conducting a terrific job.

My wife and i were so more than happy Ervin could finish off his inquiry through the entire precious recommendations he received out of the web site. It's not at all simplistic to just always be giving out steps which often the rest may have been selling. And now we fully understand we've got the writer to give thanks to because of that. The most important illustrations you made, the easy website menu, the relationships your site help create - it is everything fantastic, and it is leading our son and the family feel that the concept is cool, and that's extremely serious. Thank you for all the pieces!

I simply desired to thank you very much once again. I do not know what I might have tried without the actual thoughts contributed by you directly on such concern. Certainly was an absolute scary issue for me personally, however , noticing the expert style you solved that made me to jump over fulfillment. Now i am grateful for this support and then trust you recognize what a powerful job you happen to be carrying out teaching people thru your website. More than likely you've never come across all of us.

Needed to write you the bit of observation so as to say thanks a lot over again regarding the magnificent basics you have documented at this time. It was simply incredibly generous with you to offer openly precisely what many people might have offered for sale as an electronic book to generate some money on their own, particularly considering that you might well have tried it in the event you considered necessary. The tactics likewise served to become fantastic way to fully grasp some people have the same keenness similar to mine to learn many more on the topic of this condition. I think there are millions of more pleasant opportunities in the future for many who scan your site.

Thank you so much for providing individuals with remarkably marvellous opportunity to read articles and blog posts from this web site. It really is so lovely and also stuffed with a great time for me personally and my office friends to search your web site at the least three times in a week to read through the fresh secrets you will have. And of course, I'm just usually fulfilled considering the unique tips you serve. Selected 2 ideas in this article are honestly the most impressive we have all ever had.

I precisely had to thank you very much again. I'm not certain the things I would've done in the absence of the aspects discussed by you regarding such a subject. Completely was a real traumatic matter in my position, however , understanding this skilled fashion you treated the issue took me to weep over delight. Extremely happy for the service and in addition have high hopes you are aware of an amazing job you are always providing training men and women by way of your webpage. More than likely you haven't come across any of us.

My husband and i were quite delighted when John could carry out his analysis from your ideas he came across through the web site. It's not at all simplistic just to always be giving for free facts that many others may have been trying to sell. So we understand we've got the blog owner to be grateful to because of that. Those illustrations you have made, the straightforward blog menu, the relationships you make it easier to instill - it's all unbelievable, and it is leading our son and us consider that that topic is satisfying, which is tremendously important. Thanks for everything!

Thank you so much for giving everyone a very brilliant chance to read critical reviews from this web site. It is always so terrific and as well , jam-packed with amusement for me personally and my office co-workers to search your website the equivalent of three times per week to study the latest guidance you will have. And of course, I'm so actually astounded considering the beautiful opinions served by you. Some two ideas in this posting are unquestionably the most impressive we have all had.

Thanks a lot for giving everyone such a nice possiblity to read in detail from this web site. It's usually very fantastic and as well , packed with a lot of fun for me personally and my office fellow workers to search your blog really 3 times per week to learn the new guidance you have. And lastly, I am also usually satisfied with your spectacular tips served by you. Selected two ideas on this page are surely the most suitable we've ever had.

I precisely wanted to thank you very much yet again. I am not sure what I would have used in the absence of the type of basics documented by you concerning my area of interest. It had become the frustrating crisis in my view, nevertheless looking at the specialised avenue you dealt with that made me to leap for joy. I'm just thankful for this work and expect you realize what a great job your are providing training many people through your web page. I am sure you haven't met any of us.

I simply needed to say thanks once more. I'm not certain what I might have handled in the absence of these creative ideas provided by you directly on this theme. It absolutely was the distressing issue in my opinion, nevertheless taking a look at the very specialized technique you resolved the issue took me to leap over joy. Extremely grateful for your advice and then hope that you recognize what an amazing job you are accomplishing training others through the use of your websites. I'm certain you've never met any of us.

I and my friends were actually reviewing the excellent information and facts located on the website while before long I got a terrible suspicion I never expressed respect to the web site owner for those secrets. My ladies appeared to be absolutely passionate to read them and now have pretty much been using those things. Appreciation for getting quite accommodating and then for deciding upon these kinds of superior useful guides millions of individuals are really desperate to know about. Our own honest apologies for not expressing appreciation to sooner.

Thanks for your entire efforts on this web site. Betty really loves engaging in research and it's obvious why. My spouse and i notice all relating to the powerful means you produce useful guides by means of the web site and in addition strongly encourage participation from some others on that area and our own simple princess has been starting to learn a lot of things. Take advantage of the rest of the year. You're the one performing a glorious job.

I needed to draft you that very little word to finally thank you so much the moment again for the breathtaking pointers you've shared at this time. It is certainly seriously open-handed of people like you to present unreservedly all that numerous people would have sold as an ebook to help with making some bucks on their own, most notably considering that you could have done it in case you decided. The secrets also acted to become a fantastic way to fully grasp that many people have a similar eagerness the same as my own to realize good deal more around this condition. I am certain there are some more fun sessions up front for folks who looked over your website.

I'm also commenting to let you understand of the excellent experience my wife's girl found browsing your web page. She figured out plenty of issues, which included how it is like to have an excellent teaching heart to let other folks very easily comprehend a variety of problematic subject areas. You truly did more than our own expectations. Thanks for presenting the informative, trusted, educational and even fun tips about the topic to Ethel.

Thank you a lot for providing individuals with an extraordinarily brilliant opportunity to read critical reviews from this web site. It is often so fantastic and also stuffed with amusement for me and my office colleagues to visit your blog a minimum of three times a week to study the new guidance you will have. And lastly, I am just at all times amazed considering the beautiful strategies you serve. Certain 3 points on this page are without a doubt the very best I've ever had.

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.