Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.68k stars 1.64k forks source link

Delays or slow response with SONOFF ZBMINI-L Zigbee 3.0 Smart Switch by ITead #11676

Closed codegourou closed 2 years ago

codegourou commented 2 years ago

What happened?

After a few minutes/hours after pairing the ZBMINI-L start to get delay that increase with time.

It seems that I'm not alone with the issue : https://community.home-assistant.io/t/sonoff-zbmini-l-zigbee-3-0-smart-switch-by-itead-works-without-neutral-wire-and-based-on-cc2652p-so-should-be-a-good-zigbee-router/384644/42

ZBMINI-L Firmware : 1.0.4

What did you expect to happen?

A fast response (the same as just after the pairing of the device).

How to reproduce it (minimal and precise)

Zigbee2MQTT version

1.24.0

Adapter firmware version

20210708

Adapter

SONOFF ZigBEE 3.0 USB Dongle Plus

Debug log

No response

hevili commented 2 years ago

can confirm same Problem

Hedda commented 2 years ago

It seems that I'm not alone with the issue : https://community.home-assistant.io/t/sonoff-zbmini-l-zigbee-3-0-smart-switch-by-itead-works-without-neutral-wire-and-based-on-cc2652p-so-should-be-a-good-zigbee-router/384644/42

FYI, ITead SONOFF ZBMINI-L Zigbee 3.0 Smart Switch installs without neutral wire and is based on the CC2652P (CC2652 P1F) chip.

I don't own this device myself but there are some basic things all should try and more detailed information will also be needed:

  1. Enable Zigbee2MQTT debug logging and Zigbee-herdsman debug logging and provide debug logs https://www.zigbee2mqtt.io/guide/usage/debug.html
  2. Which exact firmware version is on each and every ITead SONOFF ZBMINI-L device with this delay problem?
  3. Can you describe the problem symtoms and your enviroment setup in more detail as well as steps needed to replicate issue? Like in which different scenarios and with what action can you see these delays and is the same problem symptoms always seen, etc.. That is, what installation and steps would someone else need to do installa and take order to replicate the issue?
  4. Is the the ITead SONOFF ZBMINI-L connected though a Zigbee Router device or directly to the Zigbee Coordinator?
  5. If it is connected to through a Zigbee Router device then which exact Zigbee Router device model and firmware on that?
  6. If possible verify that it is still a problem after update the Zigbee Coordinator adapter firmware to at least the latest from Koenkk master branch https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin or better yet to latest develop branch https://github.com/Koenkk/Z-Stack-firmware/tree/develop/coordinator/Z-Stack_3.x.0/bin as those contain many upstream bug fixes from Texas Instruments.
  7. If possible verify that it is also the same problem in the latest Zigbee2MQTT Edge/Dev release (zigbee2mqtt-edge latest dev branch) https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html

PS: By the way, sultanhq from Home Assistant's forum provided these pictures of the inside of his ITead SONOFF ZBMINI-L device:

image

image

image

image

image

image

image

image

codegourou commented 2 years ago

Thanks for your detailed answer ! Regarding your advice :

How to replicate :

raz0rf0x commented 2 years ago

I have this device on a Conbee2 ver 0x26580700. My ZBMINI-L is being routed through one node. Link from coordinator to first node is 225, then from that node to the ZBMINI is 150.

There is a 5 second delay when switching this on or off remotely. Manual activation of this device causes instantaneous state change to be indicated in ZB2MQTT.

codegourou commented 2 years ago

I didn't talk about it, but when I activate the physical switch the state is also instantaneous. The delay is only when activate the switch remotely. But I experience way more than 5s on my side.

hevili commented 2 years ago

i am on 30+ seconds sometimes.. tried with conbee 2 in combination with both zha and zigbee2mqtt. Currently on zha but exactly the same issues here

Hedda commented 2 years ago

FYI, there are now some probably related tips posted about PTVO firmware on other CC2652P based Sonoff branded Zigbee devices from ITead in https://github.com/ptvoinfo/zigbee-configurable-firmware/issues/96 as well as in https://github.com/Koenkk/Z-Stack-firmware/issues/273 and https://github.com/Koenkk/zigbee2mqtt/issues/10282 now.

The tip is that might be a idea to try unofficial PTVO firmware but select the CC2652R chip type (and not CC2652P) in the PTVO firmware configurator to get firmware image without power amplifier enabled (TX power config set to +5dBm output power).

Manually configuring the transmit power to 5 dBm or less in the firmware should probably also work as does there same thing?

It seems that at least some of the radio board modules in ITead's newer products look to have a design flaw/limititation/flaw with missing components needed for using CC2652P with power amplifier enabled as per article about Sonoff ZBMINI v2 (01MINIZB):

https://ptvo.info/custom-firmware-for-sonoff-zbmini-01minizb-and-ewelink-switch-zr-02-923/

That article is the conclusion from -> https://github.com/ptvoinfo/zigbee-configurable-firmware/issues/96

"The firmware for cc2652r has +5dBm output power by default. So, the firmware should be the same as for ZBMINI"

So as a workaround to use PTVO firmware it is probably very likely that selecting CC2652R chip type in the PTVO firmware configurator will result in a working firmware image on the ITead Sonoff ZBMINI-L similar to the new Sonoff ZBMINI (01MINIZB) as both use CC2652P (CC2652 P1F) chip model and their radio modules have same design flaws/limitations/optimizations?

PS: To manually flash new firmware to CC2652 based devices like these you need cJTAG (c/JTAG) compatible adapter like TI CC-DEVPACK-DEBUG adapter or Texas Instruments XDS110. See -> https://electrolama.com/radio-docs/advanced/flash-jtag/

Hedda commented 2 years ago

Be sure to also submit tickets to ITead/Sonoff as the manufacturer as well so they can keep statistics:

https://itead.freshdesk.com/support/home

Based on their support orginazation history ITead/Sonoff had a tendency to not react to reports of clear firmware bugs until enough people have reported the same problem, even if some in community show how to replicate issue to prove fault.

Again for reference also see → https://community.home-assistant.io/t/sonoff-zbmini-l-zigbee-3-0-smart-switch-by-itead-works-without-neutral-wire-and-based-on-cc2652p-so-should-be-a-good-zigbee-router/384644/

Christophe999s commented 2 years ago

Same issue here. I've logged a ticket with Sonoff and have received this response: 'For the ZBMINI-L and HA problem, it is the differences of the trigger mechcanism between HA and our ZBMINI-L. For the problem, our technicans are trying to talk with HA about this problem, please kindly wait for the update of the HA. And if any news, we will also let you know.'

Hedda commented 2 years ago

Same issue here. I've logged a ticket with Sonoff and have received this response: 'For the ZBMINI-L and HA problem, it is the differences of the trigger mechcanism between HA and our ZBMINI-L. For the problem, our technicans are trying to talk with HA about this problem, please kindly wait for the update of the HA. And if any news, we will also let you know.'

Sounds as if their support/technicans are confusing Zigbee2MQTT with the ZHA integration for Home Assistant, or?

dtalens commented 2 years ago

Same issue here with 1.0.5 firmware.

CaptFennec commented 2 years ago

Same issue here. Do you know of good alternatives? (those where cheap and no neutral needed... sounded perfect!)

Koenkk commented 2 years ago

I've fixed the issue now, please check if it works after:

codegourou commented 2 years ago

Hello @Koenkk ! Thanks for the fix.

Really want to try it, but If I see it right, the commit seems not available on on Zigbee2mqtt as an Add-On for HASS. Can you Update the Zigbee2mqtt version in the Add-on dev branch ? (Zigbee2mqtt-edge) As currently I have not other setup to test it. I try to have a look at how I can do that by myself, but can't find the version number of the dev package of Zigbee2mqtt to bump the Add-on version ... Not really used to GitHub and that kind of shared project :( Sorry !

codegourou commented 2 years ago

Hello @Koenkk ! Thanks for the fix.

Really want to try it, but If I see it right, the commit seems not available on on Zigbee2mqtt as an Add-On for HASS. Can you Update the Zigbee2mqtt version in the Add-on dev branch ? (Zigbee2mqtt-edge) As currently I have not other setup to test it. I try to have a look at how I can do that by myself, but can't find the version number of the dev package of Zigbee2mqtt to bump the Add-on version ... Not really used to GitHub and that kind of shared project :( Sorry !

Koenkk commented 2 years ago

@codegourou the fix is available in the edge version of the addon (uninstall and install it again to get the latest version)

codegourou commented 2 years ago

The issue seems fixed 🥳 The module I paired yesterday is still fast to respond. I paired the other module installed this morning. Will keep you informed of the status 🙂 As a reminder previously, only half an hour of time made the module useless. So I'm really confident !

Koenkk commented 2 years ago

Awesome, the problem should appear in one hour after pairing.

codegourou commented 2 years ago

Works like a charm ! Thanks !!!!! Let the automation begin :-D

DolceTriade commented 2 years ago

I updated to the dev branch1.25.0-dev commit: d90be2d and I reconfigured the device. Is that sufficient? to test? For now, there appears to be no change.

codegourou commented 2 years ago

You need to remove and re-pair your device(s). It still work with no latency at all on my side 👍

codegourou commented 2 years ago

You need to remove and re-pair your device(s). It still work with no latency at all on my side 👍

jonmasters commented 1 year ago

Super awesome to see the proactive fix! I'm about to install a few of these and was super pumped to see this was fixed :)

rdorys commented 1 year ago

Hi all, It seems that the same problem appears on the ZBMINI-L2. Has anyone has both models to compare? This is weird because all both model have exactly the same adapters.

pernatiy commented 1 year ago

Sorry for commenting in an year old issue, but I don't think that it worth to create a new one.

Came here from comment on sonoff.js:62. I've got fresh ZBMINIL2 switches with FW 1.0.10 and during pairing I see error

Failed to configure 'ZBMINIL2_MAC', attempt 1 (Error: Unbind ZBMINIL2_MAC/1 genPollCtrl from 'COORDINATOR_MAC/1' failed (Error: status: 136) at DeconzAdapter.unbind (/app/node_modules/zigbee-herdsman/src/adapter/deconz/adapter/deconzAdapter.ts:820:19) at Endpoint.unbind (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:596:13) at Object.configure (/app/node_modules/zigbee-herdsman-converters/devices/sonoff.js:62:13) at Configure.configure (/app/lib/extension/configure.ts:117:13))

As I understood "status 136" means "nothing to unbind". The problem is that exception prevents normal device pairing completion. Is it enough just to wrap the call to unbind in the try block or some more complicated logic should be introduced?

EDIT: Attach current ZBMINIL2 clusters image

D3SL commented 1 year ago

Has this been integrated into the mainline HA add-on yet? I've got both a zbminiL (firmware 1.1.1) and zbminiL2 and both have an inconsistent but always noticeable delay, even when using the physical switch.

bushbrother commented 1 year ago

I have a ZBMINIL2 and also notice delay when using physical switch. FW is 10.0.10. Trying to do OTA causes errors:

2023-05-05 16:52:47 Failed to check if update available for 'Bathroom Switch' (No image available for imageType '4')

I assume that is because there simply isnt one? It is not in the OTA images on github ...

Anything else to check?

D3SL commented 1 year ago

I've just wired up my last two unused ZBMini-L's (firmware 1.1.1), grouping them in HA, and the lag is unreasonable. They never respond in less than a full second, very often take up to several seconds, and don't properly follow zigbee2mqtt grouping (they'll show as if they've been toggled on or off but not actually change state in real life).