-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device name is not displayed in HA discovered devices #95
Comments
Yes, I think this is right repo where your issue is related to. However, I'm trying to understand why this issues occurs. The code that is causing this behavior is the following . if name == service_info.address:
name = "BTHome sensor"
# Remove identifier from ATC sensors name.
atc_identifier = (
service_info.address.replace("-", "").replace(":", "")[-6:].upper()
)
if name[-6:] == atc_identifier:
name = name[:-6].rstrip(" _")
...
# Try to get manufacturer based on the name
if name.startswith(("ATC", "LYWSD03MMC")):
manufacturer = "Xiaomi"
device_type = "Temperature/Humidity sensor"
elif name.startswith("prst"):
manufacturer = "b-parasite"
name = "b-parasite"
device_type = "Plant sensor"
elif name.startswith("SBBT"):
manufacturer = "Shelly"
name = "Shelly BLU Button1"
device_type = "BLU Button1"
elif name.startswith("SBDW"):
manufacturer = "Shelly"
name = "Shelly BLU Door/Window"
device_type = "BLU Door/Window"
else:
manufacturer = None
device_type = "BTHome sensor"
# Get device information from local name and identifier
self.set_device_name(f"{name} {identifier}")
self.set_title(f"{name} {identifier}")
self.set_device_type(device_type) The
So, I suspect that the |
@Ernst79 thank you for the reply. The device with the name According to the code you linked, the manufacturer should be Xiaomi. Side note, I have other Xiaomi devices, including MHO-C401, the default device name starts with |
@Ernst79 quick update (ref: pvvx/ATC_MiThermometer#426 (comment)) |
You can probably check that by enabling debug logging for the Bluetooth integration (not BTHome, but Bluetooth integration). The Bluetooth integration is taking care of receiving the data of BLE devices and BT proxies. Note that bugs in the Bluetooth integration should be raised in the Home Assistant core repo. |
I need to be sure this is a bug in HA Bluetooth Integration or maybe this is something with ESP Home or Shelly.
this config will be ok? |
Yes, I understand. you will find many received ble messages in your log, so only use this for a short period |
If you have a USB-BT adapter and a passive scanning option, the device name does not change.
Rebooting HA won't help. The BLE device most often transmits the name upon active scanning request. The name and transmitted information do not fit into the main short advertising package BT4.2. |
If the name is received after discovery, the config flow won't see it because the flow has already been started with the original name. You can use a solution like https://github.com/home-assistant/core/blob/833805f9be329172bf2844a2cf3babbee4caa09a/homeassistant/components/improv_ble/config_flow.py#L169 to watch for new advertisements and update the name once the flow is in progress |
To resolve all issues with device information, standard UUIDs should be polled. Preferably with a button for the user. https://community.home-assistant.io/t/make-ble-softwarerevisionstring-available/640675/2?u=tmugan chrome://bluetooth-internals/ (And in Chrome, do not forget to clear the Bluetooth cache when changing firmware and other manipulations.) And the current BTHome code is full of guesses based on the first letters of the name and so on :) |
How might this affect Bluez running in passive scanning mode? |
I only see this in logs:
and I've added this log my configuration:
Logs show other devices (Shelly Gen 2), but nothing about the BTHome device with the wrong name. Not sure where to search for logs or where to report this issue. |
The automatic OTA in the ZHA worked. Devices firmwares now includes simultaneous support for Zigbee and BLE. How to determine where and what in BTHome? https://www.bluetooth.com/specifications/specs/device-information-service/
|
Describe the bug
I've flashed LYWSD03MMC with 4.5 firmware using https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html.
I've set the device name via the page, and now every time I want to connect the flasher I see my device on the list:
(ACT_BIURO)
I've also set the advertisement type to BTHome v2, and soon after the device was discovered in Home Assistant, but sadly the device presented on the list didn't have the name I've set in the Flasher:
I've created an issue in pvvx repo - pvvx/ATC_MiThermometer#426, but apparently, the issue is on the HA side.
After flashing 5 or more devices and moving them to the destination home right now we must power one device at a time, having the device name in the discovery information it would be easy to set up all the devices at once.
To Reproduce
Steps to reproduce the behavior:
Flash LYWSD03MMC with firmware 4.5,
set custom device name,
set BTHome v2 as advertisement type
go to integrations in HA and observe the newly found device with the wrong name
Additional context
I'm using HA 2023.11.3 and a couple of Shelly devices as BT Proxy. I've tried active scanning, and passive scanning, restarted Shelly devices, and restarted HA, but nothing helped.
I think this is a related issue: home-assistant/core#79468
If the issue is not created in the right repo please move it to the right place or let me know and I'll create a new one in the right place.
The text was updated successfully, but these errors were encountered: