Zha_event flaking out

I have noticed that recently zha_event seems to work only when it wants to. I have an outlet:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=0, maximum_outgoing_transfer_size=160, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 49246,
      "device_type": "0x0010",
      "in_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006"
      ],
      "out_clusters": [
        "0x0000"
      ]
    }
  },
  "manufacturer": "eWeLink",
  "model": "SA-003-Zigbee",
  "class": "zigpy.device.Device"
}

I can control this outlet from HA. It shows up in Lovelace correctly, and it responds accordingly when I manually turn the outlet on and off. But when I listen for it in developer->events, the messages don’t show up. This isn’t the only device like this on my network. This outlet is about 10ft (3m) from my laptop with the zigbee controller. I do get some messages when I listen to zha_event, but not all of them. Weird.

One common issue is reception interference on the side of Zigbee coordinator causing poor reception.

Suggest you begin by follow some of these general recommendation before troubleshooting any further:

https://github.com/home-assistant/home-assistant.io/pull/18864https://github.com/home-assistant/home-assistant.io/pull/18864/commits/b21c49589d898d60a1a235afa7b9c148d013cfee

I would start by adding a long USB extension cable to get the Zigbee Coordinator a bit further away.

And of course, make sure that you upgrade to the latest firmware on your Zigbee Coordinator adapter.

Also read the generic tips here:

https://www.home-assistant.io/integrations/zha#best-practices-to-avoid-pairingconnection-difficulties

Another tip is to shield your computer and USB devices or peripherals connected to computers as well as other appliances or cables/wires located close to your Zigbee Coordinator. As already established if you read those other tips, Zigbee radio can be very susceptible to electromagnetic interference (EMI, also called radio-frequency interference or RFI), and one very common source that generates electromagnetic fields is unshielded computers and unshielded peripherals so make sure that you use for example enclosures for external hard drives and single-board-computers that are made of metal instead of plastic. Especially known to have a huge interference impact on wireless devices using radio frequency like Zigbee radios are USB 3.0 devices/peripherals (for more details on that read white paper report on the subject by Intel at https://www.usb.org/sites/default/files/327216.pdf).