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

Youre so cool! I dont suppose Ive learn something like this before. So nice to search out any person with some original thoughts on this subject. realy thank you for starting this up. this website is something that is wanted on the web, somebody with a little originality. useful job for bringing something new to the internet!

My wife and i felt glad when Peter managed to deal with his investigations by way of the precious recommendations he made from your blog. It is now and again perplexing to just continually be releasing strategies which usually most people have been trying to sell. And we also do know we have the writer to be grateful to for this. The most important illustrations you have made, the easy website menu, the friendships you will help instill - it is many powerful, and it is making our son and the family reckon that that subject matter is fun, which is truly fundamental. Thank you for the whole thing!

Thank you a lot for giving everyone remarkably pleasant chance to read from this web site. It's usually so superb and also packed with fun for me personally and my office mates to visit the blog more than three times per week to read the fresh secrets you have. Of course, I'm certainly impressed with the perfect knowledge you serve. Selected 2 areas on this page are in truth the finest we have all had.

Thank you a lot for giving everyone remarkably special chance to discover important secrets from this web site. It really is very brilliant and also full of a good time for me and my office fellow workers to search the blog a minimum of thrice in one week to study the latest tips you have. Of course, I'm just certainly amazed with your fantastic opinions you give. Certain two ideas in this posting are essentially the very best we have had.

I want to express some thanks to the writer for rescuing me from this crisis. Right after scouting throughout the internet and getting basics which are not beneficial, I thought my entire life was over. Living without the presence of approaches to the issues you have fixed by way of the article content is a crucial case, and those that could have in a negative way affected my career if I hadn't encountered your website. The ability and kindness in maneuvering every item was vital. I'm not sure what I would've done if I hadn't come across such a stuff like this. I can also at this point look ahead to my future. Thanks very much for the specialized and sensible guide. I won't think twice to endorse your site to anybody who ought to have tips about this matter.

I precisely had to appreciate you again. I am not sure what I might have used without the type of tips and hints shared by you over such problem. This was an absolute alarming matter for me, but viewing this specialised manner you dealt with it made me to jump for contentment. I'm just happy for this help and even expect you realize what an amazing job your are undertaking educating many people using your blog. Probably you have never got to know all of us.

I'm also commenting to make you be aware of of the great experience my child undergone reading yuor web blog. She noticed a wide variety of issues, most notably how it is like to have a wonderful teaching spirit to get most people without problems fully grasp various specialized things. You actually did more than people's expected results. I appreciate you for delivering the important, trustworthy, edifying and in addition cool tips about the topic to Julie.

My husband and i have been really thankful when Chris managed to finish off his studies while using the ideas he gained out of the site. It's not at all simplistic to simply happen to be offering steps which often some others could have been selling. And now we remember we need the blog owner to appreciate for this. Those illustrations you made, the simple website navigation, the friendships you will make it possible to engender - it is all unbelievable, and it is letting our son in addition to us know that this theme is pleasurable, which is certainly particularly essential. Many thanks for the whole thing!

Needed to draft you the little bit of note so as to thank you yet again for all the precious basics you've shown on this website. This has been certainly particularly generous with you to grant publicly just what a number of people might have marketed for an e-book to earn some dough on their own, chiefly considering that you might well have tried it if you ever desired. The advice additionally served to provide a good way to understand that many people have similar zeal similar to my own to figure out a good deal more in regard to this matter. I believe there are several more pleasurable opportunities up front for folks who read through your blog.

Thank you so much for providing individuals with an exceptionally splendid chance to read from here. It is always very great plus jam-packed with a great time for me personally and my office fellow workers to visit your blog no less than thrice a week to find out the new things you have got. And indeed, I am just certainly contented concerning the eye-popping tactics served by you. Some 1 ideas in this article are clearly the most impressive we've ever had.

I would like to express thanks to this writer just for bailing me out of this predicament. After surfing around throughout the world wide web and coming across principles which were not pleasant, I thought my entire life was gone. Existing devoid of the strategies to the difficulties you've solved through your guideline is a critical case, and the ones that could have in a wrong way damaged my career if I hadn't noticed the blog. Your main mastery and kindness in dealing with all the details was excellent. I don't know what I would've done if I had not discovered such a thing like this. I can at this point relish my future. Thank you so much for your expert and effective help. I will not think twice to recommend your web blog to anyone who should receive direction on this subject matter.

My spouse and i felt really thrilled John could deal with his web research through the precious recommendations he had from your very own weblog. It's not at all simplistic to simply possibly be handing out helpful hints which usually some other people have been selling. Therefore we consider we have the website owner to be grateful to for that. The entire illustrations you've made, the easy web site navigation, the relationships you will help to instill - it's got most exceptional, and it's really making our son and the family understand the theme is exciting, and that is truly important. Thanks for everything!

My husband and i have been now fulfilled Michael managed to carry out his investigations by way of the precious recommendations he got when using the web page. It is now and again perplexing to simply continually be giving for free helpful tips which the others have been making money from. And now we fully grasp we've got the writer to thank because of that. Most of the illustrations you have made, the easy web site menu, the friendships your site help promote - it's got many fantastic, and it's assisting our son and us feel that this content is interesting, which is certainly incredibly serious. Many thanks for all the pieces!

Youre so cool! I dont suppose Ive read anything like this before. So nice to seek out any individual with some authentic thoughts on this subject. realy thank you for starting this up. this website is something that's needed on the web, somebody with somewhat originality. useful job for bringing one thing new to the web!

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 enjoy you because of your own effort on this website. Kim takes pleasure in conducting internet research and it's really simple to grasp why. Almost all learn all relating to the compelling manner you create functional secrets by means of the blog and in addition foster response from other people on the concern then our favorite daughter is in fact being taught a lot. Take advantage of the remaining portion of the year. You have been performing a good job.

I must express my appreciation to the writer for rescuing me from this particular predicament. As a result of exploring throughout the online world and getting techniques which are not helpful, I figured my life was gone. Being alive devoid of the strategies to the issues you've resolved through your main report is a critical case, and ones which may have badly damaged my entire career if I had not encountered your web page. Your primary competence and kindness in touching a lot of stuff was helpful. I don't know what I would've done if I hadn't come upon such a step like this. I'm able to now look forward to my future. Thank you very much for this skilled and effective help. I will not be reluctant to refer your web sites to any person who needs to have counselling about this subject.

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.

I enjoy you because of all of the work on this website. Ellie takes pleasure in carrying out research and it is obvious why. We all know all concerning the dynamic tactic you offer precious ideas by means of your website and as well increase response from some other people on that article so our favorite girl is in fact discovering a lot. Have fun with the rest of the year. You have been performing a pretty cool job.

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.

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.