-
Notifications
You must be signed in to change notification settings - Fork 737
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] Tuya water timer (TS0049 by _TZ3000_gjpgagal) #3316
Comments
Look at issue #2377 |
If that was meant for me then I already tried the quirk and commented on the results here: #2377 (comment) |
#2377 is the thread for TS0049. Developers that work with this type of device are subscribed to that issue. As far as I am aware of, Tuya has only one specification for TS0049. Most user problems are related with binding the quirk to the device because different manufacturers have different signatures. |
OK. Perhaps I was doing something wrong. I changed the manufacturer as per my comment but the quirk does not get loaded. What is the best way to troubleshoot such cases? |
Do you have other custom quirks installed and working? I think the first step is ensure the system is actually loading the code. My recommendation is use a quirk for a ZigBee device you already have working like the TS0001 or TS0011 (wall plugs and light switches) and see if it loads properly. The custom quirk will appear in the device information page. Once the quirk are loading, then you can force the 0049 to bind to your specific device. |
I have Nous light switches that require quirk and some time back I installed it manually and it was correctly loaded. But for some time the quirk is included in HA and added automatically. So I removed the custom quirk. This is how swithes look like in HA: |
If you have a custom quirk it will be loaded instead of the built in. This is just to test the environment. If it loads, then it's just about fingerprinting your device properly. You can change the TS001x quirk (known to be working) to see if you manage to attach it to the water valve. The valve will obviously no work, but you will know the binding code. Regards |
The quirk should still be loading for the other devices. If it is not, you have a syntax problem with the code. If it loads but not binds yo the valve, you have a problem with the "signature". The signature must match your valve device in order for it to bind. The device name is only one parameter of the signature (see https://github.com/zigpy/zha-device-handlers). |
I changed almost all the parameters in the signature both in TS0049.py and ts001x.py but none of the quirks gets loaded (at least they do not appear under Zigbee info tab). This is the signature section of the modified TS0049 quirk:
This is how the device signature looks like in 'Manage Zigbee device' window:
|
If you use the text below in the signature it should bind:
|
I finally managed to load and attach a custom quirk. I used this quirk-generator Now the question is how to add the missing attributes like timer setting to the quirk? |
Great! Now you just need to get the replacements to work correctly. The timer will be set using the "Manage Zigbee Device" -> "Valve family cluster" -> irrigation_time. The On-Off switch will be exposed in the interface. |
Yes. It is probably not mapped correctly. |
What would be the procedure to get the right mappings? Do I need Tuya Zigbee gateway for that? |
The attribute mapping is the final step to get the valve working. There is no need to use a Tuya brand ZigBee router. This link has the attribute map specs for the valve: https://developer.tuya.com/en/docs/connect-subdevices-to-gateways/Zigbee-Water-valve-controller-access-standard?id=Kbahvojbqzvgl |
I understand that I can additionally map/read/control the following attributes: But I don't quite understand how that mapping is done via the quirk. Which lines variables need to be adjusted? |
The data points are numbers, in the original code: 26, 101, 110, 111...etc. Clusters are hexadecimal: 0xEF01, 0xEF02... First you must set the clusters, then the DP. |
I modified the following lines in the quirk:
But I get no values in the corresponding attributes: Value is none for all. |
What am I doing wrong? Perhaps cluster numbers are defined wrong? I am total newbie to quirks, don't know how these mappings work.
|
Is your valve supported by ZigBee 2MQTT? For the other model, we used the mapping information from this tool. Otherwise it is trial and error. |
I don't know. I found the following Github issues that might relate to my valve: Should I install Z2M in order to understand whether my specific device is supported?
|
I just got the Z2M source code. |
Good! Tell if anything is needed from me. As I mentioned before I have a spare Tuya Zigbee gateway - could do some additional troubleshooting if necessary.
|
Z2M has this device properly mapped. You need to translate it to ZHA. This is what we did with the other valve. Unfortunately I don't remember how exactly that worked. |
OK. Who might remember? |
Whoever committed this valve map to Z2M. |
I connected the valve to Tuya Zigbee gateway and retrieved DP IDs as described in the following document: https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html They were:
Basically they are the same as described in Tuya document: https://developer.tuya.com/en/docs/connect-subdevices-to-gateways/Zigbee-Water-valve-controller-access-standard?id=Kbahvojbqzvgl So the DPs are correct. The question is why the quirk does not map them correctly. What am I missing?! |
Here is the complete modified quirk:
I commented out attribute definitions that are there already out-of-box like on/off switch.
|
Problem description
Please can a handler be created to support a Tuya water timer (TS0049). The device can be added to home assistant via ZHA but not all entities (like timer which by default is set to 10 minutes) are available to control the valve.
Solution description
Creation of a new handler that supports the device
Screenshots/Video
Device signature
Device signature
Diagnostic information
Diagnostic information
Logs
Logs
Custom quirk
Custom quirk
Additional information
I have a Tuya Zigbee gateway at my disposal that could be used for further troubleshooting if necessary.
The text was updated successfully, but these errors were encountered: