ZHA Quirk: cannot fire zha_event from Custom Manufacturer cluster

Hello,
I’m writing a custom quirk for a Zigbee remote control for light bulbs.

For most buttons it uses standard Zigbee clusters like On/Off, LevelControl, Color…
But for the 4 “preset buttons” with little squares on the top, it uses a manufacturer-specific cluster with ID 0xFE00
When one of the preset button is pressed, the remote sends a Zigbee client command at 0x000 with two uint8_t as parameters.

To manage these buttons, i wrote a custom cluster for my quirk that handles the request and sends a zha_event each time a button is pressed, to be able to use device_automation_triggers for these preset buttons.

class AdeoPresetCluster(EventableCluster):
    """Custom cluster for preset buttons 1-4"""

    cluster_id = MANUFACTURER_SPECIFIC_CLUSTER_ID_PRESET
    name = "AdeoPresetCluster"
    ep_attribute = "adeo_preset_cluster"
    manufacturer_client_commands = {0x000: ("preset", (t.uint8_t, t.uint8_t), False)}

    def handle_cluster_request(
        self,
        hdr: foundation.ZCLHeader,
        args: List[Any],
        *,
        dst_addressing: Optional[
            Union[t.Addressing.Group, t.Addressing.IEEE, t.Addressing.NWK]
        ] = None,
    ):
        """Send cluster client requests as events."""
        if (
            self.manufacturer_client_commands is not None
            and self.manufacturer_client_commands.get(hdr.command_id) is not None
        ):
            self.listener_event(
                ZHA_SEND_EVENT,
                self.manufacturer_client_commands.get(hdr.command_id)[0],
                args,
            )
            self.debug(
                "AdeoPresetCluster : fire event {action=%s, args=%s}",
                self.manufacturer_client_commands.get(hdr.command_id)[0],
                str(args),
            )
        else:
            self.debug("AdeoPresetCluster : NO event fired")
            super().handle_cluster_request(hdr, args, dst_addressing=dst_addressing)

Full quirk code is available here: https://github.com/mathoudebine/zha-device-handlers/blob/adeo-lxek-5/zhaquirks/adeo/lxek5.py

Quirk and cluster are loaded without error by ZHA after HA restart.
When i press one of the button, the HA logs indicate that the command is handled by the cluster:

2022-01-26 19:04:02 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 69 (incomingMessageHandler) received: b'00040100fe01014000000042ffc16665ffff070d771260000d01'
2022-01-26 19:04:02 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=65024, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY: 64>, groupId=0, sequence=66), 255, -63, 0x6566, 255, 255, b'\rw\x12`\x00\r\x01']
2022-01-26 19:04:02 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0xfe00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4727 tsn=96 command_id=0>
2022-01-26 19:04:02 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0xfe00] ZCL request 0x0000: [13, 1]
2022-01-26 19:04:02 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0xfe00] AdeoPresetCluster : fire event {action=preset, args=[13, 1]}

I can see my custom log AdeoPresetCluster : fire event but no zha_event is fired despite calling self.listener_event(ZHA_SEND_EVENT,[...]) from my custom cluster.

When I press on a button managed by generic clusters like LevelControl, the zha_event is sent as expected:

2022-01-26 19:03:57 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 69 (incomingMessageHandler) received: b'000401080001014000000040ffcb6665ffff09015e02001a05000000'
2022-01-26 19:03:57 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=8, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY: 64>, groupId=0, sequence=64), 255, -53, 0x6566, 255, 255, b'\x01^\x02\x00\x1a\x05\x00\x00\x00']
2022-01-26 19:03:57 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=94 command_id=2>
2022-01-26 19:03:57 WARNING (MainThread) [zigpy.zcl] [0x6566:1:0x0008] Data remains after deserializing ZCL frame
2022-01-26 19:03:57 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0x0008] ZCL request 0x0002: [0, 26, 5]
2022-01-26 19:03:57 DEBUG (MainThread) [zigpy.zcl] [0x6566:1:0x0008] No handler for cluster command 2
2022-01-26 19:03:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=60:a4:23:ff:fe:70:39:a0, unique_id=60:a4:23:ff:fe:70:39:a0:1:0x0008, device_id=0501c9e8666648ccd073ffc9773f2962, endpoint_id=1, cluster_id=8, command=step, args=[0, 26, 5]>

What am I missing here? Is it not possible to fire zha_event from manufacturer clusters ?
Thanks for your help

Hello,

Did you found a solution ?

I have the same remote and it would be great to make working these buttons.

Thanks.

Hi, unfortunately no solution found for now. I’m thinking of posting the issue in https://github.com/zigpy/zha-device-handlers/issues for more answers.
If you want the other buttons to work in automation (excluding 1-4 preset buttons) you can for now using generic zha_event trigger :

YAML code for automation with Adeo LXEK-5:

alias: Télécommande Lexman LXEK-5
description: ''
trigger:
  - event_data:
      device_ieee: 60:a4:23:ff:fe:xx:xx:xx  <----- your device_ieee here
    event_type: zha_event
    platform: event
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.command == ''off'' }}'
        sequence:
          - type: turn_off
            device_id: e6f89081c1f6ace13b0a1929a31cb739
            entity_id: light.suspension_cuisine
            domain: light
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.command == ''on'' }}'
        sequence:
          - type: turn_on
            device_id: e6f89081c1f6ace13b0a1929a31cb739
            entity_id: light.suspension_cuisine
            domain: light
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.command == 'step' and
              trigger.event.data.args[0] == 0 }}
        sequence:
          - device_id: e6f89081c1f6ace13b0a1929a31cb739
            domain: light
            entity_id: light.suspension_cuisine
            type: brightness_increase
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.command == 'step' and
              trigger.event.data.args[0] == 1 }}
        sequence:
          - device_id: e6f89081c1f6ace13b0a1929a31cb739
            domain: light
            entity_id: light.suspension_cuisine
            type: brightness_decrease
    default: []
mode: single

When my quirk is merged, you will be able to use specific triggers for the remote:

I will keep you in touch

Hello @Xlagrap, i fixed my issue and made a PR for the device support of Lexman remotes (Adeo HR-C99C-Z-C045 & HR-C99C-Z-C045-B) in ZHA (Zigbee Home Automation)

This supports the white remote (LXEK-5) and the new grey model (ZBEK-26)
The PR has been merged, so the remotes should be working in the next Home Assistant version (if it comes with latest ZHA version)

Once you have the new ZHA from Home Assistant update, you should see this in the device detail of your remote:


And you will be able to use the remote in automations like in my previous post!

Hello.
I bought this remote. But I can’t find how to change the colors.
Can you help me ?
Thank you.

Hi @mathoudebine, thanks for doing the work to support this remote :slight_smile:

I just added an integration for this in my ZHA setup, and although the scene buttons 1 to 4 work perfectly, I can’t get any of the other buttons to work. They don’t show up in the event journal, and nothing happens when I use them as scene triggers.

Any idea what the issue can be?

Thanks!

In case that’s helpful, here’s the logs while pairing. I’m not familiar with these logs so I don’t know if they contain anything useful.

[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_rsp: [<Status.SUCCESS: 0>]
[0x0000:zdo] No handler for ZDO request:ZDOCmd.Mgmt_Permit_Joining_rsp([<Status.SUCCESS: 0>])
Device 0xdc05 (b4:e3:f9:ff:fe:02:95:cc) left the network
[0xF800](unk_model): last_seen is 1546764.6507701874 seconds ago and ping attempts have been exhausted, marking the device unavailable
[0xF800](unk_model): Update device availability -  device available: False - new availability: False - changed: False
New device 0x3bcd (b4:e3:f9:ff:fe:02:95:cc) joined the network
[0x3bcd] Scheduling initialization
Received frame on uninitialized device <Device model=None manuf=None nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=False> from ep 0 to ep 0, cluster 19: b'\x81\xcd;\xcc\x95\x02\xfe\xff\xf9\xe3\xb4\x80'
[0x3bcd:zdo] ZDO request ZDOCmd.Device_annce: [0x3BCD, b4:e3:f9:ff:fe:02:95:cc, 128]
Tries remaining: 3
[0x3bcd] Requesting 'Node Descriptor'
Tries remaining: 2
[0x3bcd] Extending timeout for 0x7d request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=False> from ep 0 to ep 0, cluster 32770: b'}\x00\xcd;\x02@\x80w\x12RR\x00\x00,R\x00\x00'
[0x3bcd] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4727, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)
[0x3bcd] Discovering endpoints
Tries remaining: 3
[0x3bcd] Extending timeout for 0x7e request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=False> from ep 0 to ep 0, cluster 32773: b'~\x00\xcd;\x01\x01'
[0x3bcd] Discovered endpoints: [1]
[0x3bcd] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>]
[0x3bcd:1] Discovering endpoint information
Tries remaining: 3
[0x3bcd] Extending timeout for 0x7f request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=False> from ep 0 to ep 0, cluster 32772: b'\x7f\x00\xcd;"\x01\x04\x01\x00\x08\x01\x06\x00\x00\x01\x00\x03\x00\x05\x0b\x00\x10\x01\xfd\x07\x03\x00\x04\x00\x06\x00\x08\x00\x19\x00\x00\x03\x00\x10'
[0x3bcd:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=2048, device_version=1, input_clusters=[0, 1, 3, 2821, 4096, 64769], output_clusters=[3, 4, 6, 8, 25, 768, 4096])
[0x3BCD:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=128, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
[0x3BCD:1:0x0000] Sending request: Read_Attributes(attribute_ids=[4, 5])
[0x3bcd] Extending timeout for 0x80 request
[0x3BCD:1:0x0000] Received ZCL frame: b'\x18\x80\x01\x04\x00\x00\x42\x04\x41\x44\x45\x4F\x05\x00\x00\x42\x07\x5A\x42\x45\x4B\x2D\x32\x36'
[0x3BCD:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=128, command_id=1, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='ADEO')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='ZBEK-26'))])
[0x3bcd] Read model 'ZBEK-26' and manufacturer 'ADEO' from <Endpoint id=1 in=[basic:0x0000, power:0x0001, identify:0x0003, diagnostic:0x0B05, lightlink:0x1000, manufacturer_specific:0xFD01] out=[identify:0x0003, groups:0x0004, on_off:0x0006, level:0x0008, ota:0x0019, light_color:0x0300, lightlink:0x1000] status=<Status.ZDO_INIT: 1>>
[0x3bcd] Discovered basic device information for <Device model='ZBEK-26' manuf='ADEO' nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=True>
Device is initialized <Device model='ZBEK-26' manuf='ADEO' nwk=0x3BCD ieee=b4:e3:f9:ff:fe:02:95:cc is_initialized=True>
Checking quirks for ADEO ZBEK-26 (b4:e3:f9:ff:fe:02:95:cc)
Considering <class 'zhaquirks.adeo.color_controller.AdeoColorController'>
Found custom device replacement for b4:e3:f9:ff:fe:02:95:cc: <class 'zhaquirks.adeo.color_controller.AdeoColorController'>
'button' component -> 'ZHAIdentifyButton' using ['identify']
'sensor' component -> 'Battery' using ['power']
'sensor' component -> 'RSSISensor' using ['basic']
'sensor' component -> 'LQISensor' using ['basic']
device - 0x3BCD:b4:e3:f9:ff:fe:02:95:cc entering async_device_initialized - is_new_join: True
device - 0x3BCD:b4:e3:f9:ff:fe:02:95:cc has joined the ZHA zigbee network
[0x3BCD](ZBEK-26): started configuration
[0x3BCD:ZDO](ZBEK-26): 'async_configure' stage succeeded
[0x3BCD:1:0x0003]: Configuring cluster attribute reporting
Error handling '_save_attribute' event with (b4:e3:f9:ff:fe:02:95:cc, 1, 0, 5, 'ZBEK-26') params: FOREIGN KEY constraint failed
[0x3BCD:1:0x1000] Received ZCL frame: b'\x19\x82\x41\x04\x00\x04\x00\x41\x00\x00\x41\x00\x00\x41\x00\x00\x41\x00'
[0x3BCD:1:0x1000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=130, command_id=65, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x1000] Decoded ZCL frame: LightLink:get_group_identifiers_rsp(total=4, start_index=0, group_info_records=[GroupInfoRecord(group_id=0x4100, group_type=0), GroupInfoRecord(group_id=0x4100, group_type=0), GroupInfoRecord(group_id=0x4100, group_type=0), GroupInfoRecord(group_id=0x4100, group_type=0)])
[0x3BCD:1:0x1000]: Adding coordinator to 0x4100 group id
[0x0000:2] Cannot add 0x4100 group, no groups cluster
[0x0000:1] Cannot add 0x4100 group, no groups cluster
[0x3BCD:1:0x1000]: Adding coordinator to 0x4100 group id
[0x0000:2] Cannot add 0x4100 group, no groups cluster
[0x0000:1] Cannot add 0x4100 group, no groups cluster
[0x3BCD:1:0x1000]: Adding coordinator to 0x4100 group id
[0x0000:2] Cannot add 0x4100 group, no groups cluster
[0x0000:1] Cannot add 0x4100 group, no groups cluster
[0x3BCD:1:0x1000]: Adding coordinator to 0x4100 group id
[0x0000:2] Cannot add 0x4100 group, no groups cluster
[0x0000:1] Cannot add 0x4100 group, no groups cluster
[0x3BCD:1:0x0001]: bound 'power' cluster: Status.SUCCESS
[0x3BCD:1:0x0001] Received ZCL frame: b'\x08\x87\x07\x00'
[0x3BCD:1:0x0001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=135, command_id=7, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x0001] Decoded ZCL frame: PowerConfiguration:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=<Status.SUCCESS: 0>)])
[0x3BCD:1:0x0001]: Successfully configured reporting for '{'battery_voltage': (3600, 10800, 1), 'battery_percentage_remaining': (3600, 10800, 1)}' on 'power' cluster: [ConfigureReportingResponseRecord(status=<Status.SUCCESS: 0>)]
[0xF800](unk_model): last_seen is 1546807.281300068 seconds ago and ping attempts have been exhausted, marking the device unavailable
[0xF800](unk_model): Update device availability -  device available: False - new availability: False - changed: False
[0x3BCD:1:0x0008]: Failed to bind 'level' cluster: 
[0x3BCD:1:0x0006]: Failed to bind 'on_off' cluster: 
[0x3BCD:1:0x0005]: Failed to bind 'scenes' cluster: 
[0x3BCD:1:0x0300]: Failed to bind 'light_color' cluster: 
[0x3BCD:1:0x0003]: 'async_configure' stage succeeded
[0x3BCD:1:0x0001]: 'async_configure' stage succeeded
[0x3BCD:1:0x0000]: 'async_configure' stage succeeded
[0x3BCD:1:0x1000]: 'async_configure' stage succeeded
[0x3BCD:1:0x0008]: 'async_configure' stage succeeded
[0x3BCD:1:0x0006]: 'async_configure' stage succeeded
[0x3BCD:1:0x0019]: 'async_configure' stage succeeded
[0x3BCD:1:0x0005]: 'async_configure' stage succeeded
[0x3BCD:1:0x0300]: 'async_configure' stage succeeded
[0x3BCD](ZBEK-26): completed configuration
[0x3BCD:1:0x0003] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=False), tsn=136, command_id=64, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
[0x3BCD:1:0x0003] Sending request: trigger_effect(effect_id=<EffectIdentifier.Okay: 2>, effect_variant=<EffectVariant.Default: 0>)
[0x3bcd] Extending timeout for 0x88 request
[0x3BCD:1:0x0003] Received ZCL frame: b'\x08\x88\x0B\x40\x81'
[0x3BCD:1:0x0003] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=136, command_id=11, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x0003] Decoded ZCL frame: Identify:Default_Response(command_id=64, status=<Status.UNSUP_CLUSTER_COMMAND: 129>)
[0x3BCD:1:0x0003]: executed 'trigger_effect' command with args: '(2, 0)' kwargs: '{}' result: Default_Response(command_id=64, status=<Status.UNSUP_CLUSTER_COMMAND: 129>)
[0x3BCD](ZBEK-26): started initialization
[0x3BCD:ZDO](ZBEK-26): 'async_initialize' stage succeeded
[0x3BCD:1:0x0003]: initializing channel: from_cache: False
[0x3BCD:1:0x0003]: finished channel initialization
[0x3BCD:1:0x0001]: initializing channel: from_cache: False
[0x3BCD:1:0x0001]: initializing uncached channel attributes: ['battery_voltage', 'battery_percentage_remaining'] - from cache[False]
[0x3BCD:1:0x0001]: Reading attributes in chunks: ['battery_voltage', 'battery_percentage_remaining']
[0x3BCD:1:0x0001] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=137, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
[0x3BCD:1:0x0001] Sending request: Read_Attributes(attribute_ids=[32, 33])
[0x3bcd] Extending timeout for 0x89 request
[0x3BCD:1:0x0000]: initializing channel: from_cache: False
[0x3BCD:1:0x0000]: finished channel initialization
[0x3BCD:1:0x1000]: initializing channel: from_cache: False
[0x3BCD:1:0x1000]: finished channel initialization
[0x3BCD:1:0x0008]: initializing channel: from_cache: False
[0x3BCD:1:0x0008]: finished channel initialization
[0x3BCD:1:0x0006]: initializing channel: from_cache: False
[0x3BCD:1:0x0006]: finished channel initialization
[0x3BCD:1:0x0019]: initializing channel: from_cache: False
[0x3BCD:1:0x0019]: finished channel initialization
[0x3BCD:1:0x0005]: initializing channel: from_cache: False
[0x3BCD:1:0x0005]: finished channel initialization
[0x3BCD:1:0x0300]: initializing channel: from_cache: False
[0x3BCD:1:0x0300]: finished channel initialization
[0x3BCD:1:0x0001] Received ZCL frame: b'\x18\x89\x01\x20\x00\x00\x20\x21\x21\x00\x00\x20\xC8'
[0x3BCD:1:0x0001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=137, command_id=1, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x0001] Decoded ZCL frame: PowerConfiguration:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0020, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint8_t, value=33)), ReadAttributeRecord(attrid=0x0021, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint8_t, value=200))])
[0x3BCD:1:0x0001]: Performing channel specific initialization: ['battery_voltage', 'battery_percentage_remaining']
[0x3BCD:1:0x0001]: Reading attributes in chunks: ['battery_size', 'battery_quantity']
[0x3BCD:1:0x0001] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=138, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
[0x3BCD:1:0x0001] Sending request: Read_Attributes(attribute_ids=[49, 51])
[0x3bcd] Extending timeout for 0x8a request
[0x3BCD:1:0x0001] Received ZCL frame: b'\x18\x8A\x01\x31\x00\x00\x30\x02\x33\x00\x00\x20\x01'
[0x3BCD:1:0x0001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=138, command_id=1, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0x3BCD:1:0x0001] Decoded ZCL frame: PowerConfiguration:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0031, status=<Status.SUCCESS: 0>, value=TypeValue(type=enum8, value=<enum8.undefined_0x02: 2>)), ReadAttributeRecord(attrid=0x0033, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint8_t, value=1))])
[0x3BCD:1:0x0001]: finished channel initialization
[0x3BCD:1:0x0003]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0001]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0000]: 'async_initialize' stage succeeded
[0x3BCD:1:0x1000]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0008]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0006]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0019]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0005]: 'async_initialize' stage succeeded
[0x3BCD:1:0x0300]: 'async_initialize' stage succeeded
[0x3BCD](ZBEK-26): power source: Battery or Unknown
[0x3BCD](ZBEK-26): completed initialization
[0xF800](unk_model): last_seen is 1546811.7858006954 seconds ago and ping attempts have been exhausted, marking the device unavailable
[0xF800](unk_model): Update device availability -  device available: False - new availability: False - changed: False