-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Kegtron BT matcher too generic #134081
Comments
Hey there @Ernst79, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) kegtron documentation |
If I remember correct, these Kegtron devices send two type of advertisements. One has the name in it, but the second one does not. This is also explained in the docs. So, filtering on “Kegtron*” will cause it to miss the second type of advertisements. And the second one, is the one with the relevant data in the 13FFFFFF part. Kegtron is using the manufacturer uuid FFFF. I don’t think that is an official UUID, they just use it. As your link explains, it should be for testing purposes. I’m not sure how to make ithe filtering more restricted. I thought the port name was editable, so can be anything. The only thing we might be able to add is filtering on the length of the advertisement, as it is fixed at 31 bytes. |
Hey! Thanks for the quick response, highly appreciated!
According to the explanation for Bleak, which is used by HA, the two messages should be combined, so filtering would not make a difference if I correctly understand. If you want me to test that with a fake device based on ESP32, I can do, if you even consider a change to your code. 🙏
That is not feasible as the BT matcher does not support length filtering. |
I don’t have a Kegtron device myself, so I can’t check if it sends both messages in one advertisement. But I don’t think it does. I also don’t know how to combine the two messages |
Well my point is (based on the links I referenced), you don't have to do so. The underlying libraries will do that for you, thus the case that you will miss one messages cannot occur. They are first combined and then matched, since the first contains the name and the second the data, you will get one with both elements. |
I don’t have a Kegtron device myself, so we should find someone who has a Kegtron device to check this, I guess. |
Hmm, maybe @alanquillin can help, his code |
The problem
Hi! I got a issue report for my custom integration that support Ective battery BMS. Unfortunately, those batteries also use the manufacturer ID 65535. According to this thread the number is actually reserved, although I could not find the source in the BT specification.
The very general filtering for manufacturer ID 65535 thus can easily cause a conflict with other devices. For reasons I do not really understand (see additional information below) this in turn can cause a
Invalid Flow Specified
exception together with a second integration that uses that number (alone). The minimal side-effect that is reproducible is that I need to havekegtron-ble
as requirement for my integration tests, since the advertisements of the Ective battery trigger also Kegtron, which I'd like to avoid to have.I therefore suggest to add
"local_name": "Kegtron*",
to the manifest as the specification states"Kegtron xxxxxx" (where xxxxxxx = MAC address suffix
to be part of the advertisementType = 0x09 (Complete local name)
.I was about to suggest a PR, but then I saw in the tests for this integration, that the test advertisements do not follow that specified format, so I'm not sure how real devices advertise. Since I do not own such a device, I cannot clarify, could you please do so and comment on restricting the BT matcher more?
What version of Home Assistant Core has the issue?
core-2024.12.0.dev0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
kegtron
Link to integration documentation on our website
https://www.home-assistant.io/integrations/kegtron/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
Documentation says the devices should provide a
local_name
"Kegtron xxxxxx" (where xxxxxxx = MAC address suffix)I could not reproduce the issue the user reported (HA core, devcontainer, or HA OS), as HA anytime would install kegtron-ble for me and the flow would work. The message "invalid flow specified" only occurs if kegtron-ble is missing, which is reproducible in tests without that requirement installed via PIP.
The text was updated successfully, but these errors were encountered: