Tuya wall switch stops responding after a few minutes

Hi,

I recently bought a Tuya Zigbee3.0 wall switch.

It paired right away with ZHA and while it was detected as a light instead of a switch, it worked. However, after a few minutes, it just stops working. Toggling the light doesn’t do anything and when I try reading any of the attributes via “Manage zigbee device”, that fails also. I tried forcing it to be detected as a switch by adding the code below to my configuration.yaml, but that does not make any difference.

zha:
  device_config:
    a4:c1:38:08:30:af:69:92-1:
      type: "switch"

However the funny thing is that if I physically turn the light on, it immediately reports and I can again turn it off/on via ZHA. But again after a few minutes it stops working.

So it would appear that the device goes into some kind of idle/sleep state, even though this is a mains powered device (and is also detected as such).

Screenshot from 2022-10-23 10-13-27

I use the Sonoff Zigbee 3.0 usb dongle as coordinator connected to my RPI4 via a USB extension cable. I am on core 2022.10.5. Any ideas? Or do I just have a faulty device?

Device diagnostics

Assuming that you have connected Neutral (N) wire as well and not just the Live (L) wire as required?

Suggest report new issue as a device support request as most Tuya devices do not follow the Zigbee standards and therefor need custom quirk → https://github.com/zigpy/zha-device-handlers/issues

Read why → https://www.home-assistant.io/integrations/zha#zha-exception-and-deviation-handling

Only other specific tip is to upgrade your Zigbee Coordinator adapter firmware so have latest bug-fixes.

Also always follow generic tips → https://github.com/zigpy/zigpy/wiki/Generic-best-practice-tips-on-improving-Zigbee-network-range-and-general-stability

Thanks for the tips. I initially also was thinking that the power supply was not wired up reliably, but I measured it all out. Both live and neutral wires are connected properly.

I do have a reasonably large Zigbee mesh, about 39 devices, with a fair amount of router devices, mostly Ikea tradfri signal repeaters, mains powered light switches and a few bulbs. Nevertheless, I’ll go through all the tips. If I look at the visualization of my Zigbee mesh, I see mostly red lines. I never fully understood that visualization, but I assume red = bad. I never bothered since all my other devices always work reliable and reasonably fast.

I did notice that after being in my mesh for 2 days, the device does respond if I toggle it via home assistant, but it usually takes two or more tries and then there is a delay of a few seconds. Once it has toggled it does respond quick again. Very weird behavior, but maybe indicative that my zigbee network is not really optimal?

I’ll go through all the tips and if it doesn’t improve, I’ll file a device support request.

I see I am on fairly old FW for my coordinator. If I update the FW on my coordinator, will I need to repair all my devices? Or should I use the migrate radio option from ZHA?

Latest HA/ZHA does automatic backups and will gives option to restore if firmware update reset adapter, so you should not need to re-pair any devices, but can sometimes take some time before they reconnect.