BT Proxy Unavailable

Just installed an ESP32 as a Bluetooth proxy but as soon as I installed it showed as Unavailable.

I deleted it from the ESPHome integration and HA automatically discovered it again but each time I add it and configure it, it goes straight offline again.

My first ESPHome device so any help with this issue would be welcomed.

Yaml, logs please

Here’s the log

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: ESPHome
 ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices
-----------------------------------------------------------
 Add-on version: 2023.6.4
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.7.1
 Home Assistant Supervisor: 2023.07.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[21:06:07] INFO: Configuring timezone (Europe/London)...
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service esphome: starting
s6-rc: info: service esphome successfully started
s6-rc: info: service init-nginx successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service discovery: starting
[21:06:08] INFO: Waiting for ESPHome dashboard to come up...
[21:06:08] INFO: Starting ESPHome dashboard...
2023-07-08 21:06:08,624 INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome...
[21:06:08] INFO: Starting NGINX...
[21:06:08] INFO: Successfully send discovery information to Home Assistant.
s6-rc: info: service discovery successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
2023-07-08 21:07:35,863 INFO 200 GET /devices (0.0.0.0) 1.45ms
2023-07-08 21:12:37,408 INFO 200 GET /devices (0.0.0.0) 0.94ms
2023-07-08 21:18:58,408 INFO 200 GET /devices (0.0.0.0) 0.94ms
2023-07-08 21:27:28,415 INFO 200 GET /devices (0.0.0.0) 0.57ms
2023-07-08 21:32:28,407 INFO 200 GET /devices (0.0.0.0) 0.60ms
2023-07-08 21:37:28,407 INFO 200 GET /devices (0.0.0.0) 0.58ms
2023-07-08 21:42:28,407 INFO 200 GET /devices (0.0.0.0) 0.94ms
2023-07-08 21:47:28,407 INFO 200 GET /devices (0.0.0.0) 0.94ms
2023-07-08 21:49:36,416 INFO 200 GET /devices (0.0.0.0) 0.80ms
2023-07-08 21:54:33,154 INFO 200 GET /devices (0.0.0.0) 0.66ms

No, the yaml you used to flash the esp32 and the logs generated in the esphome gui when the esp32 runs.

I didn’t use yaml to flash it, Nick, I used this link suggested in the HA update release. I haven’t created any yaml…should I have?

And when you say the logs in the ESPHome gui, do you mean the diagnostics? I can’t see any logs anywhere else in the integration gui.

In fact I’ve got these logs in the gui for the device if this is what you mean:

Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:55:04 PM - 14 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:55:04 PM - 14 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:53:20 PM - 16 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:48:32 PM - 21 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:30:59 PM - 38 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:26:49 PM - 42 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:26:49 PM - 42 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:26:13 PM - 43 minutes ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:22:28 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:13:58 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:13:58 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:12:07 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:12:07 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:07:37 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:06:42 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:06:42 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
9:06:39 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
9:06:39 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
8:51:06 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
8:51:05 PM - 1 hour ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
6:25:21 PM - 4 hours ago
Bluetooth Proxy d155f4 Safe Mode Boot became unknown
6:13:12 PM - 4 hours ago
Bluetooth Proxy d155f4 Safe Mode Boot became unavailable
6:13:11 PM - 4 hours ago

@c0ntax - did you ever manage to solve this?

I have the exact same problem. My first ESPHome project, loaded a Bluetooth proxy into it by using Ready-Made Projects — ESPHome

The installation all seems fine, but no devices are ever found in Home Assistant. With my limited knowledge, I still think it looks like the BT proxy does indeed find bluetooth devices, but none show up in Home Assistant.

For this reason, I suspect the problem to reside in Home Assistant rather than the ESPHome device.

{
  "home_assistant": {
    "installation_type": "Unsupported Third Party Container",
    "version": "2024.1.6",
    "dev": false,
    "hassio": false,
    "virtualenv": true,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Helsinki",
    "os_name": "Linux",
    "os_version": "5.15.0-1045-raspi",
    "run_as_root": false
  },
  "custom_components": {
    "entsoe": {
      "version": "0.0.1",
      "requirements": [
        "entsoe-py==0.5.8"
      ]
    },
    "powercalc": {
      "version": "v1.10.0",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "nordpool": {
      "version": "0.0.14",
      "requirements": [
        "nordpool>=0.2",
        "backoff"
      ]
    },
    "ocpp": {
      "version": "v0.5.1",
      "requirements": [
        "ocpp>=0.20.0",
        "websockets>=10.2"
      ]
    },
    "hacs": {
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "ev_smart_charging": {
      "version": "v1.10.0",
      "requirements": []
    },
    "blitzortung": {
      "version": "1.0.1",
      "requirements": [
        "paho-mqtt>=1.5.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "esphome",
    "name": "ESPHome",
    "after_dependencies": [
      "zeroconf",
      "tag"
    ],
    "codeowners": [
      "@OttoWinter",
      "@jesserockz",
      "@kbx81",
      "@bdraco"
    ],
    "config_flow": true,
    "dependencies": [
      "assist_pipeline",
      "bluetooth"
    ],
    "dhcp": [
      {
        "registered_devices": true
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/esphome",
    "integration_type": "device",
    "iot_class": "local_push",
    "loggers": [
      "aioesphomeapi",
      "noiseprotocol",
      "bleak_esphome"
    ],
    "requirements": [
      "aioesphomeapi==21.0.1",
      "esphome-dashboard-api==1.2.3",
      "bleak-esphome==0.4.0"
    ],
    "zeroconf": [
      "_esphomelib._tcp.local."
    ],
    "is_built_in": true
  },
  "data": {
    "config": {
      "entry_id": "cb3644df3338336aefe14e6f50669af0",
      "version": 1,
      "minor_version": 1,
      "domain": "esphome",
      "title": "Bluetooth Proxy 105330",
      "data": {
        "host": "192.168.1.247",
        "port": 6053,
        "password": "",
        "noise_psk": "",
        "device_name": "atom-bluetooth-proxy-105330"
      },
      "options": {
        "allow_service_calls": true
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "**REDACTED**:30",
      "disabled_by": null
    },
    "storage_data": {
      "device_info": {
        "uses_password": false,
        "name": "atom-bluetooth-proxy-105330",
        "friendly_name": "Bluetooth Proxy 105330",
        "mac_address": "**REDACTED**",
        "compilation_time": "Jan 19 2024, 23:09:57",
        "model": "m5stack-atom",
        "manufacturer": "Espressif",
        "has_deep_sleep": false,
        "esphome_version": "2023.12.8",
        "project_name": "esphome.bluetooth-proxy",
        "project_version": "1.0",
        "webserver_port": 0,
        "voice_assistant_version": 0,
        "legacy_bluetooth_proxy_version": 5,
        "bluetooth_proxy_feature_flags": 63,
        "suggested_area": ""
      },
      "services": [],
      "api_version": {
        "major": 1,
        "minor": 9
      },
      "button": [
        {
          "object_id": "safe_mode_boot",
          "key": 2037531703,
          "name": "Safe Mode Boot",
          "unique_id": "atom-bluetooth-proxy-105330buttonsafe_mode_boot",
          "disabled_by_default": false,
          "icon": "mdi:restart-alert",
          "entity_category": 2,
          "device_class": "restart"
        }
      ]
    },
    "bluetooth": {
      "connections_free": 3,
      "connections_limit": 3,
      "available": true,
      "scanner": {
        "name": "atom-bluetooth-proxy-105330 (**REDACTED**:30)",
        "start_time": 575926.952604197,
        "source": "**REDACTED**:30",
        "scanning": true,
        "type": "ESPHomeScanner",
        "last_detection": 576124.086149608,
        "monotonic_time": 576124.986138494,
        "discovered_devices_and_advertisement_data": [
          {
            "name": null,
            "address": "**REDACTED**:8B",
            "rssi": -43,
            "advertisement_data": [
              null,
              {
                "6": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x01\\t \"\\\\\\xa6\\xfc\\x1b\\x8c\\x8fV\\xd6y\\xdd\\xaf\\xda\\xc3\\xff\\xfe^\\x15\\x86\\x16\\x05\\x18\\xf3:'"
                }
              },
              {},
              [],
              -127,
              -43,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 1
            }
          },
          {
            "name": null,
            "address": "**REDACTED**:08",
            "rssi": -93,
            "advertisement_data": [
              null,
              {
                "76": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x12\\x02\\x00\\x03'"
                }
              },
              {},
              [],
              -127,
              -93,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 1
            }
          },
          {
            "name": "\u0000",
            "address": "**REDACTED**:76",
            "rssi": -85,
            "advertisement_data": [
              "\u0000",
              {
                "3": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x01\\x16`\\x00\\x00\\x02\\xdc\\xe5[?\\x88\\x80\\xec\\x81\\x93,\\rv\"'"
                }
              },
              {},
              [
                "0000fe61-0000-1000-8000-00805f9b34fb"
              ],
              -127,
              -85,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 0
            }
          },
          {
            "name": "EOSM50m2_E2A16D\u0000",
            "address": "**REDACTED**:1E",
            "rssi": -77,
            "advertisement_data": [
              "EOSM50m2_E2A16D\u0000",
              {
                "425": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x01\\xf92\\x08E\\x05'"
                }
              },
              {},
              [
                "00010000-0000-1000-0000-d8492fffa821"
              ],
              6,
              -77,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 0
            }
          },
          {
            "name": "WB1018348",
            "address": "**REDACTED**:0C",
            "rssi": -90,
            "advertisement_data": [
              "WB1018348",
              {},
              {},
              [
                "2456e1b9-26e2-8f83-e744-f34f01e9d701"
              ],
              6,
              -90,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 0
            }
          },
          {
            "name": "\u0000",
            "address": "**REDACTED**:86",
            "rssi": -96,
            "advertisement_data": [
              "\u0000",
              {
                "3": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x00`5\\x00\\x00\\t\\xe8x)\\xc4\\xc4\\x022'"
                }
              },
              {},
              [
                "0000fe61-0000-1000-8000-00805f9b34fb"
              ],
              -127,
              -96,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 0
            }
          },
          {
            "name": null,
            "address": "**REDACTED**:71",
            "rssi": -72,
            "advertisement_data": [
              null,
              {
                "76": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'\\x10\\x058\\x18\\xeeth'"
                }
              },
              {},
              [],
              12,
              -72,
              []
            ],
            "details": {
              "source": "**REDACTED**:30",
              "address_type": 1
            }
          }
        ],
        "connectable": true,
        "discovered_device_timestamps": {
          "**REDACTED**:8B": 576122.522168923,
          "**REDACTED**:08": 576122.822165218,
          "**REDACTED**:76": 576124.086149608,
          "**REDACTED**:1E": 576106.850362593,
          "**REDACTED**:0C": 576109.330331931,
          "**REDACTED**:86": 576116.71424067,
          "**REDACTED**:71": 575993.839766448
        },
        "time_since_last_device_detection": {
          "**REDACTED**:8B": 2.463969570933841,
          "**REDACTED**:08": 2.163973276037723,
          "**REDACTED**:76": 0.8999888859689236,
          "**REDACTED**:1E": 18.135775901027955,
          "**REDACTED**:0C": 15.655806562979706,
          "**REDACTED**:86": 8.271897824015468,
          "**REDACTED**:71": 131.14637204597238
        }
      }
    }
  }
}

what devices? are they supported BT devices? are there any steps you need to take along with setting up a proxie? Are setting up these devices mentioned in the esphome Docs? Integrations or add-ons that need installed for these devices? Some things you need to install the HA integration for and add it manually or create the config in the proxy yaml to read the BT sensors and know that it needs to watch for a specific BT advertisement…

Yes, still happening but I’m not sure if it’s a BT issue or Switchbot device issue. I have 2 Switchbot devices which are the only ones I have using BT so I’m not sure.

OK, some background:
I have had this setup:

  • Xiaomi Flower Care Bluetooth device
  • Rapsberry Pi 4
  • Xiaomi BLE integration in HA
  • Bluetooth connectivity using the Rasperry Pi’s bluetooth cirucuit

This all worked fine.
Then I decided to migrate Home Assistant to a docker environment. This means that I need to solve the bluetooth connectivity in a different way, so I got an Atom device and loaded it with the ESPHome Bluetooth proxy.

The very same Flower Care bluetooth device can no longer be found, despite using the same Xiaomi BLE integration. I still can find and connect to the device using my phone.
I also have another device - Aqara FP2 that I’m expecting to show up.
According to this page I shouldn’t even need the integration to start detecting bluetooth devices:

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 & integrations page once again…

So I don’t have a clue how to resolve this. The Atom device seems to see bluetooth devices, but this is not seen in Home Assistant.

Update!
I removed and added the Xiaomi BLE integration, and now the Bluetooth device was found!
The Bluetooth proxy still keeps flipping between “Unavailable” and “Unknown” state. But that does not seem to be a problem (although concerning).
So problem solved for my part.

You beat me… ive had similar issues with BT beacons not being found. I dont really feel like going on a scavenger hunt today but, im 90% sure this problem is addressed in the official docs and that is also the suggested way to fix the issue. Right now all of my beacons are discovered but times i get new ones, they’re often not found and i have to remove iBeacon or whichever integration deals with the device, reinstall it and that usually fixes the problem.

FYI

Reboot, Uninstall/install are great ways to fix all sorts of issues, not just with BT