From 09bd44969832915f1bd712db933aa27d3b7962ad Mon Sep 17 00:00:00 2001 From: walthowd Date: Sat, 24 Oct 2020 20:41:27 -0500 Subject: [PATCH] Send pro-active IAS Enroll Response (#42282) * Send pro-active IAS Enroll Response Some zigbee devices require a pro-active IAS enroll response to be sent before they will send their IAS enroll request. This PR sends a single IAS enroll response after CIE write and fixes some of these devices including the Ecolink 4655BC0-R and many others. This also more closely aligns with the default behavior of Smartthings and zigbee2mqtt which also send pro-active enroll requests: https://github.com/Koenkk/zigbee-herdsman/commit/b217b91bb723b31a73ebecfa0e80690bccf44f8b#diff-6d00af5fc389c40b8c4dfc390d80e3eca3946d331dff84afdc1632cb5568bca2 Thanks to @puddly for helping figure this all out and @tubalainen for testing. * flake8 fixes * flake8 again --- homeassistant/components/zha/core/channels/security.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/zha/core/channels/security.py b/homeassistant/components/zha/core/channels/security.py index 126dc761572..156ada1e8f1 100644 --- a/homeassistant/components/zha/core/channels/security.py +++ b/homeassistant/components/zha/core/channels/security.py @@ -155,6 +155,15 @@ class IASZoneChannel(ZigbeeChannel): self._cluster.ep_attribute, str(ex), ) + + try: + self.debug("Sending pro-active IAS enroll response") + await self._cluster.enroll_response(0, 0) + except ZigbeeException as ex: + self.debug( + "Failed to send pro-active IAS enroll response: %s", + str(ex), + ) self.debug("finished IASZoneChannel configuration") @callback