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

701 Comments

A formidable share, I simply given this onto a colleague who was doing slightly analysis on this. And he in truth purchased me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to discuss this, I feel strongly about it and love studying extra on this topic. If attainable, as you develop into expertise, would you mind updating your blog with extra details? It is extremely useful for me. Big thumb up for this blog post!

I precisely had to thank you so much all over again. I am not sure what I could possibly have handled in the absence of the actual recommendations contributed by you concerning my concern. This has been an absolute difficult dilemma in my opinion, however , coming across the very expert way you treated the issue forced me to jump for fulfillment. Now i'm grateful for this guidance and pray you realize what an amazing job that you are accomplishing teaching other individuals through your blog post. I am certain you've never encountered all of us.

I'm writing to let you know what a incredible experience my wife's princess experienced using your webblog. She figured out a good number of things, most notably what it is like to possess an awesome coaching heart to have other individuals effortlessly fully understand a variety of grueling topics. You really surpassed visitors' desires. Many thanks for giving those helpful, trusted, informative as well as fun guidance on that topic to Jane.

I'm also writing to let you be aware of of the extraordinary discovery my princess went through browsing your blog. She figured out too many pieces, most notably what it's like to have an excellent helping character to make the rest without problems learn about a variety of hard to do subject areas. You truly surpassed visitors' expectations. Thank you for presenting the warm and helpful, safe, revealing and even cool tips on your topic to Mary.

I and also my pals have already been taking note of the great secrets located on your web site and then quickly I got a horrible suspicion I had not expressed respect to the website owner for those techniques. My guys were absolutely excited to read all of them and have now absolutely been using these things. Thank you for truly being very kind as well as for picking out certain cool themes most people are really needing to learn about. Our own honest regret for not expressing gratitude to earlier.

My wife and i felt more than happy Jordan managed to complete his homework because of the ideas he grabbed out of your site. It is now and again perplexing to just possibly be offering information which the others might have been trying to sell. And we all keep in mind we have you to thank because of that. The explanations you've made, the straightforward website navigation, the friendships you help engender - it's many incredible, and it's assisting our son in addition to the family know that this idea is fun, and that's really pressing. Many thanks for everything!

I have to express some appreciation to the writer for bailing me out of this problem. Just after scouting through the online world and seeing concepts which are not beneficial, I assumed my entire life was well over. Existing without the answers to the difficulties you've sorted out by way of your guide is a serious case, as well as the kind that could have in a wrong way damaged my career if I hadn't discovered your blog. Your actual competence and kindness in dealing with all areas was precious. I am not sure what I would've done if I had not encountered such a solution like this. I am able to now look ahead to my future. Thank you so much for the reliable and effective help. I won't hesitate to suggest the website to any person who would need counselling about this problem.

My husband and i ended up being so contented that Peter managed to conclude his preliminary research with the precious recommendations he obtained through the web page. It is now and again perplexing to simply continually be giving for free methods which many people might have been selling. So we already know we need you to be grateful to for that. The main illustrations you have made, the straightforward web site menu, the relationships your site give support to promote - it's all incredible, and it's aiding our son in addition to our family consider that this theme is pleasurable, and that's extraordinarily important. Thank you for the whole thing!

I truly wanted to develop a simple message to be able to say thanks to you for these magnificent concepts you are giving out at this website. My extensive internet investigation has now been compensated with reasonable ideas to exchange with my neighbours. I 'd suppose that most of us site visitors actually are undeniably fortunate to exist in a really good place with many awesome people with good opinions. I feel somewhat privileged to have come across your web page and look forward to really more exciting moments reading here. Thanks a lot once again for all the details.

I抦 impressed, I need to say. Actually hardly ever do I encounter a weblog that抯 both educative and entertaining, and let me tell you, you will have hit the nail on the head. Your concept is outstanding; the difficulty is something that not sufficient people are speaking intelligently about. I am very comfortable that I stumbled throughout this in my seek for one thing regarding this.

I want to show my love for your generosity for men and women who really need assistance with this important field. Your personal dedication to getting the message around appeared to be especially functional and have usually empowered individuals much like me to arrive at their pursuits. Your entire helpful suggestions signifies much to me and additionally to my fellow workers. Thank you; from all of us.

Thank you a lot for providing individuals with an extraordinarily wonderful opportunity to check tips from this website. It is usually so enjoyable and packed with fun for me and my office friends to visit your site more than 3 times in a week to read through the latest guides you will have. And of course, I am also certainly contented with your astounding pointers you serve. Selected 1 ideas in this posting are undoubtedly the most suitable we have ever had.

I wish to show my passion for your kindness for people that really want assistance with this situation. Your special dedication to passing the solution across had become quite interesting and have continually permitted ladies just like me to reach their endeavors. Your own warm and friendly recommendations entails a lot to me and extremely more to my office colleagues. Thank you; from each one of us.

I would like to show my affection for your kind-heartedness supporting individuals that actually need help with the content. Your special dedication to passing the message up and down was exceedingly helpful and has truly encouraged regular people much like me to realize their pursuits. Your valuable help implies this much to me and a whole lot more to my office colleagues. Best wishes; from all of us.

My husband and i got contented when Peter could carry out his investigations with the ideas he received through your weblog. It's not at all simplistic to simply continually be giving out techniques that many people have been selling. So we know we've got the blog owner to thank because of that. The type of explanations you made, the easy blog menu, the friendships you will help promote - it's many excellent, and it is leading our son and us reckon that the content is entertaining, and that is rather pressing. Thanks for the whole thing!

I am glad for writing to let you be aware of of the helpful experience my friend's girl gained browsing the blog. She even learned so many things, most notably what it's like to possess a great helping nature to get many people without hassle learn about various advanced subject matter. You truly exceeded readers' expected results. Thanks for imparting those great, trusted, edifying and easy tips on that topic to Sandra.

My husband and i ended up being now joyful when Chris could deal with his survey through the entire precious recommendations he acquired out of the web site. It's not at all simplistic to just continually be giving for free thoughts which people today might have been trying to sell. We know we've got the writer to give thanks to for this. All of the illustrations you have made, the easy blog navigation, the relationships you can help engender - it's got many awesome, and it's really letting our son in addition to our family reason why that theme is excellent, and that is particularly essential. Thank you for all!

A lot of thanks for all your valuable effort on this web page. Kim take interest in working on investigations and it is obvious why. I hear all regarding the dynamic way you produce useful solutions via this web blog and invigorate response from visitors on this point while our girl is without question understanding a whole lot. Enjoy the remaining portion of the new year. You are carrying out a fabulous job.

I just wanted to construct a simple note to appreciate you for all the unique guidelines you are giving out at this website. My considerable internet lookup has finally been paid with extremely good suggestions to go over with my pals. I would admit that most of us readers actually are definitely lucky to live in a fantastic site with so many lovely people with valuable points. I feel pretty privileged to have seen your entire weblog and look forward to some more entertaining minutes reading here. Thank you again for a lot of things.

I would like to express my appreciation to you for bailing me out of such a matter. After exploring throughout the internet and finding thoughts which were not helpful, I believed my life was gone. Existing devoid of the approaches to the problems you've fixed by means of the review is a serious case, as well as the kind that might have badly affected my career if I had not noticed the blog. Your primary training and kindness in handling the whole thing was valuable. I don't know what I would've done if I hadn't discovered such a step like this. I can at this moment look ahead to my future. Thanks a lot so much for your impressive and amazing guide. I won't be reluctant to refer your web blog to anyone who ought to have tips about this issue.

I enjoy you because of your whole efforts on this website. My mum loves going through investigation and it's simple to grasp why. Almost all learn all concerning the lively mode you give practical thoughts on your web blog and therefore recommend contribution from other ones on that issue so our own simple princess is now being taught so much. Have fun with the remaining portion of the year. You are always carrying out a really good job.

Thanks for all of the efforts on this site. Kim takes pleasure in carrying out investigation and it's obvious why. Almost all learn all relating to the lively method you create sensible items by means of your website and attract response from other people on this subject then our daughter is without a doubt discovering a lot of things. Have fun with the remaining portion of the year. You are always doing a dazzling job.

I precisely desired to thank you very much yet again. I do not know the things I would have carried out without the thoughts discussed by you relating to my question. Completely was a real fearsome concern for me, nevertheless understanding a professional manner you handled it forced me to cry with contentment. Now i am grateful for your service and then wish you really know what a great job you have been accomplishing educating some other people all through a web site. I know that you haven't come across all of us.

Needed to compose you a little observation to help say thanks a lot the moment again about the breathtaking basics you've provided in this case. It was really shockingly generous with people like you to offer unhampered what exactly a lot of folks could possibly have supplied as an electronic book to help with making some bucks for their own end, chiefly since you could possibly have tried it if you decided. Those solutions also acted as the fantastic way to be aware that the rest have similar desire the same as mine to figure out great deal more in regard to this matter. I know there are lots of more enjoyable moments ahead for individuals who read carefully your website.

I wish to get across my respect for your generosity supporting people who really need assistance with the idea. Your special commitment to passing the message all through has been remarkably helpful and have all the time encouraged professionals like me to get to their pursuits. Your new interesting recommendations indicates a whole lot a person like me and even further to my fellow workers. Warm regards; from all of us.

I enjoy you because of all your work on this blog. My mum takes pleasure in engaging in internet research and it's really easy to understand why. A lot of people notice all relating to the dynamic way you convey powerful solutions on your web site and even inspire contribution from other people about this topic then our own simple princess is now learning so much. Take advantage of the remaining portion of the year. You are conducting a glorious job.

I want to express some thanks to this writer for rescuing me from this particular problem. As a result of exploring through the search engines and meeting opinions which were not helpful, I believed my life was over. Existing devoid of the approaches to the problems you've fixed all through your good guide is a crucial case, and those that would have badly damaged my career if I had not discovered your web blog. Your own knowledge and kindness in handling all the details was crucial. I'm not sure what I would have done if I had not come across such a step like this. I'm able to at this time relish my future. Thanks a lot very much for the professional and amazing help. I won't be reluctant to suggest your web site to any individual who should receive counselling about this subject.

Good post. I learn one thing tougher on completely different blogs everyday. It would at all times be stimulating to learn content from other writers and practice a little something from their store. I抎 choose to make use of some with the content material on my blog whether you don抰 mind. Natually I抣l offer you a hyperlink in your net blog. Thanks for sharing.

My husband and i felt really glad Peter managed to deal with his survey through the entire ideas he received through your web pages. It is now and again perplexing to simply always be handing out information and facts which a number of people may have been selling. Therefore we fully understand we have the writer to thank because of that. The entire illustrations you've made, the straightforward blog menu, the friendships your site aid to create - it's mostly remarkable, and it's aiding our son in addition to us feel that that article is cool, which is certainly really indispensable. Thanks for everything!

Thanks for all of your work on this website. Kate takes pleasure in making time for research and it's easy to understand why. All of us learn all concerning the powerful way you give valuable ideas on this web blog and welcome participation from other individuals about this subject plus our favorite child is always studying so much. Take pleasure in the rest of the new year. You are always conducting a fabulous job.

Thanks for all your efforts on this web site. Ellie really loves participating in internet research and it's really easy to see why. A number of us learn all about the powerful medium you give both useful and interesting strategies via your website and as well recommend contribution from website visitors on the idea while our favorite princess is understanding a lot of things. Have fun with the remaining portion of the new year. Your performing a really good job.

I must express some thanks to this writer for rescuing me from this particular incident. As a result of checking throughout the internet and obtaining principles that were not beneficial, I thought my life was well over. Living devoid of the approaches to the difficulties you have solved by way of your good guide is a crucial case, and ones which could have badly damaged my entire career if I hadn't discovered your blog. Your own capability and kindness in taking care of a lot of stuff was very useful. I'm not sure what I would've done if I hadn't come across such a point like this. I am able to at this moment look ahead to my future. Thank you very much for your specialized and sensible help. I won't hesitate to suggest your blog to anybody who would need guidelines on this subject.

I and also my friends were found to be analyzing the best advice on your web blog while before long developed an awful suspicion I had not thanked the web site owner for those secrets. The ladies are already consequently glad to study them and already have quite simply been tapping into them. Thanks for genuinely so considerate and also for deciding on certain quality subject matter most people are really desperate to be aware of. Our honest regret for not expressing appreciation to earlier.

I simply needed to thank you very much once again. I'm not certain the things I might have used in the absence of these tricks revealed by you on that concern. It was the frightful difficulty in my opinion, nevertheless finding out the very specialised strategy you dealt with it made me to jump for joy. I'm just grateful for your information and thus pray you realize what a powerful job you are providing teaching the rest through the use of your blog post. Most probably you've never come across all of us.

I wish to show my appreciation to this writer just for bailing me out of this type of crisis. As a result of browsing through the the web and meeting thoughts which were not helpful, I figured my life was well over. Being alive without the presence of solutions to the difficulties you've sorted out through this guide is a serious case, and the ones that would have adversely affected my entire career if I had not noticed your web blog. Your primary know-how and kindness in touching all areas was invaluable. I am not sure what I would've done if I had not come upon such a solution like this. It's possible to now look forward to my future. Thank you very much for the professional and sensible help. I won't be reluctant to refer your web site to anyone who should have recommendations on this issue.

I want to express my appreciation to the writer for bailing me out of this type of predicament. As a result of researching throughout the internet and getting basics that were not beneficial, I figured my entire life was done. Living devoid of the approaches to the problems you have sorted out by way of this review is a critical case, and ones that could have negatively damaged my career if I had not noticed your blog. Your own personal natural talent and kindness in handling a lot of stuff was excellent. I don't know what I would have done if I had not encountered such a step like this. I can also at this point look ahead to my future. Thanks very much for the high quality and effective guide. I won't be reluctant to suggest the website to anybody who would need tips on this problem.

I just wanted to construct a small remark in order to express gratitude to you for some of the amazing recommendations you are showing on this site. My incredibly long internet look up has at the end of the day been compensated with sensible ideas to go over with my visitors. I would claim that most of us site visitors are truly endowed to dwell in a fine community with so many wonderful individuals with good things. I feel really grateful to have discovered your entire website page and look forward to plenty of more excellent times reading here. Thanks a lot once again for a lot of things.

I precisely desired to thank you so much all over again. I'm not certain what I would've gone through without those tips and hints discussed by you about this situation. This was a distressing matter in my view, nevertheless observing a new specialized style you managed the issue made me to cry for delight. I will be thankful for this information and then expect you find out what an amazing job you are always putting in teaching many others using your webblog. Most likely you haven't got to know all of us.

Needed to write you this little observation to be able to say thanks again for those pleasing guidelines you've featured here. It's quite pretty generous of people like you to present unhampered exactly what a lot of folks would've offered for an ebook to end up making some cash on their own, particularly since you might well have tried it in the event you considered necessary. The points also served as the fantastic way to recognize that some people have the same dream really like my personal own to know the truth very much more when it comes to this matter. I think there are thousands of more pleasurable times in the future for people who look over your site.

I as well as my pals came digesting the great techniques from your website and so all of a sudden got a horrible feeling I never expressed respect to the site owner for those secrets. Those people were consequently very interested to learn all of them and have now without a doubt been loving them. Many thanks for simply being really kind as well as for pick out these kinds of superior resources most people are really needing to be aware of. My honest regret for not saying thanks to earlier.

I wanted to write you this little note in order to say thank you yet again on the pretty concepts you have featured here. It's certainly unbelievably open-handed of you to give freely what exactly a lot of folks could possibly have advertised as an electronic book to help make some profit on their own, especially considering the fact that you might have tried it in case you considered necessary. The tricks additionally acted like the easy way to fully grasp that someone else have a similar dreams just as my very own to understand a little more related to this condition. I am sure there are many more enjoyable opportunities ahead for folks who see your site.

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.