{"id":6128,"date":"2024-03-04T05:00:13","date_gmt":"2024-03-04T05:00:13","guid":{"rendered":"https:\/\/robertjwallace.com\/?p=6128"},"modified":"2024-03-06T03:30:18","modified_gmt":"2024-03-06T03:30:18","slug":"espresense-and-home-assistant","status":"publish","type":"post","link":"https:\/\/robertjwallace.com\/es\/espresense-and-home-assistant\/","title":{"rendered":"ESPresense and Home Assistant"},"content":{"rendered":"<!-- Added by Post\/Page Specific Custom Code plugin, thank you for using! -->\n<style>img { padding: 3px; border:2px solid black; }<\/style>\n\n<p>This post serves as my personal record of the steps required to integrate an ESPresense ESP-32 device into my Home Assistant setup. Additionally, I hope it will be helpful to others. The screenshots included were taken in February 2024 and might have been updated since then.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ESPresense<\/strong>:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ESPresense constitutes a dedicated hardware unit centered on an ESP32 microcontroller, renowned in IoT (Internet of Things) endeavors for its affordability and inherent Wi-Fi functionalities. Employing Bluetooth, it functions as a presence sensor, syncing with a wearable Bluetooth-enabled device, such as a smartwatch in my instance.<\/li>\n\n\n\n<li>Facilitating communication with Home Assistant, the ESPresense device utilizes MQTT (Message Queuing Telemetry Transport) integration to transmit data regarding detected presence occurrences or sensor data.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Requirements:<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>An ESP32 development board that is compatible with ESPresense.  There are videos describing these as well as a list of them on <a href=\"https:\/\/espresense.com\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/espresense.com<\/a>.  <br><br>The ones I used are from Amazon.com: &#8220;<em><a href=\"https:\/\/www.amazon.com\/dp\/B0B764963C?ref=ppx_yo2ov_dt_b_product_details&amp;th=1\">AITRIP 3PCS 38Pins Type-C USB ESP32S ESP32 ESP-WROOM-32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters for Arduino IDE<\/a><\/em>&#8220;<br><img decoding=\"async\" width=\"150\" height=\"113\" class=\"wp-image-6151 lazyload\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/113;width: 150px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005034.jpeg\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\">         <img decoding=\"async\" width=\"150\" height=\"113\" class=\"wp-image-6152 lazyload\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/113;width: 150px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005035.jpeg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005035.jpeg 1468w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005035-300x225.jpeg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005035-1024x768.jpeg 1024w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/1000005035-768x576.jpeg 768w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>An essential component is a USB cable featuring the same connector as the ESP32 board, designed explicitly for data transmission. Differentiating between charging and data cables can be challenging. To ascertain a cable&#8217;s functionality, connect it between your phone and a computer or any other data transfer-capable device. If the computer recognizes your phone and allows file or data transfer, the cable supports data transmission. Conversely, if the device solely charges without enabling data transfer, it likely serves as a charging-only cable.<\/li>\n\n\n\n<li>The MQTT Broker installed in Home Assistant.  A good description of how to do this is at <a href=\"https:\/\/pimylifeup.com\/home-assistant-mqtt\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/pimylifeup.com\/home-assistant-mqtt\/<\/a><\/li>\n\n\n\n<li>A Windows computer.  I typically use Linux but kept getting errors when I tried to send the ESPresence code to the ESP-32.  I tried installing drivers, etc. but finally said &#8220;screw it&#8221; and pulled out a Windows Laptop which worked just fine.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps:<\/strong><\/h2>\n\n\n\n<p>Part one &#8211; installing the software onto the ESP32<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Plug the USB cable into the ESP32 and the other end into your Windows Computer.<\/li>\n\n\n\n<li>Open a web browser, either Chrome or Edge.  I used Chrome. Navigate to <a href=\"https:\/\/espresense.com\/firmware\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/espresense.com\/firmwar<\/a>e<br><br><img decoding=\"async\" width=\"500\" height=\"293\" class=\"wp-image-6130 lazyload\" style=\"--smush-placeholder-width: 500px; --smush-placeholder-aspect-ratio: 500\/293;width: 500px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image.png\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image.png 1612w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image-300x176.png 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image-1024x601.png 1024w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image-768x451.png 768w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/image-1536x901.png 1536w\" data-sizes=\"(max-width: 500px) 100vw, 500px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>Click the &#8220;CONNECT&#8221; button and the page will look for the PC to ESP32 connection.  You should see something like:<br><br>:<img decoding=\"async\" width=\"400\" height=\"370\" class=\"wp-image-6131 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/370;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart.jpg 997w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart-300x278.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart-768x711.jpg 768w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br><\/li>\n\n\n\n<li>Select the line with your mouse and click Connect:<br><br><img decoding=\"async\" width=\"400\" height=\"368\" class=\"wp-image-6132 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/368;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart1.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart1.jpg 885w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart1-300x276.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/uart1-768x707.jpg 768w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>After connecting you should see a popup:<br><br><img decoding=\"async\" width=\"300\" height=\"184\" class=\"wp-image-6133 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/184;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/dashboard.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/dashboard.jpg 612w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/dashboard-300x184.jpg 300w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>Click the &#8220;INSTALL ESPRESENSE&#8221; menu item to start the install.<\/li>\n\n\n\n<li>A second popup appears.  I choose to erase device, then click NEXT<br><br><img decoding=\"async\" width=\"300\" height=\"201\" class=\"wp-image-6134 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/201;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase.jpg 785w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase-300x201.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase-768x516.jpg 768w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase-600x400.jpg 600w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/erase-272x182.jpg 272w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>Yet another popup appears asking for confirmation.  Click INSTALL:<br><br><img decoding=\"async\" width=\"300\" height=\"166\" class=\"wp-image-6135 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/166;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/confirm.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/confirm.jpg 750w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/confirm-300x166.jpg 300w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>The installation process will start and status messages will appear in the popup.  It takes a couple of minutes for the software to install.<\/li>\n\n\n\n<li>Of course when I tried this I got an error:<br><br><img decoding=\"async\" width=\"300\" height=\"221\" class=\"wp-image-6136 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/221;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/failed.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/failed.jpg 791w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/failed-300x221.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/failed-768x565.jpg 768w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>So I pressed back, and tried again, this time holding the &#8220;boot&#8221; button on the ESP32 down until the install actually started to show a progress bar.<br><br><img decoding=\"async\" width=\"300\" height=\"214\" class=\"wp-image-6160 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/214;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/installing.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/installing.jpg 980w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/installing-300x214.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/installing-768x547.jpg 768w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>When the installation is complete you will get the completion message:<br><br><img decoding=\"async\" class=\"wp-image-6137 lazyload\" style=\"--smush-placeholder-width: 602px; --smush-placeholder-aspect-ratio: 602\/429;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/complete.jpg\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\"><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Part 2 &#8211; configuration<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the steps that follow you will need the MAC address of the device, in my case my Amazefit watch, that you are going to use. You are going to use the MAC address to get the device id of the device you are going to use with the ESPresense sensors. You can use an Android Bluetooth App to  get the MAC address of your device. I find this to be the easiest way. I use the app BLE Scanner, but there are others. Find the find the address and write it down.<\/li>\n\n\n\n<li>After clicking NEXT you are prompted to enter the SID network name and password you want the ESP32 to connect to:<br><img decoding=\"async\" width=\"300\" height=\"241\" class=\"wp-image-6161 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/241;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/wifi.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/wifi.jpg 907w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/wifi-300x241.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/wifi-768x618.jpg 768w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>I skipped this and went to a new popup that let me look at the logs, click on the LOGS &amp; CONSOLE link.  At this step I have gotten different responses.  I either see the following popup:<br><br><img decoding=\"async\" width=\"300\" height=\"314\" class=\"wp-image-6164 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/314;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/consolelog.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/consolelog.jpg 644w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/consolelog-287x300.jpg 287w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br><br>or I get:<br><img decoding=\"async\" width=\"300\" height=\"278\" class=\"wp-image-6178 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/278;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/config1.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/config1.jpg 598w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/config1-300x278.jpg 300w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>In the first case you can click the link to go to the LOGS &amp; CONSOLE page. Reset the ESP32 and it should start displaying Bluetooth devices that it sees. Look for the device with the MAC address that matches your device. You should have your device near the ESP32.  To the right of the MAC address is the device_id. Sometimes they are the same, but in my case they were different.  In the image below you see the device id mifit:ca7f057a726c.  Copy yours down, you will need it later.<br><img decoding=\"async\" width=\"600\" height=\"546\" class=\"wp-image-6162 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/546;width: 600px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs.jpg 1707w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs-300x273.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs-1024x931.jpg 1024w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs-768x698.jpg 768w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/logs-1536x1397.jpg 1536w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>In the second case when you go to the LOGS &amp; CONSOLE page you will see:<br><img decoding=\"async\" width=\"500\" height=\"280\" class=\"wp-image-6179 lazyload\" style=\"--smush-placeholder-width: 500px; --smush-placeholder-aspect-ratio: 500\/280;width: 500px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/second.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/second.jpg 1356w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/second-300x168.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/second-1024x574.jpg 1024w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/second-768x430.jpg 768w\" data-sizes=\"(max-width: 500px) 100vw, 500px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>Note that the ESPresense code has started a network access point.<\/li>\n\n\n\n<li>In each of the two cases you will need your MQTT information.  In a new tab go to your home assistant web page and navigate to Settings->Integrations->MQTT.  Click on the configure link and then click on the re-configure MQTT link.   This will display a page with the settings you will need to copy into the ESPpresense configuration.  <\/li>\n\n\n\n<li>Return to the espresense.com tab.<\/li>\n\n\n\n<li>You now are going to go to the ESPresense configuration web page.  In the first case you just need to click the Back link and then click the &#8220;Visit Site&#8221; link.  It will connect to the IP address of the ESP32, which is the ESPresense configuration page.  In the second case you need to connect to the new access point by opening your network settings and finding the access point that starts with &#8220;espresence-&#8220;. Connect to that network.<br><img decoding=\"async\" width=\"300\" height=\"456\" class=\"wp-image-6143 lazyload\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/456;width: 300px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/network.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/network.jpg 841w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/network-197x300.jpg 197w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/network-673x1024.jpg 673w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/network-768x1168.jpg 768w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>When you connect it should automatically open a tab to the configuration page at 192.168.1.4.  <\/li>\n\n\n\n<li>So in either case you should now be at the ESPresense configuration page.  But in the second case you have not yet discovered your device_id.  So change tabs to the espresense.com\/firmware page, and on the log page reset the ESP32.  It should then list the Devices and you should be able to find the device id you need.  Then go back to the ESPresense tab.<br><br><img decoding=\"async\" class=\"wp-image-6140 lazyload\" style=\"--smush-placeholder-width: 546px; --smush-placeholder-aspect-ratio: 546\/622;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/config-1.jpg\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\"><br>Enter your network SID and wifi password, then fill out the MQTT section using the values from the Home Assistant tab. When done, click the Save button, then click the Restart Button.  The web page will say &#8220;Bye!&#8221;.  Now disconnect from the espresense- network and reconnect to your standard network.<\/li>\n\n\n\n<li>Go back to the Home Assistant Integration page and select MQTT again.  You should see an added device on the page. In my case I had two already installed and now it is showing 3 devices.<br><img decoding=\"async\" width=\"400\" height=\"137\" class=\"wp-image-6141 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/137;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/MQTT.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/MQTT.jpg 528w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/MQTT-300x103.jpg 300w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>Clicking on the &#8220;3 Devices&#8221; show the list of the devices.<br><img decoding=\"async\" width=\"400\" height=\"249\" class=\"wp-image-6138 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/249;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/mqttdevices.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/mqttdevices.jpg 511w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/mqttdevices-300x187.jpg 300w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>Adjusting the distance on each ESP32 can be done by clicking on the device name in the MQTT list of devices (see the image in step 4).  When you go to the device page there are two sections.  One is configuration, this is where you can change the value for distance:<br><img decoding=\"async\" width=\"400\" height=\"305\" class=\"wp-image-6155 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/305;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/Distance.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/Distance.jpg 715w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/Distance-300x229.jpg 300w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>Then you can update that value to the ESP32 in the Diagnostics section:<br><img decoding=\"async\" width=\"400\" height=\"282\" class=\"wp-image-6156 lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/282;width: 400px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/updateesp.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/updateesp.jpg 326w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/updateesp-300x212.jpg 300w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/li>\n\n\n\n<li>Now you need to create a sensor in your configuration.yaml file.  This is easy to do, simply add the lines:<br><img decoding=\"async\" width=\"500\" height=\"152\" class=\"wp-image-6157 lazyload\" style=\"--smush-placeholder-width: 500px; --smush-placeholder-aspect-ratio: 500\/152;width: 500px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/configyaml.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/configyaml.jpg 516w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/configyaml-300x91.jpg 300w\" data-sizes=\"(max-width: 500px) 100vw, 500px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>where you replace the name: with what you want to call your sensor.  I am using my smart watch, which is an Amazefit watch.  The name can be anything you want.  The device id needs to be the id of the watch, which is it&#8217;s Bluetooth id.  This id is also in the state_topic line.  This is the id you got in step 3.<\/li>\n\n\n\n<li>You can now test this by going to the Developer section in Home Assistant and using the State tab.  Enter your sensor name in the search box and you should find it:<br><img decoding=\"async\" width=\"500\" height=\"52\" class=\"wp-image-6165 lazyload\" style=\"--smush-placeholder-width: 500px; --smush-placeholder-aspect-ratio: 500\/52;width: 500px;\" data-src=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/developer.jpg\" alt=\"\" data-srcset=\"https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/developer.jpg 881w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/developer-300x31.jpg 300w, https:\/\/robertjwallace.com\/wp-content\/uploads\/2024\/03\/developer-768x80.jpg 768w\" data-sizes=\"(max-width: 500px) 100vw, 500px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><br>Now you can use the sensor in automatons.  What is cool is that when you have multiple ESP32s with ESPresense the state value of the sensor will automatically change to the ESP32 name closest to your watch (of whatever device you are using)<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusions<\/h2>\n\n\n\n<p><br>I&#8217;m intrigued by the concept, but I&#8217;m still experimenting with it. Currently, I&#8217;m on the ground floor beneath my bedroom in my two-story house, without an ESP32 device in this area yet. Consequently, Home Assistant is detecting the bedroom sensor located above me. Additionally, since I don&#8217;t have complete coverage throughout the house, there are instances where it registers me as &#8220;not home,&#8221; despite my presence. This issue arises because it&#8217;s unable to detect any of the sensors. I believe the solution lies in adding more sensors to enhance coverage.<\/p>","protected":false},"excerpt":{"rendered":"<p>This post serves as my personal record of the steps required to integrate an ESPresense ESP-32 device into my Home Assistant setup. Additionally, I hope it will be helpful to others. The screenshots included were taken in February 2024 and might have been updated since then.<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_eb_attr":"","footnotes":""},"categories":[143,166],"tags":[169],"class_list":["post-6128","post","type-post","status-publish","format-standard","hentry","category-computer-stuff","category-home-assistant","tag-espresense"],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Bob","author_link":"https:\/\/robertjwallace.com\/es\/author\/admin\/"},"_links":{"self":[{"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/posts\/6128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/comments?post=6128"}],"version-history":[{"count":11,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/posts\/6128\/revisions"}],"predecessor-version":[{"id":6180,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/posts\/6128\/revisions\/6180"}],"wp:attachment":[{"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/media?parent=6128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/categories?post=6128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robertjwallace.com\/es\/wp-json\/wp\/v2\/tags?post=6128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}