Add support in zha for the new glass_break binary sensor entity / device class exposed in Home Assistant?

Open
#896 0 comments 0 reactions 0 assignees View on GitHub

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?

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).

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:

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zigpy/zha

All issues in zigpy/zha

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.