Re-connect Zigbee key after mini-PC change

Hello Sorry to bother you

First of all, congratulations from a great-grandfather on the very good news of the upcoming arrival of your child.

Congratulations also on all the progress, it impresses me …

When changing the PC that hosts Gladys, after reinstallation thanks to the backups Gladys Plus … I’m stuck on reactivating the Sonoff key in zigbee2mqtt …

Error of the Zigbee2mqtt container: Node Error: write after end

Thank you and have a good day

Hello @mabille,

I took the liberty of making your message public. Avoid sending me private messages for this type of question: it can help other users, and anyone on the forum can help you. You would probably have gotten a response faster by posting directly in public :wink:

Thank you very much for your congratulations, and thank you also for your words about the progress of Gladys, it really makes me happy!

Regarding your issue, the error Error: write after end in the Zigbee2mqtt container almost always means that Zigbee2mqtt is trying to communicate with a USB port that is no longer (or is no longer) that of your Sonoff key. The connection closes immediately, then Zigbee2mqtt continues to write to it. This is very common after a PC change, as the port on which the key is detected often changes from one machine to another, while the backup restores the old configuration.

I advise you to check these two points, in order:

1. Re-select the USB port in Gladys

Go to Settings → Integrations → Zigbee2mqtt → Configuration and look at the field « Select the USB port on which the Zigbee dongle is inserted ».

Even if a port is already selected, choose again from the list the one that corresponds to your key on this new PC, then save. Gladys will then recreate the Zigbee2mqtt container with the correct device. This is the most important point, because as long as you don’t go through this page again, the old port is kept.

If the list is empty, it means that Gladys does not have access to the machine’s USB ports. In this case, check that the installation was indeed carried out with the command indicated in the official documentation: during a manual reinstallation, the options giving access to the devices are sometimes forgotten.

2. Check the selected key model

Just below, the field « Select the model of the Zigbee dongle » is just as important. It determines how Zigbee2mqtt communicates with the key.

Be careful, the two Sonoff models do not work the same way:

  • ZBDongle-PSONOFF Zigbee 3.0 USB Dongle Plus ZBDongle-P
  • ZBDongle-EITead Sonoff Zigbee 3.0 USB Dongle Plus V2 model "ZBDongle-E"

If the selected model does not match your key, the connection will fail exactly in this way.

If you are using a ZBDongle-E whose firmware has never been updated, Gladys will display a warning on the same page. In this case, simply select the entry ITead Sonoff Zigbee 3.0 USB Dongle Plus V2 model "ZBDongle-E" (legacy ezsp)": it will work without having to update the firmware.

The good news is that if you are indeed using the same key as before, your Zigbee network and all your devices will be found as they were. You won’t have to re-pair anything once the connection is restored.

Thanks for the inconvenience…

Hello Although the Z2M service seems to be reconnected … a message …

Zigbee2MQTT container error: `[2026-09-21 08:44:48] error: zh:ezsp:uart: Can't send DATA frame (0,1,0): 1800012800

Thanks

Hi Jean-Jacques,

No worries, and good news: the service is back online, the hardest part is done :slightly_smiling_face:

This new error has nothing to do with the previous one: it comes from the driver used to communicate with your key. The prefix zh:ezsp:uart indicates that Zigbee2mqtt is using the old ezsp driver. This is very likely automatic: during an update, Gladys renamed existing ZBDongle-E configurations to ... (legacy ezsp) to avoid breaking existing installations. However, this driver is now deprecated on the Zigbee2mqtt side, and it generates exactly this kind of communication errors.

Here’s what I recommend you do:

Go back to Settings → Integrations → Zigbee2mqtt → Configuration, and in the field « Select the Zigbee dongle model », choose the entry without the mention « (legacy ezsp) », i.e.:

ITead Sonoff Zigbee 3.0 USB Dongle Plus V2 model "ZBDongle-E"

Then save. Gladys will then restart Zigbee2mqtt with the modern driver (ember), much more stable and still maintained. Your Zigbee devices will be preserved, there’s nothing to re-pair.

One special case: this driver requires a key firmware version 7.4.x or higher. If your firmware is older, Gladys will indicate this with a warning on the same page, and Zigbee2mqtt will not start. In this case, you need to update the key firmware (this can be done in a few minutes from a Windows PC with Chrome).

A question by the way: are your Zigbee devices correctly reporting their values in Gladys (temperatures, states, etc.)? I ask because Gladys displays the last error line found in the container logs, even when it is not blocking. If everything is working normally, this message may just be a temporary warning, but switching to the ember driver is still the right thing to do in all cases.

Last tip, valid for all Zigbee keys on a mini-PC: if you notice device disconnections, plug the key into a small USB extension cable rather than directly into the case, and if possible into a USB 2.0 port. USB 3.0 ports and proximity to the chassis greatly disrupt the 2.4 GHz signal.

Thanks again, the problem is clearing up… I just need to update the firmware… but I only have a Mint PC available… and I can’t figure it out…

In the guide suggested in the warning, I’m lost and don’t know which option to choose…

The best is to go to this page with Google Chrome, Chromium, or Microsoft Edge: https://darkxst.github.io/silabs-firmware-builder/

If you have a permission issue, you need to check that your user is part of the dialout group

otherwise sudo usermod -a -G dialout $USER

Thanks, I’ll test with Chromium which I’m going to install… Thanks

And if I buy a new key, would it be up to date?

Logically yes, but logic is never rational :frowning:
You might have a key from an old stock and therefore with old firmware.

It depends on who you ask, but yes. But it’s an easy operation, you’ll manage it :flexed_biceps: