zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
736 stars 674 forks source link

[Device Support Request] Avatto 1/2-ch dimmer. TS0601 _TZE204_o9gyszw2/_TZE204_5cuocqty #3141

Open gruzzy opened 5 months ago

gruzzy commented 5 months ago

Problem description

I bought a couple of devices from AliEexpress (https://www.aliexpress.com/item/1005006524716136.html)

Devices were added to Home Assistance server without issues, but didn't expose any controls. After reading documentation, I have madew a custom quirk and devices are working fine now.

Solution description

ZHA logs suggest to contribute changes into the main branch.

Screenshots/Video

Screenshots/Video [Paste/upload your media here] ![image](https://github.com/zigpy/zha-device-handlers/assets/33974769/60bafa03-ff41-44a0-b27f-af8a61966c24) ![image](https://github.com/zigpy/zha-device-handlers/assets/33974769/e1449df7-13ed-4e6a-8b14-9482d6686804)

Device signature

Device signature ```json [Paste the device signature here] ```

Diagnostic information

Diagnostic information ```json [Paste the diagnostic information here] ```

Logs

Logs ```python [Paste the logs here] ```

Custom quirk

Custom quirk1 class TuyaSingleSwitchDimmerGP(TuyaDimmerSwitch): """Tuya touch switch device.""" signature = { MODELS_INFO: [ ("_TZE200_3p5ydos3", "TS0601"), ("_TZE200_ip2akl4w", "TS0601"), ("_TZE200_vucankjx", "TS0601"), # Loratap ("_TZE200_y8yjulon", "TS0601"), ("_TZE204_n9ctkb6j", "TS0601"), # For BSEED switch ("_TZE204_5cuocqty", "TS0601"), #Avattto ZDMS16-1 ],
Custom quirk2 class TuyaDoubleSwitchDimmerGP(TuyaDimmerSwitch): """Tuya double channel dimmer device.""" signature = { MODELS_INFO: [ ("_TZE200_fjjbhx9d", "TS0601"), ("_TZE200_gwkapsoq", "TS0601"), # Loratap ("_TZE204_zenj4lxv", "TS0601"), ("_TZE204_o9gyszw2", "TS0601"), #Avattto ZDMS16-2 ],

Additional information

No response

NH-Networks commented 4 months ago

@gruzzy are custom quirks complete?

seem to miss information? can you send me files or give full code ?

gruzzy commented 4 months ago

Sorry, I am not good in creating proper tickets yet :)

I found that extending the MODELS_INFO lists in tthe class signatures made devices working in HA.

One switch works as a TuyaSingleSwitchDimmerGP devices, another one is running as TuyaDoubleSwitchDimmerGP.

So, there are the only changes in the file zhaquirks/tuya/ts0601_dimmer.py:

class TuyaSingleSwitchDimmerGP(TuyaDimmerSwitch): """Tuya touch switch device.""" signature = { MODELS_INFO: [ ("_TZE200_3p5ydos3", "TS0601"), ("_TZE200_ip2akl4w", "TS0601"), ("_TZE200_vucankjx", "TS0601"), # Loratap ("_TZE200_y8yjulon", "TS0601"), ("_TZE204_n9ctkb6j", "TS0601"), # For BSEED switch ("_TZE204_5cuocqty", "TS0601"), #Avattto ZDMS16-1 ],

class TuyaDoubleSwitchDimmerGP(TuyaDimmerSwitch): """Tuya double channel dimmer device.""" signature = { MODELS_INFO: [ ("_TZE200_fjjbhx9d", "TS0601"), ("_TZE200_gwkapsoq", "TS0601"), # Loratap ("_TZE204_zenj4lxv", "TS0601"), ("_TZE204_o9gyszw2", "TS0601"), #Avattto ZDMS16-2 ],

NH-Networks commented 4 months ago

Yeah i figured it out, my bad.. will created a pull request for change, as no one is assigned to this yet.

NH-Networks commented 4 months ago

Pull request created. lets see if it will be picked up.

vrtsman commented 3 months ago

does not work for me. How can I see the quirk is in place? I can see it in the studio code server environment and edit the py, but does it get loaded correctly?