-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Device Support Request] TS0601 GDC311ZBQ1 Tuya Loratap Garage Switcher #1260
Comments
I have one of these as well, happy to help anyone who is able to help integrate it in to zha, I’m not a developer but happy to help in any way I can! |
Hi! We are together in pain... |
Device operation traces are needed to see if it is possible to implement a quirk. If any of you can include the information, I'll see what can be done. Regards. |
As this is a garage door opener, it doesn't send any messages until a command to open the door is received - it primarily receives messages. How can we capture traces if we can't send it messages?
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: javicalle ***@***.***>
Sent: Friday, January 21, 2022 9:29:04 PM
To: zigpy/zha-device-handlers ***@***.***>
Cc: EagleAdam ***@***.***>; Comment ***@***.***>
Subject: Re: [zigpy/zha-device-handlers] [Device Support Request] TS0601 GDC311ZBQ1 Tuya Loratap Garage Switcher (Issue #1260)
Device operation traces are needed to see if it is possible to implement a quirk.
Each trace must be able to be identified with the action, eg: open, close, stop, etc.
If any of you can include the information, I'll see what can be done.
Regards.
—
Reply to this email directly, view it on GitHub<#1260 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKTGLWAZPYRKDBMAIDTC5ILUXG6ZBANCNFSM5LNIU7LQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Its have 3 function and i think its sending all of them the repower the device. |
In the herdsman-converter seems that the door status is not reported. |
Its not so easy saying than the device is working like one switch (its parallel with the normal installed) and can only detecting the door is closed or not closed. |
In case someone wants to try it, it seems that it has already been included as an on/off switch: |
There is a similar device: _TZE200_nklqjk62 "MOES Garage opener" ( supported by zigbee2mqtt) Have anyone tried the changed pointed by @javicalle ? Update: I tried changing that file locally adding my device id '_TZE200_nklqjk62' but it does not work. |
Without logs from device operation, nothing can be done. Enable logs and attach the relevant information: zigpy: debug
zigpy.zcl: debug
custom_zha_quirks: debug
zhaquirks.tuya: debug
homeassistant.components.zha: debug |
Zigbee device signature might be useful: {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0051",
"in_clusters": [
"0x0000",
"0x0004",
"0x0005",
"0xef00"
],
"out_clusters": [
"0x000a",
"0x0019"
]
},
"242": {
"profile_id": 41440,
"device_type": "0x0061",
"in_clusters": [],
"out_clusters": [
"0x0021"
]
}
},
"manufacturer": "_TZE200_nklqjk62",
"model": "TS0601",
"class": "zigpy.device.Device"
} |
@juanjoSanz Your device is having one GPP end point so you need making one new device class and adding the GPP endpoint and your device IDs. |
Thanks for the advice, I have been trying to define my own class: With my class the switch control is exposed, I have to figure out how to get the door sensor too. |
Hi! |
It was interviewed and recognized (unsupported), but doesn't exposes none of it's entities... Smart Home ZigBee Garage Door Opener (GDC311ZBQ1) Zigbee2MQTT:debug 2022-02-14 23:43:07: Received Zigbee message from 'Garage door', type 'attributeReport', cluster 'genBasic', data '{"65506":48,"65508":0,"appVersion":68}' from endpoint 1 with groupID 0 Tks... |
@juanjoSanz can you taking the power off and putting it back so the device is restarting ? |
I think that the appropriate thing would be to create a new file for cover type entities (maybe This device is supposed to have 3 DP (garage trigger, door contact and door status): 'Door status' seems to be not reliable, but maybe can get some information from logs. |
If that helps, here are additional logs.
[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_rsp: [<Status.SUCCESS: 0>]
[0x0000:zdo] No handler for ZDO request:ZDOCmd.Mgmt_Permit_Joining_rsp([<Status.SUCCESS: 0>])
[0x5a61:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_rsp: [<Status.SUCCESS: 0>]
[0x5a61:zdo] No handler for ZDO request:ZDOCmd.Mgmt_Permit_Joining_rsp([<Status.SUCCESS: 0>])
New device 0xff96 (a4:c1:38:3b:09:ba:bb:13) joined the network
[0xff96] Scheduling initialization
Received frame on uninitialized device <Device model=None manuf=None nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=False> from ep 0 to ep 0, cluster 19: b'\x00\x96\xff\x13\xbb\xba\t;8\xc1\xa4\x8e'
[0xff96:zdo] ZDO request ZDOCmd.Device_annce: [0xFF96, a4:c1:38:3b:09:ba:bb:13, 142]
Tries remaining: 3
[0xff96] Requesting 'Node Descriptor'
Tries remaining: 2
[0xff96] Extending timeout for 0x1b request
Received frame on uninitialized device <Device model=None manuf=None nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=False> from ep 0 to ep 0, cluster 32770: b'\x1b\x00\x96\xff\x01@\x8eA\x11BB\x00\x00*B\x00\x00'
[0xff96] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)
[0xff96] Discovering endpoints
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=False> from ep 0 to ep 0, cluster 32773: b'\x1c\x00\x96\xff\x02\x01\xf2'
[0xff96] Discovered endpoints: [1, 242]
[0xff96] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>, <Endpoint id=242 in=[] out=[] status=<Status.NEW: 0>>]
[0xff96:1] Discovering endpoint information
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=False> from ep 0 to ep 0, cluster 32772: b'\x1d\x00\x96\xff\x14\x01\x04\x01Q\x00\x01\x04\x04\x00\x05\x00\x00\xef\x00\x00\x02\x19\x00\n\x00'
[0xff96:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=81, device_version=1, input_clusters=[4, 5, 61184, 0], output_clusters=[25, 10])
Unknown cluster 61184
[0xff96:242] Discovering endpoint information
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=False> from ep 0 to ep 0, cluster 32772: b'\x1e\x00\x96\xff\n\xf2\xe0\xa1a\x00\x00\x00\x01!\x00'
[0xff96:242] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=242, profile=41440, device_type=97, device_version=0, input_clusters=[], output_clusters=[33])
[0xff96:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=31 command_id=Command.Read_Attributes_rsp>
[0xff96] Read model 'TS0601' and manufacturer '_TZE200_nklqjk62' from <Endpoint id=1 in=[groups:0x0004, scenes:0x0005, None:0xEF00, basic:0x0000] out=[ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>>
[0xff96] Discovered basic device information for <Device model='TS0601' manuf='_TZE200_nklqjk62' nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=True>
Device is initialized <Device model='TS0601' manuf='_TZE200_nklqjk62' nwk=0xFF96 ieee=a4:c1:38:3b:09:ba:bb:13 is_initialized=True>
Checking quirks for _TZE200_nklqjk62 TS0601 (a4:c1:38:3b:09:ba:bb:13)
Considering <class 'zhaquirks.tuya.ts0601_switch_door.TuyaGarageSwitchTO'>
Found custom device replacement for a4:c1:38:3b:09:ba:bb:13: <class 'zhaquirks.tuya.ts0601_switch_door.TuyaGarageSwitchTO'>
'sensor' component -> 'RSSISensor' using ['basic']
'sensor' component -> 'LQISensor' using ['basic']
device - 0xFF96:a4:c1:38:3b:09:ba:bb:13 entering async_device_initialized - is_new_join: True
device - 0xFF96:a4:c1:38:3b:09:ba:bb:13 has joined the ZHA zigbee network
[0xFF96](TS0601): started configuration
[0xFF96:ZDO](TS0601): 'async_configure' stage succeeded
[0xFF96:1:0x0000]: finished channel configuration
[0xFF96:1:0x0019]: finished channel configuration
Error handling '_save_attribute' event with (a4:c1:38:3b:09:ba:bb:13, 1, 0, 4, '_TZE200_nklqjk62') params: FOREIGN KEY constraint failed
Error handling '_save_attribute' event with (a4:c1:38:3b:09:ba:bb:13, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed
[0xFF96:1:0x0006]: bound 'on_off' cluster: Status.INVALID_EP
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=63 command_id=17>
[0xff96:1:0xef00] ZCL request 0x0011: [MCUVersionRsp(tsn=1280, version=64)]
[0xFF96:1:0x0006]: failed to set reporting on 'on_off' cluster for:
[0xFF96:1:0x0006]: finished channel configuration
[0xFF96:1:0x0006]: 'async_configure' stage succeeded
[0xFF96:1:0x0000]: 'async_configure' stage succeeded
[0xFF96:1:0x0019]: 'async_configure' stage succeeded
[0xFF96](TS0601): completed configuration
[0xFF96](TS0601): stored in registry: ZhaDeviceEntry(name='_TZE200_nklqjk62 TS0601', ieee='a4:c1:38:3b:09:ba:bb:13', last_seen=1645027548.3382998)
[0xFF96](TS0601): started initialization
[0xFF96:ZDO](TS0601): 'async_initialize' stage succeeded
[0xFF96:1:0x0006]: initializing channel: from_cache: False
[0xFF96:1:0x0000]: initializing channel: from_cache: False
[0xFF96:1:0x0000]: finished channel initialization
[0xFF96:1:0x0019]: initializing channel: from_cache: False
[0xFF96:1:0x0019]: finished channel initialization
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=63 command_id=17>
[0xff96:1:0xef00] ZCL request 0x0011: [MCUVersionRsp(tsn=1280, version=64)]
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=64 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=90, command_id=1036, function=0, data=[1, 2])]
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=65 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=91, command_id=516, function=0, data=[4, 0, 0, 0, 10])]
[0xF34C](TRADFRI bulb E27 W opal 1000lm): Attempting to checkin with device - missed checkins: 1
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=66 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=92, command_id=514, function=0, data=[4, 0, 0, 0, 0])]
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=67 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=93, command_id=517, function=0, data=[4, 0, 0, 14, 16])]
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=68 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=94, command_id=267, function=0, data=[1, 0])]
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=69 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=95, command_id=259, function=0, data=[1, 1])]
[0xff96:1:0x000a] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=70 command_id=Command.Read_Attributes>
[0xff96:1:0x000a] ZCL request 0x0000: [[7]]
[0xE6B9](TS0601): Attempting to checkin with device - missed checkins: 1
[0xFF96:1:0x0006]: failed to get attributes '['on_off']' on 'on_off' cluster:
[0xFF96:1:0x0006]: async_initialize: retryable request #1 failed: . Retrying in 1.1s
[0xFF96:1:0x0006]: initializing channel: from_cache: False
[0x5A61:1:0x0b04]: async_update
[0x3904:1:0x0b04]: async_update
[0xff96:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=71 command_id=Command.Report_Attributes>
[0xff96:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=70>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=54>), Attribute(attrid=65508, value=<TypeValue type=uint8_t, value=1>)]]
[0xff96:1:0x0000] Attribute report received: app_version=70, 65506=54, 65508=1
[0xff96:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=71 command_id=Command.Report_Attributes>
[0xff96:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=70>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=54>), Attribute(attrid=65508, value=<TypeValue type=uint8_t, value=1>)]]
[0xff96:1:0x0000] Attribute report received: app_version=70, 65506=54, 65508=1
Duplicate 71 TSN
[0xFF96:1:0x0006]: failed to get attributes '['on_off']' on 'on_off' cluster:
[0xFF96:1:0x0006]: async_initialize: retryable request #2 failed: . Retrying in 0.8s
[0xFF96:1:0x0006]: initializing channel: from_cache: False
[0xff96:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=72 command_id=2>
[0xff96:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=97, command_id=259, function=0, data=[1, 1])]
|
Good morning all, |
So I saw that Zigbee2MQTT now seems to support this device. What's needed to get ZHA to support it? |
Same problem here. The device is recognized with ZHA but no entities are available. Would be very happy if there is any solution for it. 😄 |
Yeap, I saw this too, and works great, I tested it in a dev network with zigbee2mqtt and HA via mqtt. But, my real network is under ZHA integration and I'm not want this much to recreate the entire network with zb2mqtt. I tried create a qirk, but it didn't work at all. For example, in debug of ZHA I found that the door sensor sends some commands, some bytes changes and I presume that is because it means the timestamp of the command or something like that. For the closing action the last 4 bytes are always the same, for the opening action the last 5 are the same. And always the secondish byte changes. I don't know how to help, I tried to modify the @juanjoSanz file. But didn't worked very well, I had a on_off button, but it only toggles when I press the device button and when I try to switch the button on HA, I get an error saying something command error/unknown `Closing Test #1 Test #2 Test #3 Opening Test #1 Test #2 Test #3 ` |
Hi, there is my proposal for ts0601_garage.py"""Tuya based cover and blinds."""
from typing import Dict
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.security import IasZone
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import TuyaLocalCluster
from zhaquirks.tuya.mcu import (
DPToAttributeMapping,
TuyaDPType,
TuyaMCUCluster,
TuyaOnOff,
TuyaOnOffNM,
)
ZONE_TYPE = 0x0001
class ContactSwitchCluster(TuyaLocalCluster, IasZone):
"""Tuya ContactSwitch Sensor."""
_CONSTANT_ATTRIBUTES = {ZONE_TYPE: IasZone.ZoneType.Contact_Switch}
def _update_attribute(self, attrid, value):
self.debug("_update_attribute '%s': %s", attrid, value)
super()._update_attribute(attrid, value)
class TuyaGarageManufCluster(TuyaMCUCluster):
"""Tuya garage door opener."""
attributes = TuyaMCUCluster.attributes.copy()
attributes.update(
{
# ramdom attribute IDs
0xEF02: ("dp_2", t.uint32_t, True),
0xEF04: ("dp_4", t.uint32_t, True),
0xEF05: ("dp_5", t.uint32_t, True),
0xEF0B: ("dp_11", t.Bool, True),
0xEF0C: ("dp_12", t.enum8, True),
}
)
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
# garage door trigger ¿on movement, on open, on closed?
1: DPToAttributeMapping(
TuyaOnOffNM.ep_attribute,
"on_off",
dp_type=TuyaDPType.BOOL,
),
2: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_2",
dp_type=TuyaDPType.VALUE,
),
3: DPToAttributeMapping(
ContactSwitchCluster.ep_attribute,
"zone_status",
dp_type=TuyaDPType.BOOL,
converter=lambda x: IasZone.ZoneStatus.Alarm_1 if x else 0,
),
4: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_4",
dp_type=TuyaDPType.VALUE,
),
5: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_5",
dp_type=TuyaDPType.VALUE,
),
11: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_11",
dp_type=TuyaDPType.BOOL,
),
# garage door status (open, closed, ...)
12: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_12",
dp_type=TuyaDPType.ENUM,
),
}
data_point_handlers = {
1: "_dp_2_attr_update",
2: "_dp_2_attr_update",
3: "_dp_2_attr_update",
4: "_dp_2_attr_update",
5: "_dp_2_attr_update",
11: "_dp_2_attr_update",
12: "_dp_2_attr_update",
}
class TuyaGarageSwitchTO(CustomDevice):
"""Tuya Garage switch."""
signature = {
MODELS_INFO: [
("_TZE200_nklqjk62", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0051
# input_clusters=[0, 4, 5, 61184]
# output_clusters=[10, 25]>
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaGarageManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
# input_clusters=[]
# output_clusters=[33]
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaGarageManufCluster,
TuyaOnOffNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
INPUT_CLUSTERS: [
ContactSwitchCluster
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 0xA1E0,
DEVICE_TYPE: 0x0061,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [0x0021],
},
},
} Implementation must give a switch for open/close (already implemented and working)
For anyone who wants to test on another device, add your signature to the MODELS_INFO: [
("_TZE200_nklqjk62", "TS0601"),
], |
Probably a I have a question? This door can be stopped alfway? If yes, how is it? It seems that only accepts open and close buttons (no stop button). |
In reality, physically the device it only has a "Action button" momentary switch, that activate a relay for 2 seconds then turn it off. And also a wireless contact switch for door status detection. (Closed or not closed, but with no way to determine the position) The garage door itself, start a movement if it isn't moving ou stops if it's moving. If you press it again, it inverts the direction, but I guess it will change from depending on the garage motor vendor. Looking at the zb2mqtt converter code, we can see this:
They don't use the dp 12 for statut as you can see above, they use the 3 (wireless contact switch). My device model is a little bit different than yours, but I'll give your code a shoot then I'll let you know the results. Thanks a lot. ! |
Hi @javicalle , unfortunately it didn't work, on the on_off dp_1, I have a "toggle" when I press the button, but when I toggle in HA, nothing is sent to the device, no relay click sound. I'll try to change some bits in your code to see if I can have the command sent to the device at least. |
So, from your comments (thanks for that) it would be more appropiate represent in HA as a button, isn't it? I am going to see how a button can be defined in Zigpy. Can you try with another iteration for the sensor? Just add the converter as: 3: DPToAttributeMapping(
ContactSwitchCluster.ep_attribute,
"zone_status",
dp_type=TuyaDPType.BOOL,
endpoint_id=2,
converter=lambda x: IasZone.ZoneStatus.Alarm_1 if x else 0,
), Can you also check if (with the EDIT: the DP converter is needed: #1502 (comment) |
Another random test that can be done is to replace the
from zhaquirks.tuya.mcu import (
DPToAttributeMapping,
TuyaDPType,
TuyaMCUCluster,
TuyaOnOff,
TuyaOnOffNM,
)
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaGarageManufCluster,
TuyaOnOffNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}, |
I'll try that @javicalle , I'll keep you informed. Thanks |
Found it :-) ... YES... Party on.... Many many Thanks :-) |
The switch i working.... |
Hi, Thank you! |
With the quirk above, the open/closed sensor works on the "_TZE200_nklqjk62" model. I have no way to confirm this in the "_TZE200_wfxuhoea" model. In some comment above it was said that maybe this model is a little different 😔. |
@hallenmaia Indeed I have the model "_TZE200_wfxuhoea" and couldn´t make the open/close sensor work :( I opened the door several times, but won´t be recognized by the sensor. |
"""Tuya based cover and blinds."""
from typing import Dict
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.security import IasZone
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import NoManufacturerCluster, TuyaLocalCluster
from zhaquirks.tuya.mcu import (
DPToAttributeMapping,
TuyaMCUCluster,
TuyaOnOff,
)
from zhaquirks.tuya.ts0601_dimmer import TuyaOnOffNM
ZONE_TYPE = 0x0001
class ContactSwitchCluster(TuyaLocalCluster, IasZone):
"""Tuya ContactSwitch Sensor."""
_CONSTANT_ATTRIBUTES = {ZONE_TYPE: IasZone.ZoneType.Contact_Switch}
def _update_attribute(self, attrid, value):
self.debug("_update_attribute '%s': %s", attrid, value)
super()._update_attribute(attrid, value)
class TuyaGarageManufCluster(NoManufacturerCluster, TuyaMCUCluster):
"""Tuya garage door opener."""
attributes = TuyaMCUCluster.attributes.copy()
attributes.update(
{
# ramdom attribute IDs
0xEF02: ("dp_2", t.uint32_t, True),
0xEF04: ("dp_4", t.uint32_t, True),
0xEF05: ("dp_5", t.uint32_t, True),
0xEF0B: ("dp_11", t.Bool, True),
0xEF0C: ("dp_12", t.enum8, True),
}
)
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
# garage door trigger ¿on movement, on open, on closed?
1: DPToAttributeMapping(
TuyaOnOffNM.ep_attribute,
"on_off",
),
2: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_2",
),
3: DPToAttributeMapping(
ContactSwitchCluster.ep_attribute,
"zone_status",
lambda x: IasZone.ZoneStatus.Alarm_1 if x else 0,
endpoint_id=2,
),
4: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_4",
),
5: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_5",
),
11: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_11",
),
# garage door status (open, closed, ...)
12: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"dp_12",
),
}
data_point_handlers = {
1: "_dp_2_attr_update",
2: "_dp_2_attr_update",
3: "_dp_2_attr_update",
4: "_dp_2_attr_update",
5: "_dp_2_attr_update",
11: "_dp_2_attr_update",
12: "_dp_2_attr_update",
}
class TuyaGarageSwitchTO(CustomDevice):
"""Tuya Garage switch."""
signature = {
MODELS_INFO: [
("_TZE200_nklqjk62", "TS0601"),
("_TZE200_wfxuhoea", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0051
# input_clusters=[0, 4, 5, 61184]
# output_clusters=[10, 25]>
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaGarageManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
# input_clusters=[]
# output_clusters=[33]
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaGarageManufCluster,
TuyaOnOffNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
INPUT_CLUSTERS: [
ContactSwitchCluster
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
} |
Directly from the vendor. ;) TS0601.GDC311ZBQ1.Tuya.Loratap.Garage.Switcher.mp4 |
@bsfaxi Thank you for the video, tried to pair the open/close sensor to the main unit according to the video, but unfortunately it doesn´t work. I just recognized that there is also a dip-switch in the sensor. It is set to pos. 2. However, I´ve already installed another zigbee open/close sensor month ago and since today I can open and close the garage, this made already my day. ;) Thank you for your effort! |
Many thanks to all .... :-) |
But is that really to pair the sensor to the relay? I thought that the sensor and the relay / main unit are pre-paired from the vendor and that this button is just to pair the relay / main unit to the bridge (or Zigbee USB dongle). Fyi, I can also confirm that the sensor works for my "_TZE200_wfxuhoea" model. |
I have only followed the instructions in the video. |
But I also have another question. |
I have the following cover template: # Cover template for Garage
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Porte du garage"
value_template: >-
{% if is_state('binary_sensor.porte_du_garage_opening','off') %}closed
{% else %}open
{% endif %}
open_cover:
- condition: state
entity_id: binary_sensor.porte_du_garage_opening
state: "off"
- service: light.turn_on
target:
entity_id: light.porte_du_garage_light
close_cover:
- condition: state
entity_id: binary_sensor.porte_du_garage_opening
state: "on"
- service: light.turn_off
target:
entity_id: light.porte_du_garage_light
# stop_cover:
# service: light.turn_on
# target:
# entity_id: light.porte_du_garage_light
icon_template: >-
{% if states('binary_sensor.porte_du_garage_opening') == "on" %}
mdi:garage-open-variant
{% else %}
mdi:garage-variant
{% endif %}
And the following automation to reset the switch after each execution: - id: 'xxxxxxxxxx'
alias: Covers - Porte du garage switch reset
description: Remise à inactif du bouton
trigger:
- platform: state
entity_id:
- light.porte_du_garage_light
to: 'on'
for:
hours: 0
minutes: 0
seconds: 2
condition: []
action:
- service: light.turn_off
data: {}
target:
entity_id: light.porte_du_garage_light |
Bonjour je n'arrive pas : j'ai cette erreur = qui peut m'aider ? Merci |
Somehow I'm observing strange behaviors for my _TZE200_wfxuhoea" model. I guess I need to look into the logs, increase the log level and try to trouble shoot this from my end once I find some time, but wanted to know who else observed these and under which conditions. First, I now also see status problems with the sensor. When I open my garage with the standard garage switch, the status from the sensor seems to work fine. But when I trigger the Loratap relay from Home Assistant that status sensor often seems to be getting out of sync. It's not a big problem, in worst case I could fix this by installing another zigbee door sensor from another vendor like @philo686 did. Secondly, I observed a really worrying behavior. Something seems to trigger the opening (maybe also closing, not sure yet) of the garage from time to time, leaving me with an open garage when I didn't trigger it through home assistant (at least not knowingly). I thought I had seen at least one user reporting such a behavior either in this or another forum, unfortunately I couldn't find that anymore when searching. So if anyone ever observed this, please let me know. Otherwise I'll probably start looking into logs in more detail. In the logbook I could only see "Relay Garage Light turned on" so far. |
I somehow had a problem with the quirks which expose the device as a light, either since of some light set-up / configuration at my end or since of my automation to reset the status of the light on/off control or some other reason. Whenever I triggered the relay from within home assistant, somehow it got triggered once more at a later point (like 30 to 120 minutes later) leaving me with an open garage even though I had closed it earlier. After changing to the quirk from @hallenmaia which exposes the relay as a plug / switch (and disabling my switch reset automation) I don't have this problem anymore. Am wondering whether anybody could see from the following logs what could have triggered that unintentional triggering of the relay. I couldn't figure it out unfortunately. 2023-10-04 20:49:47.061 DEBUG (MainThread) [homeassistant.components.zha.entity] light.relay_garage: polling current state |
@balu79 Do you have any integration that controls the brightness or colors of the lamps? ( Maybe they might be interfering. |
Yeah, I was wondering the exact same. I don't have Adaptive Lighting, Circadian Lighting, I though have a light_profiles.csv configuration for setting a default level but in that config I have only defined other lights. Other than that I have the following light group defined in my configuration.yaml file:
|
Figured it out for anyone playing along at home :) If you use HassIO the folder goes in the 'config' folder which is of course the 'root' when you use the 'File Editor' inside the instance i.e. create the 'zhaquirks' folder in the same folder you find your configuration YAML.... hi everyone, I'm losing the plot trying to get this to work :( I cant think of what else to try? I can attach the device, but couldn't see the button to control the door opener - so I found this thread, added the config comment, then added the folder and inside created a new file using the inbuilt file editor, and pasted in the code then i edited the section towards the end with the TZE204 but still no joy :( but despite deleting it and re-adding, and rebooting the HA instance multiple times - it never presents the button what am I missing?! :) device is listed as TS0601
|
This quirk is working with my device: TS0601
|
Hello friends, If you're using the _TZE204_nklqjk62 model then use the following for your 'ts0601_garage.py' file:
|
Works for me. |
I tried everything I saw on the forums, but none of it worked. I can get the Switch control and the Sensor, but they don't work. The logs say that the garage door opens and closes, but nothing happens. My device is _TZE200_wfxuhoea TS0601. After all this time, there should already have been a direct integration in ZHA. |
I own one of this device to control the opening of my front gate. It is reported as _TZE204_nklqjk62 in HA. After the first connection, the device had no entities/controls so I installed the quirk provided in this comment (#1260 (comment)). After enabling the quirk, I was able to open and close the gate without problem for weeks until it failed. After checking the log file, I saw a lot of _ Exception running handler_ errors in bellows/ezsp/init.py:
The error seems to occur at a scheduled frequency, each hour:
and sometimes even every 10 seconds:
If I shutdown the device, the error flow stops. Does anyone with this quirk saw the same behaviour and has an idea to fix this? FYI, I'm on the 2024.9.2 version. |
Device signature:
Tuya device that has no entities/controls in home assistant and its a simple Zigbee Tuya garage switcher. It has a sensor if the garage is opened or not, but it should be very similar to many other devices like this.
Thanks in advance for the support.
The text was updated successfully, but these errors were encountered: