Log messages for Zigbee Device ZDO - trying to locate binding issue

I have amended the core zha part of Home Assistant as a custom_component to extend binding possibilities.
While the log indicates some success, no packet is actually sent over the air:

2021-10-25 01:16:08 INFO (MainThread) [custom_components.zha.api] Devices bound: source_ieee: [00:15:8d:00:04:7b:83:69] target_ieee: [00:12:4b:00:22:09:1a:0f]

I’ve enabled plenty of logging but I could not catch either of the messages generated by the following code (either success or failure):

        zdo.debug(f"processing {op_msg}", *op_params)

        if isinstance(outcome, Exception):
            fmt = f"{log_msg[1]} failed: %s"
        else:
            fmt = f"{log_msg[1]} completed: %s"
        zdo.debug(fmt, *(log_msg[2] + (outcome,)))

added logging (also see Zigbee Home Automation - Home Assistant ):

default: warning
logs:
  homeassistant.core: debug
  homeassistant.components.zha: debug
  bellows.zigbee.application: debug
  bellows.ezsp: debug
  custom_components.zha: debug
  zigpy: debug
  zigpy_deconz.zigbee.application: debug
  zigpy_deconz.api: debug
  zigpy_xbee.zigbee.application: debug
  zigpy_xbee.api: debug
  zigpy_zigate: debug
  zigpy_znp: debug
  zhaquirks: debug
  # Extra, not sure this works:
  zigpy.zdo: debug
  zigpy.device: debug
  zigpy_znp.api: debug
  ZDO: debug

I’ve extracted the core zha component in custom components, very much like this:

#!/bin/bash
# Run from config directory

# This script supposes relative path for HA_CORE_DIR
HA_CORE_DIR=ha-zha
GITHUB_USER=GITHUB_USERNAME_THAT_FORKED_THE_HA_CORE

git clone --depth 1 --no-single-branch --filter=blob:none --sparse [email protected]:${GITHUB_USER}/core.git ${HA_CORE_DIR}

( cd ${HA_CORE_DIR} ;  gitusergithub ;
  git sparse-checkout set homeassistant/components/zha ;
  git remote add upstream https://github.com/home-assistant/core ;
  perl -i -p -e 's@fetch = +refs/heads/dev:refs/remotes/origin/*@fetch = +refs/heads/*:refs/remotes/origin/*@;' .git/config ;
  git remote set-branches origin '*' ;
  git fetch -v
)
ln -s ../${HA_CORE_DIR}/homeassistant/components/zha custom_components/zha

echo "Now add version key to 'custom_components/zha/manifest.json'"

I am trying to catch the device ZDO debug messages, but nothing appears for that type of messages in the file home-assistant.log.

Any suggesting on how to add them to the traces?

I enabled more logging by adding:

  zigpy_znp.zigbee.zdo_converters: debug
  zigpy_znp.zigbee.application: debug
  zigpy_znp.commands.application: debug
  zigpy_znp.commands.zdo: debug
  zigpy_znp.commands.znp: debug
  zigpy_znp.logger: debug
  zigpy.util: debug

But I still do not get the “… completed:” or “… failed:” messages.

To make cut&paste easier, the complete loggin configuration:

default: warning
logs:
  homeassistant.core: debug
  homeassistant.components.zha: debug
  bellows.zigbee.application: debug
  bellows.ezsp: debug
  custom_components.zha: debug
  zigpy: debug
  zigpy_deconz.zigbee.application: debug
  zigpy_deconz.api: debug
  zigpy_xbee.zigbee.application: debug
  zigpy_xbee.api: debug
  zigpy_zigate: debug
  zigpy_znp: debug
  zhaquirks: debug
  # Extra, not sure this works:
  zigpy.zdo: debug
  zigpy.device: debug
  zigpy_znp.api: debug
  zigpy_znp.zigbee.zdo_converters: debug
  zigpy_znp.zigbee.application: debug
  zigpy_znp.commands.application: debug
  zigpy_znp.commands.zdo: debug
  zigpy_znp.commands.znp: debug
  zigpy_znp.logger: debug
  zigpy.util: debug
  ZDO: debug

Note: the zigpy_ZNP entries are useful for me because I use A TI ZNP stack.