Skip to content

Add Bosch Twinguard support - #5250

Open
dehnerson wants to merge 3 commits into
zigpy:devfrom
dehnerson:add-bosch-twinguard-v2
Open

Add Bosch Twinguard support#5250
dehnerson wants to merge 3 commits into
zigpy:devfrom
dehnerson:add-bosch-twinguard-v2

Conversation

@dehnerson

@dehnerson dehnerson commented Aug 13, 2026

Copy link
Copy Markdown

Proposed change

Add complete Bosch Twinguard (8750001213, model Champion) support using the Quirks V2 API.

  • Perform the Bosch-specific pairing handshake required to complete joining.
  • Expose temperature, humidity, illuminance, battery, AQI/eCO2, smoke, self-test, sensitivity, pre-alarm, and heartbeat controls.
  • Add Bosch-native alarm mode control (stop, pre_alarm, fire, and burglar) and read-only siren state feedback.
  • Support both known manufacturer strings and suppress stale placeholder entities from the standard measurement clusters.

Fixes #2561.
Supersedes #3293 with a tested V2 implementation and full alarm/smoke support.

Additional information

The protocol behavior was independently implemented using the Zigbee2MQTT Twinguard implementation as a reference. The quirk has been manually tested with Home Assistant 2026.8.1 and a Connect ZBT-2, including fresh pairing, measurements, configuration controls, self-test, and all alarm modes.

The complete local suite reached 4,846 passed and 2 xfailed; the remaining 8 failures are unrelated Windows-specific failures in existing Inovelli path handling and Tuya timezone/request tests.

Device diagnostics

bosch-twinguard-diagnostics.json

Test plan

  • Added tests for V2 matching, both manufacturer strings, entity metadata, scaling, and default-entity suppression
  • Added tests for pairing bindings, handshake ordering, initial writes, and cache-priming reads
  • Added tests for smoke/fire acknowledgements, reported alarm states, read-only siren state, and all alarm modes
  • Ran pytest tests/test_bosch_twinguard.py tests/test_bosch.py tests/test_quirks_v2.py -q (23 passed)
  • Ran pre-commit run --all-files

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Ruff
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

Implement the device-specific pairing handshake, measurements, configuration, and alarm controls so Twinguard devices work fully with ZHA. Cover both known manufacturer signatures and protocol behavior with dedicated tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.96970% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.66%. Comparing base (b139f81) to head (6793608).

Files with missing lines Patch % Lines
zhaquirks/bosch/twinguard.py 96.96% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #5250      +/-   ##
==========================================
+ Coverage   92.60%   92.66%   +0.06%     
==========================================
  Files         424      425       +1     
  Lines       14667    14832     +165     
==========================================
+ Hits        13582    13744     +162     
- Misses       1085     1088       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zigpy-review-bot zigpy-review-bot added bot: needs changes PR needs changes per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM new quirk Adds support for a new device bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM bot: huge PR PR is quite large and should possibly be split up per LLM labels Aug 13, 2026
dehnerson and others added 2 commits August 14, 2026 09:35
Keep the custom battery entity grouped consistently with other ZHA battery diagnostics and cover the metadata classification in tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid presenting the VOC-derived estimate as a true carbon-dioxide measurement while retaining its familiar ppm representation and Zigbee2MQTT parity.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: huge PR PR is quite large and should possibly be split up per LLM bot: needs changes PR needs changes per LLM bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM new quirk Adds support for a new device

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Device Support Request] Bosch Twinguard

2 participants