-
Notifications
You must be signed in to change notification settings - Fork 748
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] Moes dimmer switches _TZE200_ip2akl4w & _TZE200_fjjbhx9d #1302
Comments
It seems that is like others Tuya dimmers but with the green power endpoint. For future reference do you have a link to the product to help visually identify it? |
This is the product: https://nl.aliexpress.com/item/1005003619398730.html?gatewayAdapt=glo2nld&spm=a2g0o.9042311.0.0.130d4c4dGYyEsh |
Depending on the environment there are different ways to do it.
It is not too difficult, but it does require touching the insides of the installation and it is preferable to do it if you feel comfortable with those kind of modifications. |
Thanks, but the device does not show entities and no errors in the logs. I only see this in the logs, I don't think it was there before.
I put the script in zha:
custom_quirks_path: /config/custom_zha_quirks/` |
Ok, let's try it. You need to copy 2 file to the
Then you need to modify the
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, LevelControl, Ota, Scenes, Time
from custom_zha_quirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
)
class TuyaSingleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
MODELS_INFO: [
("_TZE200_3p5ydos3", "TS0601"),
("_TZE200_ip2akl4w", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
# input_clusters=[]
# output_clusters=[33]
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,
TuyaLevelControlManufCluster,
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
class TuyaDoubleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
MODELS_INFO: [
("_TZE200_fjjbhx9d", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
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,
TuyaLevelControlManufCluster,
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
} Also, you can enable debug logs for
Delete the |
It seems that device also have the |
And probably also support |
I followed all steps but nothing is coming up, no logs and no entities. I tried to remove the zigbee device and add it again, but with no success.. |
Do not have any logs when operate the device? Maybe you need to enable the zigpy logs. |
And the device signature? It is the quirk loaded? |
This is what I get in the logs:
And
|
How can I see if the quirk is loaded correctly? |
From Configuration --> Integrations --> ZHA Devices --> select your device --> Zigbee device signature It's the same info you put in the first comment. |
{
"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_fjjbhx9d",
"model": "TS0601",
"class": "zigpy.device.Device"
} I don't think it is loaded |
No, it is not. I believe that I have made a mess copying the files. Give me a second to review it. |
Then you hace to replace at from custom_zha_quirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
) I think the rest will be OK. (I have updated the |
I updated the files, without success. The quirk is not found in general.
|
Just to be sure, are in HA the files placed in |
No error logs in HA restart? no |
Yes that is correct |
No errors and no pycache |
No idea what could be going on... Maybe you can try to put all the files at root level from . import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
) The rest will be fine as is. |
Are you sure HA is restarting? Sometimes, if there is a validation and other error, the console doesn't tell you and it appears to have restarted, but it really hasn't. |
Okay now it loads but I get |
I thought that was happening as well, but I restarted the full VM. So that is not the problem |
Well, then put the from custom_zha_quirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
) (not too diferent from previous situation 😅 ) |
I have a Mercator Ikuu Light Dimmer (SSWD01) which identifies as a Tuya TS0601 Dimmer (_TZE200_swaamsoy). I've tried to follow along with the suggested quirk from this thread and add it to my system. Once added, I'm not seeing any usable HA controls. Can I ask what might be an obvious question - How do I tell if the quirk is being read and used (other than the device working properly)? I have the files in custom_zha_quirks and have referenced it in configuration.yaml.
|
@ToastySefac You can see it in the device signature class, it should say something like Which quirk/file did you use? Your dimmer is a little bit different than mine, so you have to modify the quirk a bit, if you want I can help you with it. |
I've tried the main one as well as those in this thread, but the one I'm using now is from: (#1302 (comment)) I can't work out why it's not loading the quirk. I'm getting
That would be great, thanks |
@ToastySefac That's weird, there isn't a problem with the files/config you use and the paths are also correct. |
@javicalle BTW is there still something that stands in the way of a PR or will make one soon? |
@ToastySefac This seems to be a pretty weird device. If you want to try, I think this class might work. A new class and the necessary imports have been added. ts0601_dimmer.py
The full class content """Tuya based touch switch."""
# ---------------------------------------------------------------------------
# _TZE200_vm1gyrso:
# Add new code block
# 2022-04-07
# ---------------------------------------------------------------------------
from typing import Optional, Union
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Identify, LevelControl, OnOff, Ota, Scenes, Time
from zigpy.zcl.clusters.lighting import Color
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaDimmerSwitch,
TuyaLevelControl,
TuyaManufacturerClusterOnOff,
TuyaManufacturerLevelControl,
TuyaManufCluster,
TuyaOnOff,
)
from custom_zha_quirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
)
class NoManufacturerCluster(CustomCluster):
"""Forces the NO manufacturer id in command."""
async def command(
self,
command_id: Union[foundation.GeneralCommand, int, t.uint8_t],
*args,
manufacturer: Optional[Union[int, t.uint16_t]] = None,
expect_reply: bool = True,
tsn: Optional[Union[int, t.uint8_t]] = None,
):
"""Override the default Cluster command."""
self.debug("Setting the NO manufacturer id in command: %s", command_id)
status = await super().command(
command_id,
*args,
manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID,
expect_reply=expect_reply,
tsn=tsn,
)
return foundation.GENERAL_COMMANDS[foundation.GeneralCommand.Default_Response].schema(command_id=command_id, status=status)
class TuyaOnOffNM(NoManufacturerCluster, TuyaOnOffMCU):
"""Tuya OnOff cluster with NoManufacturerID."""
pass
class TuyaInWallLevelControlNM(NoManufacturerCluster, TuyaInWallLevelControl):
"""Tuya Level cluster for inwall dimmable device with NoManufacturerID."""
pass
class TuyaSingleSwitchDimmer(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
# "node_descriptor": "<NodeDescriptor byte1=1, byte2=64, mac_capability_flags=142, manufacturer_code=4098,
# maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
# maximum_outgoing_transfer_size=82, descriptor_capability_field=0>",
# <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1 input_clusters=[0, 4, 5, 61184] output_clusters=[10, 25]>
MODELS_INFO: [
("_TZE200_dfxkcots", "TS0601"),
("_TZE200_whpb9yts", "TS0601"),
("_TZE200_ebwgzdqq", "TS0601"),
("_TZE200_9i9dt8is", "TS0601"),
("_TZE200_swaamsoy", "TS0601"),
("_TZE200_0nauxa0p", "TS0601"),
("_TZE200_la2c2uo9", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
LevelControl.cluster_id,
TuyaManufacturerClusterOnOff,
TuyaOnOff,
TuyaManufacturerLevelControl,
TuyaLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
}
}
class TuyaSingleSwitchDimmerPlus(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
# "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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82,
# 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)",
MODELS_INFO: [
("_TZE200_swaamsoy", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
Color.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaOnOffMCU,
TuyaInWallLevelControl,
Color.cluster_id,
TuyaLevelControlManufCluster,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
}
}
class TuyaDoubleSwitchDimmer(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
# "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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
# maximum_outgoing_transfer_size=82, 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" ] }
# },
# "manufacturer": "_TZE200_e3oitdyu",
# "model": "TS0601",
# "class": "zigpy.device.Device"
# }
MODELS_INFO: [
("_TZE200_e3oitdyu", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaLevelControlManufCluster,
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [],
},
}
}
class TuyaSingleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
MODELS_INFO: [
("_TZE200_3p5ydos3", "TS0601"),
("_TZE200_ip2akl4w", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
# input_clusters=[]
# output_clusters=[33]
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,
TuyaLevelControlManufCluster,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
}
class TuyaDoubleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
MODELS_INFO: [
("_TZE200_fjjbhx9d", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
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,
TuyaLevelControlManufCluster,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
}
# ---------------------------------------------------------------------------
# _TZE200_vm1gyrso:
# Added this customer code block
# 2022-04-07
# ---------------------------------------------------------------------------
class TuyaTripleSwitchDimmerGPP(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
# "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_vm1gyrso",
# "model": "TS0601",
# "class": "zigpy.device.Device"
MODELS_INFO: [
("_TZE200_vm1gyrso", "TS0601"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
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,
TuyaLevelControlManufCluster,
#TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
# TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
3: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
#TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
} |
No, i'm working on it, but it's going to be hard to collect all the devices codes and quirks in this thread... 😅 |
@javicalle Yeah, makes sense 😄 if I can help with something just say so^^ |
@Tropaion I've restarted HA, as well as the entire VM.
@javicalle Thanks for looking into it. Here is the error log, but is that just indicative of it not loading the quirk at all?
|
@ToastySefac there was a few errors in the code. I have updated it in the comment. Please replace with the new version and test.
Not necessarily. That particular message can occur without it being an error in itself. |
I've used the new code with the following error:
After reloading, my device signature still looks like this:
|
@javicalle Since I have holidays the next few days, if it helps, I can collect the device signatures of the dimmers in the various issues and comments |
@Tropaion It would be really great if you could do that job. The class Ummm, I have review the code and have two or three little tricks dificult to caught. Let me take care to the generic classes to me if you don't mind. |
@ToastySefac Although it may look similar, it seems to be a different device. Thanks in advanced. |
Ok, no problem. I have the ticket already open, which led me here: Thanks |
@javicalle I will try, but probably will take until tomorrow. I will notify you for a final check before PR 😄
Would definitely be better 😄 |
@javicalle I now searched through all issues and made a summary: Devices from this Issue
Devices from other Issues
About this device I'm not sure which class to use, I need your help:
Device is already added to class Current ts0601_dimmer.py"""Tuya based touch switch."""
from typing import Optional, Union
from zigpy.profiles import zha
from zhaquirks import CustomCluster
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, LevelControl, Ota, Scenes, Time
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaDimmerSwitch,
TuyaLevelControl,
TuyaManufacturerClusterOnOff,
TuyaManufacturerLevelControl,
TuyaManufCluster,
TuyaOnOff,
)
from zhaquirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff as TuyaOnOffMCU,
)
class NoManufacturerCluster(CustomCluster):
"""Forces the NO manufacturer id in command."""
async def command(
self,
command_id: Union[foundation.GeneralCommand, int, t.uint8_t],
*args,
manufacturer: Optional[Union[int, t.uint16_t]] = None,
expect_reply: bool = True,
tsn: Optional[Union[int, t.uint8_t]] = None,
):
"""Override the default Cluster command."""
self.debug("Setting the NO manufacturer id in command: %s", command_id)
status = await super().command(
command_id,
*args,
manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID,
expect_reply=expect_reply,
tsn=tsn,
)
return foundation.GENERAL_COMMANDS[foundation.GeneralCommand.Default_Response].schema(command_id=command_id, status=status)
class TuyaOnOffNM(NoManufacturerCluster, TuyaOnOffMCU):
"""Tuya OnOff cluster with NoManufacturerID."""
pass
class TuyaInWallLevelControlNM(NoManufacturerCluster, TuyaInWallLevelControl):
"""Tuya Level cluster for inwall dimmable device with NoManufacturerID."""
pass
# --- DEVICE SUMMARY ---
# TuyaSingleSwitchDimmer: 0x00, 0x04, 0x05, 0xEF00; 0x000A, 0x0019
# TuyaDoubleSwitchDimmer: 0x00, 0x04, 0x05, 0xEF00; 0x000A, 0x0019
# - Dimmer with Green Power Proxy: Endpoint=242 profile=41440 device_type=0x0061, output_clusters: 0x0021 -
# TuyaSingleSwitchDimmerGP: 0x00, 0x04, 0x05, 0xEF00; 0x000A, 0x0019
# TuyaDoubleSwitchDimmerGP: 0x00, 0x04, 0x05, 0xEF00; 0x000A, 0x0019
# TuyaTripleSwitchDimmerGP: 0x00, 0x04, 0x05, 0xEF00; 0x000A, 0x0019
class TuyaSingleSwitchDimmer(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
MODELS_INFO: [
("_TZE200_dfxkcots", "TS0601"),
("_TZE200_whpb9yts", "TS0601"),
("_TZE200_ebwgzdqq", "TS0601"),
("_TZE200_9i9dt8is", "TS0601"),
("_TZE200_swaamsoy", "TS0601"),
("_TZE200_0nauxa0p", "TS0601"),
("_TZE200_la2c2uo9", "TS0601"),
("_TZE200_1agwnems", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0051
# device_version=1
# 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,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
LevelControl.cluster_id,
TuyaManufacturerClusterOnOff,
TuyaOnOff,
TuyaManufacturerLevelControl,
TuyaLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
}
}
class TuyaDoubleSwitchDimmer(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
MODELS_INFO: [
("_TZE200_e3oitdyu", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0051
# device_version=1
# 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,
TuyaManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaLevelControlManufCluster,
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
TuyaOnOffMCU,
TuyaInWallLevelControl,
],
OUTPUT_CLUSTERS: [],
},
}
}
class TuyaSingleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya touch switch device."""
signature = {
MODELS_INFO: [
("_TZE200_3p5ydos3", "TS0601"),
("_TZE200_ip2akl4w", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
# device_version=1
# 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,
TuyaManufCluster.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,
TuyaLevelControlManufCluster,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
}
class TuyaDoubleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
MODELS_INFO: [
("_TZE200_fjjbhx9d", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
# device_version=1
# 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,
TuyaManufCluster.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,
TuyaLevelControlManufCluster,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
}
class TuyaTripleSwitchDimmerGP(TuyaDimmerSwitch):
"""Tuya double channel dimmer device."""
signature = {
MODELS_INFO: [
("_TZE200_vm1gyrso", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0x0100
# device_version=1
# 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,
TuyaManufCluster.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,
TuyaLevelControlManufCluster,
#TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
# TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
3: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
#TuyaOnOffMCU,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
} |
@Tropaion explendit job!!! Some comments (to myself mostly):
I have created the PR #1489. In draft mode for now. |
We can have the MODELS_INFO duplicated because in this case endpoints/cluster must also match. |
@javicalle Looks good, now we shouldn't be far away from the goal.
I thought so, but the question is if both are needed. BTW did you remove/change the commends I made? Do you prefer to write the whole device signature? |
Definitely yes. The 'original' one was added months ago (PR #1010) and probably was needed.
No. I like and prefer your way to comment. I hope to release the final version today. |
May I ask some question which is not directly about this device but still fitsQuestion is: if you have finished your quirks and the device works which is true... How can users like me .. know when the local quick is not necessary anymore and remove it then afterwards?Am 13.04.2022 12:18 schrieb javicalle ***@***.***>:
I thought so, but the question is if both are needed.
Definitely yes. The 'original' one was added months ago (PR #1010) and probably was needed.
I have read other reports in which the device is repeated, perhaps because the manufacturer is careless or because they reuse the definitions of other devices.
We also have no way of knowing if all the definitions are being used and the risk of removing it is that something will be broken, so 🤷🏻♂️
BTW did you remove/change the commends I made? Do you prefer to write the whole device signature?
No. I like and prefer your way to comment.
Full signature sometimes don't match between diferent devices, but the 'translation' from cluster name to value is very usefull to me.
Also the DEVICE SUMMARY will give a fast view to the available definitions. Once again a good idea.
I hope to release the final version today.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sort answer: when HA includes the version of the |
If we are at questioning @javicalle 😄 I also have one. |
Meeeeeec, for Zigbee's specification questions I'm not your man. I just put the pieces together. (I haven't found any direct use for this cluster, but either didn't search the answer). |
I can confirm than my 1 gang (_TZE200_ip2akl4w) & 2 gang (_TZE200_fjjbhx9d) switches are working perfectly with the new changes on home assistant 2022.4.2 |
@Tropaion The Zigbee GPP is only one proxy server function for ZGPP devices (ZGP network frames) that use Zigbee Green power for sending commands. ZGP is not implanted in ZHA but some French devs have getting it working with Zigpy libs with some patches. Also the its one function that is autonomous in the device and the network mesh that we cant / dont need / shall not doing anything with it then its working (and is implanted) in the host system but i think in quirks we ska having it in the replace if its in the device signature so we can see that the device supporting it from ZHA GUI. |
This is a Tuya device that has no entities and/or controls in home assistant and its a simple Zigbee Tuya dimmer. It should be very similar to many other devices like this.
1 Gang _TZE200_ip2akl4w
2 Gang _TZE200_fjjbhx9d
Thanks in advance for the support.
The text was updated successfully, but these errors were encountered: