TUYA TS0601 Zigbee garage door opener

Thank you for this post. Worked perfectly for my Tuya Garage Opener (_TZE200_nklqjk62)

1 Like

Hello all,
I’m still facing the same issue even if I have the quirk installed and loaded to the device (thanks to Illinoid)

Here a screen

In the log when I paired it, I got these errors:

2023-02-19 21:21:52.167 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (XX:XX:XX:XX:XX:XX:XX:XX, 1, 0, 4, '_TZE200_nklqjk62') params: FOREIGN KEY constraint failed
2023-02-19 21:21:52.192 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (XX:XX:XX:XX:XX:XX:XX:XX, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed

I tried some different scripts even one from the latest release https://github.com/zigpy/zha-device-handlers.

Maybe, I done something wrong because I’m new in the community :wink:

Other information, only the AC is connected. I’m waiting to finalize all the configuration in HA before plugging in the sensor and the contactor.


I just installed my TS0601 based on the info of the thread here. I got no sucess with the latest version of the device handler.I did not initialize the Zigbee at all anymore :-/.

However, the January commit zha-device-handlers/ts0601_garage.py at a16c153131afffdcdcae711e1695575d8267d703 · zigpy/zha-device-handlers · GitHub

Worked perfectly fine so far, so may be it helps for you too


Hi Michael,

I have the same issue with the one you sent me… No luck for me or just a big failed from my part :laughing:

You only enabled quirks in configuration file like bellow and put the python file in the location written in the conf ?
Then you restarted your HA and paired your device ?

Thanks in advance.

I did 1:1 as described above.


  custom_quirks_path: /config/zhaquirks

Edit: but w/o the / at the end that you added

Not better…

Could you send me what you get in your two tabs “Informations” and “Diagnostic” please ?

I miss something. Lot of guys succeeded to pair and use this device.

The other big difference is I didn’t connect the contactor and the sensor but I don’t see how this could make an issue…

i would - if you can tell me which you mean…

OK, sorry, I ask it differently.

Could you send me a screenshot of your device informations like I did with mine in this thread ?
Where " Informations Appareil" and “Diagnostic” are showed please.

I just want to know what is exactly written in both cards when the device is correctly recognized :wink:

Thank you very much.

Thanks a lot Michael :smiley:

You don’t have exactly the same device as me: you have a TZE200_wfxuhoea and me it’s a TZE200_nklqjk62. But both are listed in the python file.

Ok I see what we have to get in the device informations.

Perhaps, I have to raise an issue on the python file in Github.

This quirk is now broken with HA 2023.3.x

ZHA fails to load with:

Logger: homeassistant.config_entries
Source: zhaquirks/ts0601_garage.py:19
First occurred: 5:36:29 PM (1 occurrences)
Last logged: 5:36:29 PM

Error setting up entry ZigBee for zha
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File “/usr/src/homeassistant/homeassistant/components/zha/init.py”, line 100, in async_setup_entry
File “/usr/local/lib/python3.10/site-packages/zhaquirks/init.py”, line 409, in setup
File “”, line 548, in _check_name_wrapper
File “”, line 1063, in load_module
File “”, line 888, in load_module
File “”, line 290, in _load_module_shim
File “”, line 719, in _load
File “”, line 688, in _load_unlocked
File “”, line 883, in exec_module
File “”, line 241, in _call_with_frames_removed
File “/config/zhaquirks/ts0601_garage.py”, line 19, in
from zhaquirks.tuya.mcu import (
ImportError: cannot import name ‘TuyaDPType’ from ‘zhaquirks.tuya.mcu’ (/usr/local/lib/python3.10/site-packages/zhaquirks/tuya/mcu/init.py)

I think HA updated the ZHA devices repo and the libraries in this quirk no longer work. I tried to unpack the entire Release 0.0.93 · zigpy/zha-device-handlers · GitHub into ZhaQuirks path (after removing this custom quirk) and ZHA did load but the garage door device was once again missing the switch and binary_sensor.

Hi all… sorry I’d not been here in a while, but unfortunately I’m back, and agree with @SimonYel about how 2023.3.x breaks this quark! Same exact experience after upgrading. Have rolled back my VM snapshot for now… hoping that someone can figure out what happened! Took long enough trying to figure out how to get this garage door control to work… now feel as though it’s been stripped away. :frowning:

1 Like

I agree. Just tried installing this for the first time and after having things in place rebooting HA resulted in the same:

Removing the ts0601_garage.py file and rebooting allowed Zigbee to start. Running:
Home Assistant 2023.3.1
Supervisor 2023.03.1
Operating System 9.5
Frontend 20230302.0 - latest

@SimonYel got it!
Just Copy past over my old file.

Its working!
Thank you @SimonYel

Worked for me as well… thanks to all involved!

@Illinoid Kinda off topic, but did you use AC input to power the device? I wired mine up as per the instructions and it released the magic smoke.

Are you @kimme1024 still experiencing this random opening issue or did you give up on getting your garage door opener to work reliably? I think I have faced the same problem and am now trying to change my set-up and monitor the situation. Since I somehow also had problems with the status of the door contact sensor I have now moved to another 3rd party device sensor and added that to the cover template. Will try to experiment a bit with your information, e.g. to see if I can replicate the behavior when plugging out and in the power supply and if the status of the Loratap / Tuya sensor makes any difference in any of the situations.

Hi @balu79,

Sadly I gave up on this.
The issues remained…
I didn’t have any problems with the contact sensor but the garage door opened unexpectedly once or twice a day which obviously wasn’t what I was aiming for.
I didn’t have the issue on power-on anymore.

I think I’ll go with a bit more expensive solution for the next try but it’s not high on my priority list atm.

If you’d find a solution I’d be happy to test it out!

Ok, thanks! I will have to monitor it for a few more days at my end. On Tuesday evening I changed my set-up by making the following changes and so far haven’t yet observed any unwanted openings, but it’s too early to say whether this is related to my changes or just coincidence / some other reason:

  • Replaced Loratap / Tuyya contact sensors with 3rd party contact sensors at my garage door
  • (Kept old Loratap / Tuyya contact sensors laying somewhere in garage in closed status)
  • Changed the cover template by replacing the Loratap / Tuyya sensor entities with the 3rd party sensor entities
  • Deactivated a scene in Alexa (pointing to a script in Home Assistant)

Fyi, couldn’t replicate the opening on power-on at my end (but understand that this was probably intermittent for you).

Hi @kimme1024, I think I got it working properly now. Here is what I did:

  1. I used a quirk which exposes the device as a plug/switch instead of as a light. I used the quirk from hallenmaia from the github page which you also quoted earlier: https://github.com/zigpy/zha-device-handlers/issues/1260.
  2. I deactivated my automation to reset the state of the on/off entity. Not sure though if that was really necessary, but I felt I didn’t really need it anymore after going with a switch.

Fyi, what I learned after some debugging before making the above changes is the following:

  • The random/automatic trigger of the relay is not initiated when I use my normal garage remote control (bypassing the relay), rather always some time after I triggered the relay via home assistant.
  • In the logs I found the following entries which got me thinking that it might be a problem with the device being exposed a light and maybe something in my home assistant set-up/configuration related to lights (since I think other people don’t have problems with it being a light):

2023-10-04 20:49:47.061 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: polling current state
2023-10-04 20:49:47.068 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: setting transitioning flag to True
2023-10-04 20:49:47.074 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: received onoff False while transitioning - skipping update
2023-10-04 20:49:47.074 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: starting transitioning timer for 1.25
2023-10-04 20:49:47.074 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: turned off: Default_Response(command_id=0, status=<Status.SUCCESS: 0>)