Skip to content

v1.8.0: port the esphome-ble-advert-filter v2.0.2 filter - #5

Merged
davidcoulson merged 2 commits into
mainfrom
port-v2.0.2-filter
Oct 10, 2026
Merged

davidcoulson merged 2 commits into
mainfrom
port-v2.0.2-filter

Conversation

@davidcoulson

Copy link
Copy Markdown
Owner

Brings this fork's filter up to esphome-ble-advert-filter v2.0.2, so the fleet on ESPHome 2026.9 gets the fixes from a deep Codex review of this repo.

Fixes (reproduced by running them, each covered by a v2.0.2 test that fails on the old code):

  • IRK-matched phones dropped. A phone whose rotating address looked like an Espressif OUI was never matched to its key. With Apple blocklisted it was then dropped, roughly a few times a year across a household's phones.
  • Scan responses hidden by padding. Zero padding in an advert hid the scan response from every payload rule.
  • Base-UUID service UUIDs not matching. A 16-bit service UUID written in full Base-UUID form didn't match its short advert.
  • Later iBeacons hidden. A non-matching iBeacon hid a matching one later in the same payload.
  • Config and comments. minor: [] meant any minor and is now rejected. The allow_ibeacon/allow_findmy comments understated what a match protects from.

Also ported: v2.0.0's RPA verdict cache and v2.0.1's null-payload guard, which the shared filter chain now uses.

Parity: tools/check_parity.py now also compares irk_matches_cached_ and clear_rpa_cache_. Every compared function, the filter chain, the Espressif table and the public API match v2.0.2. tests/run.sh and CI pin v2.0.2's tag commit.

Tested:

  • tests/run.sh (parity plus the v2.0.2 suites under ASan/UBSan) passes.
  • esphome compile on 2026.9.1 / ESP-IDF, ESP32-C3 and S3, with every filter option and the lambda API in use, gives no warnings.
  • Not yet run on a device. After merging, tag v1.8.0 and roll it out by bumping ref: in the fleet's common/ble-proxy.yaml, starting with one test node.

🤖 Generated with Claude Code

davidcoulson and others added 2 commits October 10, 2026 14:40
Brings this fork's filter up to the hook component's v2.0.2, so the fleet on
ESPHome 2026.9 gets the fixes from a deep review of this repo:

- an IRK-matched phone whose rotating address looked like an Espressif OUI
  was never resolved, and with Apple blocklisted, dropped;
- zero padding in an advert hid its scan response from every payload rule;
- a 16-bit service UUID written in Base-UUID form did not match its short
  advert;
- a non-matching iBeacon hid a matching one later in the payload;
- `minor: []` meant any minor (now rejected), and the allow_ibeacon /
  allow_findmy comments understated what a match protects from.

Also the hook component's 2.0.0 RPA verdict cache and 2.0.1 null-payload
guard, which its filter chain now uses. check_parity.py now also compares
irk_matches_cached_ and clear_rpa_cache_; every compared function, the chain,
the OUI table and the public API match v2.0.2.

Compiled on ESPHome 2026.9.1 / ESP-IDF for ESP32-C3 and S3 with every filter
option and the lambda API in use: no warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The filter now matches v2.0.2 rather than v1.7.0: pin run.sh to its tag
commit (7e4713d), check it out in CI, and say so in the README notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidcoulson
davidcoulson merged commit 03017bb into main Oct 10, 2026
6 checks passed
@davidcoulson
davidcoulson deleted the port-v2.0.2-filter branch October 10, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant