TS0041 scene switch won't stop 'configuring'

I am new to HA and YAML but successfully got a generic Chinese 1-gang scene switch (TS0041) working using a modified quirk. (The trick is to use the TS0044 quirk and change the name – see separate postings).

I use it to toggle a ceiling light with a simple automation. I had it working on my test bench but when I installed it on site it behaves oddly: it repeatedly ‘configures’ until the time runs out and then does not work.

  1. I set ZHA to search for new devices
  2. I put the scene switch in pairing mode by pressing the button for 6 seconds (the light flashes)
  3. ZHA finds it, goes through configuration and says it is “device is ready to use” (and shows the name I set for it)
  4. The switch works briefly … but the ‘pairing’ light on the device continues flashing and
  5. Then ZHA starts configuring it again …
  6. And again … and again until the time runs out (3 min).
  7. At this point it is not working and if I start a new search it cannot be found.

I can start again if I remove the battery and replace it, but the same thing happens.

I first suspected a poor Zigbee signal but it is only a couple of metres away from the nearest repeater and I tried explicitly linking it to that repeater. I tried it in other locations including close to the (SONOFF) hub (which is how I tested it originally) – no difference.There are other Zigbee items in the same room that work fine.

Somehow it seems the device does not ‘know’ that it is paired. Is there a signal ZHA sends to tell it to go out of pairing mode?

I do not even know where to start debugging this!

Submit a device feature request to https://github.com/zigpy/zha-device-handlers/issues for tracking until it work as it should so get a dedicated quirk that can be reused and referenced by others in the future.

For those kinds of symptoms I otherwise always highly recommend starting by following this in-depth best practice guide regarding reception optimization and interference avoidance before troubleshooting any further, regardless of which Zigbee Coordinator radio adapter and Zigbee gateway solution that you use → Guide for Zigbee interference avoidance and network range/coverage optimization (and then if still have issues then also follow these other related best practices to at least re-pair your devices again in their final location after tried to take on all the suggested actions → Zigbee Home Automation - Home Assistant).

If your problem(s) remains after that then you need to open an issue for the ZHA integration in the Home Assistant core with included debug logs etc. → https://github.com/home-assistant/core/issues

@Hedda Thanks for your response

  1. There is already a device support request
    [Device Support Request] TS0041 needs quirk from TS0044 · Issue #1557 · zigpy/zha-device-handlers · GitHub

    The issue of TS0041 (and -42, -43) devices that need a quirk with 4 endpoints (like TS0044) has been discussed in various places including this forum and
    [Device Support Request] TS0041 needs quirk from TS0044 · Issue #1557 · zigpy/zha-device-handlers · GitHub
    Chinese TS0041 1-bang zigbee scene switch on ZHA. Troubleshooting. | by Eduard Dubilyer | Medium
    I built mine using this information and it works, insofar as I can detect button pushes in an automation trigger.

  2. Thanks for the reference to your tips regarding optimisation of the Zigbee network, which I shall study carefully. I already followed the HA tips. However as I said I already tried the device in several locations, and the final location has a repeater nearby, so the network is not likely to be pertinent to the problem of this thread.

  3. If I do not get a solution from this posting I will try to gather the information for an issue report later, but am otherwise engaged for the next couple of months.