zha-device-handlers
zha-device-handlers copied to clipboard
[Device Support Request] Avatto 1/2-ch dimmer. TS0601 _TZE204_o9gyszw2/_TZE204_5cuocqty
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]
Device signature
Device signature
[Paste the device signature here]
Diagnostic information
Diagnostic information
[Paste the diagnostic information here]
Logs
Logs
[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
@gruzzy are custom quirks complete?
seem to miss information? can you send me files or give full code ?
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 ],
Yeah i figured it out, my bad.. will created a pull request for change, as no one is assigned to this yet.
Pull request created. lets see if it will be picked up.
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?
I see support for the on/off functionality is implemented in 3190. However, the Dataopoints in the Tuya manufacturing cluster are not added. Which does not enable changing the External Switch-Type as required by my application. An example implementation is present in Zigbee2MQTT tuya.ts. I want to extend this support to ZHA. I tried making a custom quirks but did not succeed. Using the zha_toolkit I now try to create the command manually, however I did not succeed yet. I retrieved information on which command and cluster to write to from 823
This is my action:
action: zha_toolkit.zcl_cmd
data:
ieee: a4:c1:38:dc:2b:c5:a5:61 # Replace with your device's IEEE address
endpoint_id: 1 # The endpoint ID of the device, usually 1 for most devices
cluster: 61184 # 0xEF00 in decimal
cmd: 4 # The command ID for Send DP
args:
- 57 # DP ID for External Switch-Type (check device specifics)
- 0 # Data type (0 for raw/unknown, may vary)
- 2 # Data value (set to 2 for Momentary)
What am I overlooking?
Is it possible to include: _TZE204_jtbgusdc TS0601
As it misses those components as well.
@coen1111 - I'm encountering the same issue, and also wanting to change the switch type. Did you make any progress with this?
Just incase anyone comes across this, I ended up temporarily pairing the device with zigbee2mqtt, which allowed me to change the switch type. this change persisted when i repaired with ZHA.