{"id":1462,"date":"2023-03-27T12:09:32","date_gmt":"2023-03-27T12:09:32","guid":{"rendered":"https:\/\/www.creatingsmarthome.com\/?p=1462"},"modified":"2025-01-18T07:29:39","modified_gmt":"2025-01-18T07:29:39","slug":"guide-bluetooth-proxy-to-home-assistant-using-esphome","status":"publish","type":"post","link":"https:\/\/www.creatingsmarthome.com\/index.php\/2023\/03\/27\/guide-bluetooth-proxy-to-home-assistant-using-esphome\/","title":{"rendered":"Guide: Bluetooth Proxy to Home Assistant  using ESPHome"},"content":{"rendered":"\n<p>In previous post I briefly looked into SwitchBot Bluetooth ecosystem and promised to write a post about setting up a Bluetooth Proxy using ESP32 and ESPHome. In this post I&#8217;m going through the process of installing ESPHome and flashing Bluetooth Proxy into an ESP32 device and connecting BLE device to Home Assistant through it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ESP32, ESPHome and Bluetooth Proxy<\/h2>\n\n\n\n<p><strong>ESP32, ESPHome and Bluetooth Proxy<\/strong>? A little introduction to get used to these terms..<\/p>\n\n\n\n<p><strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.espressif.com\/en\/products\/socs\/esp32\" data-type=\"URL\" data-id=\"https:\/\/www.espressif.com\/en\/products\/socs\/esp32\" target=\"_blank\">ESP32<\/a><\/strong> is a MCU with integrated WiFi and Bluetooth (successor of popular ESP8266). ESP32 a very powerful and has low power consumption. In theory, it can be battery operated if put on a deep sleep, but with casual use cases a permanent power connection is required. ESP32 software can be developed with easy to learn <a rel=\"noreferrer noopener\" href=\"https:\/\/www.circuito.io\/blog\/arduino-code\/\" data-type=\"URL\" data-id=\"https:\/\/www.circuito.io\/blog\/arduino-code\/\" target=\"_blank\">Arduino<\/a>, but is not excluded to only that.<\/p>\n\n\n\n<p><strong><a rel=\"noreferrer noopener\" href=\"https:\/\/esphome.io\" data-type=\"URL\" data-id=\"https:\/\/esphome.io\" target=\"_blank\">ESPHome<\/a><\/strong> is a platform developed for ESP32\/ESP8266 and is mainly used for Smart Home devices. ESPHome has tons of ready made configurations, libraries and examples. In 2021 Nabu Casa (Home Assistant developer company) <a rel=\"noreferrer noopener\" href=\"https:\/\/www.home-assistant.io\/blog\/2021\/03\/18\/nabu-casa-has-acquired-esphome\/\" data-type=\"URL\" data-id=\"https:\/\/www.home-assistant.io\/blog\/2021\/03\/18\/nabu-casa-has-acquired-esphome\/\" target=\"_blank\">acquired ESPHome<\/a> and integrated the whole ESPHome system more deep into the Home Assistant Core. These days ESPHome can be installed directly from Home Assistant Add-On store and configured from Home Assistant UI!<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/esphome.github.io\/bluetooth-proxies\/\" data-type=\"URL\" data-id=\"https:\/\/esphome.github.io\/bluetooth-proxies\/\" target=\"_blank\"><strong>Bluetooth Proxy<\/strong><\/a> is a gateway software that listens for <em>&#8216;all&#8217;<\/em> Bluetooth traffic and forwards them to the Home Assistant instance. Basically BLE to WiFi gateway.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Required Hardware<\/h2>\n\n\n\n<p>In this project we are going to need few items: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/amzn.to\/3yn4wmr\" data-type=\"URL\" data-id=\"amazon.de\/-\/en\/Espressif-Development-Bluetooth-WROOM32-NodeMCU\/dp\/B07K68RQTS\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32 development board<\/a> <strong>[<a href=\"https:\/\/amzn.to\/3yn4wmr\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.de<\/a>, <a href=\"https:\/\/www.amazon.com\/ESP-WROOM-32-Development-Microcontroller-Integrated-Compatible\/dp\/B08D5ZD528?crid=3QNZHGH803TH0&amp;dib=eyJ2IjoiMSJ9.XBINg-sjhfF_gUtnMiKGjo6krKzkTp-dHnP9KceEUJVEqdhLMfcqRJbPwHabZCRHdmxnECGNRVhK0TJLgAoYSllz94z-CwLWvdV8vRZzgS8bOeq5TZLYSvWKdoniw823gpvgSrUfEJOehJeYOFxPzevB1Kt9sFdaUCBElPrXX8XICggZTzSt03UPDB1mr3ZtUPB1c6MJLWca3Cuspix9Ei2lkhbb6qZsJaA6w_RntOA.bUBVgMms51-5F4v4uyl32O9Bgunfw8So3tqlld3Km3g&amp;dib_tag=se&amp;keywords=esp32%2Bwroom&amp;qid=1736774461&amp;sprefix=esp32wroom%2Caps%2C250&amp;sr=8-3&amp;th=1&amp;linkCode=ll1&amp;tag=creatingsma05-20&amp;linkId=9cd5c85d0823e7f2dd291d57039ef541&amp;language=en_US&amp;ref_=as_li_ss_tl\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.com<\/a>]<\/strong>\n<ul class=\"wp-block-list\">\n<li>ESP32 development board has an ESP32 chip (Bluetooth and Wifi already integrated) plus an USB interface for powering up flashing.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/amzn.to\/4cYI2ao\" data-type=\"URL\" data-id=\"https:\/\/www.amazon.de\/-\/en\/Charger-Adapter-Universal-Compatible-Tablets-White\/dp\/B08ZM87MXZ\" target=\"_blank\" rel=\"noreferrer noopener\">5v USB Power supply<\/a> <strong>[<a href=\"https:\/\/amzn.to\/40cJYqH\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.de<\/a>, <a href=\"https:\/\/www.amazon.com\/Certified-Charger-Universal-Portable-Adapter\/dp\/B017TXGM4I?crid=WE296HUE4P0F&amp;dib=eyJ2IjoiMSJ9.NwxSVbGFYngAMr6XEzewlyNv4WrsYWRCdSdOh9zfm6INX1_ZaaW8AzIiFtiLvZbHk56sFDpPJZYQckqKa0Nt12ww-kvCj08N1ha9-_Tu3KwqXu7p1z28csCFrHv6UEHzrha8XIYluSuTHZmXLI2WzijXxIQ6inYSzDpmiKtyQg31vqV1rWh7gR0fxs84_Qwrqi5L_arQjF6e9SGE8AAsZT3vGlMXZYmOXIgvEIlXESw.zfokTJFy2Eb-wPY5xBek8yPm_gFSsK5DAaK3wzq8_68&amp;dib_tag=se&amp;keywords=5v+power+supply+usb&amp;qid=1736774382&amp;sprefix=5v+power+supply+u%2Caps%2C206&amp;sr=8-3&amp;linkCode=ll1&amp;tag=creatingsma05-20&amp;linkId=cee1ab1b9b1c911e0c0a60e9c6a754e1&amp;language=en_US&amp;ref_=as_li_ss_tl\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.com<\/a>]<\/strong> providing at least 0.5 amps (an old cellphone charger will do fine)<\/li>\n\n\n\n<li><a href=\"https:\/\/amzn.to\/3A0o2pj\" data-type=\"URL\" data-id=\"https:\/\/www.amazon.de\/-\/en\/UGREEN-Braided-Micro-Charging-Cable\/dp\/B07Z8QMGHZ\/\" target=\"_blank\" rel=\"noreferrer noopener\">Micro USB cable<\/a> <strong>[<a href=\"https:\/\/amzn.to\/3A0o2pj\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.de<\/a>, <a href=\"https:\/\/www.amazon.com\/Amazon-Basics-Charging-Transfer-Gold-Plated\/dp\/B071S5NTDR?crid=2QAQBTD9I32ZE&amp;dib=eyJ2IjoiMSJ9.rSYhst0nziHalda2xD0T9kLOhEi0ecBeF4v5LtWmTVUBxukeBR2llIjhproLlQ9bfDM7t9y9LzEKzFCUSAiFwPW6A2ydIr4WHmwwySXQSaTsFlaaLjkdquEeR3Xo8ubV4f8sg1dFdovMd3C2Kx0uOcAXRvP8REYebPcFoqkaBt8AUukvS0JQ028oTXmzXZd3TUB8sE4-TFwD3QX4sVa4z1qZPFiU9fNuRw-j1dNMcJw.FFh3lvjo1U0vHJGHMVdsztwstD3ZGyQvBk9uTXDAe5o&amp;dib_tag=se&amp;keywords=micro%2Busb%2Bcable&amp;qid=1736774118&amp;sprefix=micro%2Busb%2Bcab%2Caps%2C229&amp;sr=8-1-spons&amp;sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&amp;th=1&amp;linkCode=ll1&amp;tag=mobilea02d0b5-20&amp;linkId=f84f98b3bc85f969b572980f33e93ca4&amp;language=en_US&amp;ref_=as_li_ss_tl\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.com<\/a>]<\/strong><\/li>\n\n\n\n<li>Optional: Plastic enclosure to fit the ESP32 devkit (or 3D printer)<\/li>\n<\/ul>\n\n\n\n<p>Note: I&#8217;ve tested this with two different development boards, <strong>ESP32 Wroom devkit v1<\/strong> and <strong>ESP32 Wroom devkit v2<\/strong>, but for some odd reason the devkit v2 did not work properly with flashing esp-idf type of framework. You can find the exact device I&#8217;ve used from Amazon using these links:<strong> <a href=\"https:\/\/amzn.to\/3yn4wmr\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.de<\/a>, <a href=\"https:\/\/www.amazon.com\/ESP-WROOM-32-Development-Microcontroller-Integrated-Compatible\/dp\/B08D5ZD528?crid=3QNZHGH803TH0&amp;dib=eyJ2IjoiMSJ9.XBINg-sjhfF_gUtnMiKGjo6krKzkTp-dHnP9KceEUJVEqdhLMfcqRJbPwHabZCRHdmxnECGNRVhK0TJLgAoYSllz94z-CwLWvdV8vRZzgS8bOeq5TZLYSvWKdoniw823gpvgSrUfEJOehJeYOFxPzevB1Kt9sFdaUCBElPrXX8XICggZTzSt03UPDB1mr3ZtUPB1c6MJLWca3Cuspix9Ei2lkhbb6qZsJaA6w_RntOA.bUBVgMms51-5F4v4uyl32O9Bgunfw8So3tqlld3Km3g&amp;dib_tag=se&amp;keywords=esp32%2Bwroom&amp;qid=1736774461&amp;sprefix=esp32wroom%2Caps%2C250&amp;sr=8-3&amp;th=1&amp;linkCode=ll1&amp;tag=creatingsma05-20&amp;linkId=9cd5c85d0823e7f2dd291d57039ef541&amp;language=en_US&amp;ref_=as_li_ss_tl\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon.com<\/a><\/strong>. Most probably other ESP32 dev kits works as well, but I&#8217;ve not tested them my self, so can&#8217;t say 100% sure that others works the same.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing ESPHome into Home Assistant<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/esphome.io\" data-type=\"URL\" data-id=\"https:\/\/esphome.io\" target=\"_blank\">ESPHome<\/a> is now days hosted within the Official Home Assistant Add-On Store and can be installed to the Home Assistant without any problems. Just head over to <em><strong>Home Assistant Settings -&gt; Add-On Store -&gt; Select ESPHome and press the install<\/strong><\/em>.<\/p>\n\n\n\n<p>Once installed I&#8217;d suggest to set on the Watchdog switch in order for ESPHome to restart it if crashing at anytime for any reason. Also press &#8216;start&#8217; button to start the ESPHome container in your environment. <\/p>\n\n\n\n<p>Now the ESPHome service should be fully running and can be opened from &#8220;<strong><em>Open Web UI<\/em><\/strong>&#8221; -button bottom of the ESPHome Add-on page. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1048\" height=\"566\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-13.23.57.png\" alt=\"\" class=\"wp-image-1589\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Flashing Bluetooth Proxy<\/h2>\n\n\n\n<p>Now it&#8217;s time to get really things started and setup the proper configurations for the ESP32! Open <strong>ESPHome UI<\/strong> from ESPHome Add-on page and connect the ESP32 device to your PC using a micro USB cable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create a new config<\/h3>\n\n\n\n<p>First initial configuration is needed to be created. Let&#8217;s start by pressing the <strong><em>plus-button<\/em><\/strong> in the bottom right corner and let&#8217;s name the device as &#8220;<strong><em>Bluetooth Proxy<\/em><\/strong>&#8220;. Next select a <strong>Generic ESP32<\/strong> as a device (unless you have some other specific ESP32 dev board that is in the list). <\/p>\n\n\n\n<p>Generated encryption key should be now shown, but you can safely ignore it. It will be automatically added to the configuration once finished. So just press &#8220;<strong><em>Skip<\/em><\/strong>&#8221; button and we continue editing in the edit view.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-3 wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"258\" data-id=\"1543\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-9.50.34.png\" alt=\"\" class=\"wp-image-1543\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"410\" height=\"496\" data-id=\"1541\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-9.50.39.png\" alt=\"\" class=\"wp-image-1541\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"516\" data-id=\"1540\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-9.50.53.png\" alt=\"\" class=\"wp-image-1540\"\/><\/figure>\n<\/figure>\n\n\n\n<p>After finished and initial config is created, open the newly created configuration by pressing &#8220;<strong><em>edit<\/em><\/strong>&#8221; from the <em>Bluetooth Proxy<\/em> device at ESPHome WEB UI.<\/p>\n\n\n\n<p>Now we need to add the Bluetooth Proxy support for our configuration. Fill in the missing parts of the configuration from the code below (<strong>esp32_ble_tracker<\/strong> and <strong>bluetooth_proxy<\/strong> -blocks). Also remember to change the <strong>framework type<\/strong> to <strong><em>esp-idf<\/em><\/strong>! This is important, since the bluetooth proxy performance is quite poor on default Arduino framework. Don&#8217;t copy the below configuration totally, since the encryption key and other password should be unique to your device and environment. I&#8217;ve altered those values in my configuration shown here.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>esphome:\n  name: bluetooth-proxy\n  friendly_name: Bluetooth Proxy\n\nesp32:\n  board: esp32dev\n  framework:\n    type: esp-idf\n\n# Enable logging\nlogger:\n\n# Enable Home Assistant API\napi:\n  encryption:\n    key: \"REMOVED\"\n\nota:\n  password: \"REMOVED\"\n  platform: esphome\n\nwifi:\n  ssid: !secret wifi_ssid\n  password: !secret wifi_password\n\n  # Enable fallback hotspot in case wifi connection fails\n  ap:\n    ssid: \"Bluetooth-Proxy Fallback Hotspot\"\n    password: \"REMOVED\"\n\nesp32_ble_tracker:\n  scan_parameters:\n    interval: 1100ms\n    window: 1100ms\n    active: true\n\nbluetooth_proxy:\n  active: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Flashing the device<\/h3>\n\n\n\n<p>Once modifications are in place, we just need to flash it on the ESP32 device. For this, <strong>Google Chrome<\/strong> or <strong>Microsoft Edge<\/strong> browser is required. So using Google Chrome press the &#8220;<strong><em>install<\/em><\/strong>&#8221; button in the current view and select the corresponding com port the device is connected to using USB cable. Port name should be something like: &#8216;<strong><em>CP2102 USB to UART Bridge Controller (Com 4)<\/em><\/strong>&#8216;<\/p>\n\n\n\n<p>After this step the programming should begin processing and will take couple of minutes until completed. <\/p>\n\n\n\n<p>After the first time flashing the device, it can be re-flashed wirelessly. In fact, Home Assistant will notify if ESPHome is updated and will ask you to update the device (wirelessly) when a new ESPHome update is pushed out.<\/p>\n\n\n\n<p>Once done, move to the next step.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-4 wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"458\" data-id=\"1562\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/esphome_install.png\" alt=\"\" class=\"wp-image-1562\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"433\" height=\"380\" data-id=\"1566\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/esphome_select_port.png\" alt=\"\" class=\"wp-image-1566\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"229\" data-id=\"1564\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/esphome_installing.png\" alt=\"\" class=\"wp-image-1564\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"284\" height=\"200\" data-id=\"1563\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/esphome_install_completed.png\" alt=\"\" class=\"wp-image-1563\"\/><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Adding the proxy to Home Assistant<\/h3>\n\n\n\n<p>After installation, when ESP32 has properly started up, a notification of a new device should appear in the Home Assistant notification center. Clicking this notification will take you to the Home Assistant devices &amp; integrations -view and will kindly ask you to configure the Bluetooth Proxy device. So click it, add an area you are planning to place the device and you&#8217;re all done! The proxy is now ready for use!<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-4 wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"238\" data-id=\"1547\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.41.53.png\" alt=\"\" class=\"wp-image-1547\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"337\" height=\"156\" data-id=\"1545\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.41.58.png\" alt=\"\" class=\"wp-image-1545\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"179\" data-id=\"1546\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.03.png\" alt=\"\" class=\"wp-image-1546\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"325\" data-id=\"1548\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.11.png\" alt=\"\" class=\"wp-image-1548\"\/><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Discovering Bluetooth devices<\/h3>\n\n\n\n<p>You can now disconnect the device from PC and connect it to the power supply using a micro USB cable.<\/p>\n\n\n\n<p>Proxy should now start and automatically discover all nearby supported Bluetooth devices in range. All of those devices will be notified in the same Home Assistant notification area and clicking those notifications will take you to the Home Assistant devices &amp; integrations page once again.. and again kindly ask you to configure the bluetooth devices.<\/p>\n\n\n\n<p>In my case, the <a rel=\"noreferrer noopener\" href=\"https:\/\/eu.switch-bot.com\/products\/switchbot-meter-plus\" data-type=\"URL\" data-id=\"https:\/\/eu.switch-bot.com\/products\/switchbot-meter-plus\" target=\"_blank\">SwitchBot Meter Plus<\/a> was discovered as should and configuration was to just add the device area. Once that was done the device started sending values for the Home Assistant immediately! <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-5 wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"240\" data-id=\"1553\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.18.png\" alt=\"\" class=\"wp-image-1553\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"331\" height=\"158\" data-id=\"1552\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.22.png\" alt=\"\" class=\"wp-image-1552\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"408\" height=\"171\" data-id=\"1549\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.31.png\" alt=\"\" class=\"wp-image-1549\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"317\" data-id=\"1554\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-27-at-10.42.37.png\" alt=\"\" class=\"wp-image-1554\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"283\" height=\"172\" data-id=\"1508\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-22-at-8.18.53.png\" alt=\"\" class=\"wp-image-1508\"\/><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating an enclosure (optional)<\/h2>\n\n\n\n<p>It&#8217;s not a good practice to install electrical devices exposed to dust, so it&#8217;s nice to have an enclosure for the device. If you have a 3D Printer available, I&#8217;d suggest to find a 3D model for the ESP32 case (depending on your dev board) from e.g. <a rel=\"noreferrer noopener\" href=\"https:\/\/www.thingiverse.com\" data-type=\"URL\" data-id=\"https:\/\/www.thingiverse.com\" target=\"_blank\">Thingiverse<\/a>. As said earlier, I&#8217;m using a Wroom32 devkit v1 and found <a rel=\"noreferrer noopener\" href=\"https:\/\/www.thingiverse.com\/thing:4782693\" data-type=\"URL\" data-id=\"https:\/\/www.thingiverse.com\/thing:4782693\" target=\"_blank\">this<\/a> specific case to fit for my needs. That enclosure does require a bit glue to close the lid tight, but otherwise it&#8217;s a perfect fit.<\/p>\n\n\n\n<p>If you don&#8217;t have a 3D printer available, you can use any plastic case. Just add some hot glue to the bottom of the enclosure and glue the ESP32 device on it so it won&#8217;t move inside accidentally. Also create a hole for the USB power cable.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"750\" data-id=\"1571\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/20230327_100341.jpg\" alt=\"\" class=\"wp-image-1571\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"1000\" data-id=\"1573\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/20230327_122907.jpg\" alt=\"\" class=\"wp-image-1573\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"1000\" data-id=\"1572\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/20230327_122918.jpg\" alt=\"\" class=\"wp-image-1572\"\/><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The end<\/h2>\n\n\n\n<p>Everything is now ready and the proxy device should be passing <em>&#8216;all&#8217;<\/em> bluetooth device data directly to your Home Assistant instance. I&#8217;ve been using this for about week now and I&#8217;ve had zero connection drops and everything has been working as great as expected. It&#8217;s very easy now to expand Bluetooth range by just placing more of these proxy devices in the house!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div style=\"border: 3px dashed #abb8c3; border-radius: 0%; background-color: inherit; \" class=\"ub-styled-box ub-bordered-box wp-block-ub-styled-box\" id=\"ub-styled-box-754d8695-bd24-41fa-8c7a-32498467227b\">\n<p id=\"ub-styled-box-bordered-content-6202e9be-9c9e-4dbe-8af7-6f10c42697bf\"><h5 class=\"wp-block-heading has-text-align-center\">Did you find this guide helpful? You can keep the blog going by bidding me a coffee!<\/h5>\r\n<center>\r\n<script type=\"text\/javascript\" src=\"https:\/\/cdnjs.buymeacoffee.com\/1.0.0\/button.prod.min.js\" data-name=\"bmc-button\" data-slug=\"tokorhon\" data-color=\"#FFDD00\" data-emoji=\"\"  data-font=\"Cookie\" data-text=\"Buy me a coffee\" data-outline-color=\"#000000\" data-font-color=\"#000000\" data-coffee-color=\"#ffffff\" ><\/script>\r\n<\/center><\/p>\n\n\n<\/div>\n\n<div style=\"border: 3px dashed #abb8c3; border-radius: 0%; background-color: inherit; \" class=\"ub-styled-box ub-bordered-box wp-block-ub-styled-box\" id=\"ub-styled-box-a8cd2d4c-5b31-4424-985a-f6b38e26e83d\">\n<p id=\"ub-styled-box-bordered-content-7837d808-dc50-4866-9f1b-846666fcd685\"><p>\r\n\t<i><b>Promotional message:<\/b><\/i>\r\n<\/p>\r\n<p>\r\n\t<b>Need a SwitchBot device?<\/b> You can get\u00a0<b>10%<\/b> off\u00a0with the creatingsmarthome.com code <i>10UPF4RLGELVDV<\/i> directly from the\u00a0<a href=\"https:\/\/www.switch-bot.com\/?sca_ref=3492237.F4rLGeLvdV&utm_source=kol&utm_medium=referral&utm_campaign=uppromote\">SwitchBot store.<\/a>\r\n<\/p>\r\n<\/p>\n\n\n<\/div>","protected":false},"excerpt":{"rendered":"<p>In previous post I briefly looked into SwitchBot Bluetooth ecosystem and promised to write a post about setting up a Bluetooth Proxy using ESP32 and&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1579,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,100],"tags":[252,260,262,261,183,201,134,7,258,259,8,249],"class_list":["post-1462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide","category-home-assistant","tag-bluetooth","tag-bluetooth-device","tag-bluetooth-gateway","tag-bluetooth-proxy","tag-esp32","tag-esphome","tag-gateway","tag-home-assistant","tag-proxy","tag-range","tag-smart-home","tag-switchbot","has-post-thumbnail-archive"],"acf":[],"featured_image_src":"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/03\/bluetooth_esphome.png","author_info":{"display_name":"Toni","author_link":"https:\/\/www.creatingsmarthome.com\/index.php\/author\/topsy\/"},"_links":{"self":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/1462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/comments?post=1462"}],"version-history":[{"count":67,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":3980,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/1462\/revisions\/3980"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media\/1579"}],"wp:attachment":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media?parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/categories?post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/tags?post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}