zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Tuya TS0501B LED Strip dimmer - joins, interviews then drops off network 20 seconds later & won't stay connected (Telink Chipset with Ember adapter)

Open techie-dreamer opened this issue 1 month ago • 3 comments

What happened?

Tuya TS0501B joins and interviews successfully, then leaves network (after 20 seconds) and won't stay joined. Loop repeats.

Device is question is 0xa4c138fec707c0a4 from logs below (debug enabled)

Seems similar to other devices: https://github.com/Koenkk/zigbee2mqtt/issues/33257 https://github.com/Koenkk/zigbee2mqtt/issues/33417

What did you expect to happen?

  • Permit join in UI pressed
  • Put device into pairing mode (long hold button on device, lights pulse)
  • Device joins & interviews
  • Device remains on the network

How to reproduce it (minimal and precise)

  • Permit join button pressed in z2mqtt
  • Put device into pairing mode (press and hold button left button on device)
  • Device joins & interviews
    • Device then leaves 20 seconds later
  • Cycle repeats if try again

Have also troubleshooted by:

  1. Removing device manually from configuration.yaml & checked database.db
  2. Permit join via Co-ordinator & a known good close router = Same result

Zigbee2MQTT version

2.14.3-1

Adapter firmware version

Revision: 8.0.2 [GA]

Adapter

smlight SLZB-06Mg24 / EmberZNet

Setup

Controller: smlight SLZB-06Mg24 / EmberZNet Zigbee2MQTT version: 2.14.3 Frontend version: 2.15.1 zigbee-herdsman-converters version: 26.125.0

HA System Installation method: Home Assistant OS Core : 2026.10.4 Supervisor: 2026.10.5 Operating System: 18.4 Frontend: 20260930.5 Hardware: Pi5

Device database.db entry

doesnt seem to show up there database.db.txt

Debug log

configuration_redacted.yaml log (2).log

Notes

Did change controller about 12 months ago but no problems since then & think I cloned the IEEE address when I did it. Other devices such as Ikea Inspelling socket join recently with no issues.

techie-dreamer avatar Nov 01 '26 09:11 techie-dreamer

Image Device briefly showing up in device list and being controllable then drops off again within seconds

techie-dreamer avatar Nov 01 '26 10:11 techie-dreamer

OK, so I've spend most of the day playing with this cheeky issue and I think I've found the solution 🥳

What the Issue Was, Why It Occurred & How to Resolve using ember-zli

  • ❤‍🩹 Symptom: The Tuya TS0501B LED controller (_TZ3210_agjx0pxt, appVersion: 105, Telink chipset) joins the network, completes the Zigbee2MQTT interview (Successfully interviewed & Successfully configured), briefly responds to commands, and then voluntarily leaves the network (DEVICE_LEFT) 21-22 seconds after joining every single time.

  • 👀 Root Cause: Enabling debug logging revealed zh:ember:ezsp: ezspZigbeeKeyEstablishmentHandler: partner=<DEVICE_IEEE_ADDRESS> status=TC_REQUESTER_VERIFY_KEY_TIMEOUT.

  • Because the coordinator had previously been migrated from a TI Z-Stack adapter to an EmberZNet adapter (SLZB-06Mg24 ) by cloning the old coordinator IEEE address, the Silicon Labs NVM3 security tokens had a post-IEEE migration EUI64 / Trust Center Link Key (TCLK) mismatch (Zigbee2MQTT Troubleshooting: Post-IEEE (EUI64) migration troubles ).

  • Under the Zigbee 3.0 Base Device Behavior (BDB) spec, when the device's Verify Key handshake times out after ~20 seconds, newer Telink firmware strictly enforces the spec and leaves the network.

How I solved it (summarised with a bit of Gemini):

Step-by-Step Instructions to Fix Your Coordinator (~5 Minutes, No Re-Pairing Required)

If you use a network-attached Ember coordinator (e.g. SLZB-06M / SLZB-06Mg24 over TCP), you can run ember-zli from any computer on your local network (Mac, Windows, or Linux) without needing to run it inside the Home Assistant container.

Step 1: Stop Zigbee2MQTT & Clean Up Any Stale Config Entry
  1. In Home Assistant, download a backup copy of /config/zigbee2mqtt/configuration.yaml, /config/zigbee2mqtt/coordinator_backup.json, and /config/zigbee2mqtt/database.db.
  2. ⚠ ⚠ Go to Settings -> Add-ons -> Zigbee2MQTT and click Stop (the coordinator's TCP socket only allows one connection at a time, so ember-zli cannot connect while Z2M is running).
  3. Open /config/zigbee2mqtt/configuration.yaml, remove the orphaned <DEVICE_IEEE_ADDRESS> entry under devices: if one was left behind after it dropped off, and save.
Step 2: Create the ember-zli TCP Connection File on Your Computer

To avoid ember-zli only scanning local USB/serial ports on first launch, create ~/ember-zli/conf_port.json in your home directory pointing to your coordinator's IP and port:

mkdir -p ~/ember-zli
cat > ~/ember-zli/conf_port.json << 'EOF'
{
  "baudRate": 115200,
  "path": "tcp://<YOUR_COORDINATOR_IP>:6638",
  "rtscts": false,
  "xon": false,
  "xoff": false
}
EOF
Step 3: Download & Launch ember-zli

Pick whichever option is easiest on your computer:

  • Option A - If you already have Node.js (v22.22+) installed:
    npx ember-zli@latest stack
    
  • Option B - If you do NOT have Node.js installed (Standalone App):
    1. Download the standalone archive for your OS (macOS-arm64.tar.gz, macOS-x64.tar.gz, linux-x64.tar.gz, or win-x64.zip) from github.com/Nerivec/ember-zli/releases.
    2. Extract the archive, open a terminal inside the extracted folder, and run:
      ./bin/ember-zli stack
      
      (On Windows Command Prompt / PowerShell, run .\bin\ember-zli.exe stack and place conf_port.json in C:\Users\<YourUsername>\ember-zli\conf_port.json.)
Step 4: Repair the EUI64 / Trust Center Mismatch in ember-zli

Once ember-zli stack opens:

  1. Confirm Port: Press Enter to accept the pre-configured port (tcp://<YOUR_COORDINATOR_IP>:6638 at 115200).
  2. Repair the Trust Center Address:
    • Select Repairs -> press Enter.
    • Select Check for EUI64 mismatch -> press Enter.
    • If a mismatch is detected, ember-zli will automatically log Fixing EUI64 mismatch... and overwrite the stale Trust Center address with your coordinator's IEEE address.
    • When prompted Restart? (If no, exit), press Enter (or Y) to return to the main stack menu.
  3. Write the EUI64 Token to Flash:
    • On the main stack menu, select Write EUI64 NVM3 token -> press Enter.
    • At Source for the EUI64, select From manual input (format: 0x0000000000000000) -> press Enter.
    • Type <YOUR_COORDINATOR_IEEE_ADDRESS> (e.g. 0x00124b00... from your database.db coordinator entry) and press Enter.
  4. Exit: When prompted Restart? (If no, exit), press N (No) to close ember-zli.
Step 5: Start Zigbee2MQTT & Pair the Device
  1. In Home Assistant, go to Settings -> Add-ons -> Zigbee2MQTT and click Start.
  2. Bring the TS0501B controller within 1-2 metres of the coordinator (or a strong mains router) so the key exchange doesn't drop frames over weak RF.
  3. Click Permit join (All), put the TS0501B into pairing mode, and wait 30 seconds - the TCLK verification now completes cleanly and the device stays connected.

(Fallback note: If Check for EUI64 mismatch reports "EUI64 match. No fix required." and the device still drops after ~20s with TC_REQUESTER_VERIFY_KEY_TIMEOUT, follow Step 3 of the Post-IEEE migration guide: run ./bin/ember-zli bootloader -> Clear NVM3 -> Exit bootloader, then ./bin/ember-zli stack -> Write EUI64 NVM3 token -> enter <YOUR_COORDINATOR_IEEE_ADDRESS>, exit, and start Zigbee2MQTT so it restores coordinator_backup.json onto a clean NVM3 flash without losing existing devices.)

techie-dreamer avatar Nov 01 '26 17:11 techie-dreamer

For those that find this issue and have a coordinator like me: CC2652P running Zstack (CC1352P2_CC2652P_launchpad_coordinator_20240710.hex), this solved the leave-after-join issue for me:

  1. Stop Zigbee2MQTT In my case running Zigbee2MQTT inside a rootless Podman container:

systemctl --user stop zigbee2mqtt.service

  1. Reset NVRAM This works on my RPI5 with Python 3 installed. Note that it uses the /tmp folder which is just a RAM disk which gets wiped after a reboot (or rm -r /tmp/znp-venv ). Don't forget to replace FILL_IN_HERE.
python3 -m venv /tmp/znp-venv
/tmp/znp-venv/bin/pip install zigpy-znp
/tmp/znp-venv/bin/python -m zigpy_znp.tools.nvram_reset /dev/serial/by-id/FILL_IN_HERE
  1. Start Zigbee2MQTT In my case running Zigbee2MQTT inside a rootless Podman container:

systemctl --user start zigbee2mqtt.service

Google's Gemini gave me this solution. Note that I ran into the issue while trying to pair Tuya TS0001_power, very similar, if not equal to #31232 Note that the post above by @techie-dreamer and this post may also solve:

  • #25528
  • #30455
  • #33167
  • #33257
  • #33293
  • #33323
  • #33417
  • #33560
  • #33691
  • #33727

P.S. Thank you very much to @Koenkk and all contributors for this great piece of software; I run my entire house on it!

woutput avatar Nov 18 '26 09:11 woutput