Add support in zha for the new glass_break binary sensor entity / device class exposed in Home Assistant?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Start with zha/application/platforms/binary_sensor/device_class.py, which the issue names as the place for a new glass_break device class, and read how existing binary sensor classes are mapped. The issue also refers to IAS Zone cluster 0x0500 with zone type 0x0226, so check how ZHA currently handles IAS zone types. Done means a glass_break class is exposed for that zone type. The issue has no comments and no test hardware, so confirm the scope with maintainers before writing code.
Written by the indexing model from the issue text.
Description
Add support in zha for glass_break binary sensor entity / device class to better expose Zigbee IAS glass break sensors in Home Assistant?
-
BinarySensorDeviceClass.GLASS_BREAKglass_break :onmeans glass break detected,offmeans no glass break (clear)
Would it be a good idea to add glass break device type as another device class for binary sensors to the binary_sensor platform?
Should be possible if Zigbee Vibration/Shock/Acoustic Sensors have specialized Zigbee Intruder Alarm System (IAS) profile for a glass break sensor. With the use case for allowing burglar alarms to use glass break detectors for detecting window / glass breaking, with sensors installed on any glass surface to alert home owners when the glass surface is tampered with, shattered or broken.
Zigbee Cluster Library (ZCL) does not have its own dedicated standalone glassbreak cluster for a glass break sensor, however glass-break sensor and events are natively implemented under Zigbee's IAS Zone Cluster (Intruder Alarm System), which uses the Cluster ID 0x0500 which can define a IAS Zone with type 0x0226 to specify it as a glass break sensor using the ZoneType alarm attributes for glass breakage on an Zigbee IAS glass break sensor (to instantly report detected glass shattering).
-
ZCL_IAS_ZONE_SVR_ZONE_TYPE_GLASS_SENSOR / IAS_ZONE_TYPE_GLASS_BREAK_SENSOR
- ALARM1 = Glass breakage detected (sensor tripped)
- ALARM2 = Secondary alarm (often used for acoustic/shock double-verification, or high-frequency trip)
Use the dedicated glass_break binary sensor device class for this integration's explicit glass-break signal event, similar to how done in these pull requests:
- https://github.com/home-assistant/core/pull/182243
- https://github.com/home-assistant/core/pull/182240
- https://github.com/home-assistant/core/pull/182241
- https://github.com/home-assistant/core/pull/182239
- https://github.com/home-assistant/core/pull/172996
Disclaimer; I do not actually own any devices myself that specifically exposes IAS Zone type 0x0226 to specifcially expose "glass break". There are plently of Zigbee devices available that are marketed as Glass Break Detector products but not sure if the less expensive models just expose vibration as binary sensor or if they also expose the proper IAS Zone to indicate glass breakage as a binary sensor. Example:
- SMC SMCGB01-Z Glass Brake Sensor
- Climax SVGS-1ZBS ZigBee Shock and Glass Break Sensor
- Visonic GB-540 ZigBee Wireless Acoustic Glass Break Detector
Home Assistant reference:
Link to Home Assistant's core (backend) pull request: https://github.com/home-assistant/core/pull/181332
Link to Home Assistant's frontend pull request: https://github.com/home-assistant/frontend/pull/53989
Link to Home Assistant's ADR (Architecture Decision Record): https://github.com/home-assistant/architecture/issues/747
Link to Home Assistant's architecture discussion: https://github.com/home-assistant/architecture/discussions/1455
Link to Home Assistant's documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/47902
Link to Home Assistant's developer documentation pull request: https://github.com/home-assistant/developers.home-assistant/pull/3335
- Dominant language
- Python
- Stars
- 96
- Forks
- 84
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zigpy/zha
-
Device override creates the generic entity instead of the vendor-specific one (Light instead of HueLight, ForceOnLight, MinTransitionLight)Possibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Each time a device becomes available again, ZHA adds another firmware update listener that is never releasedPossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Devices that left the network are re-initialized on every availability check, reading attributes from a device that is gonePossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
device specific quirks
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100