-
Notifications
You must be signed in to change notification settings - Fork 646
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
Tuya Curtain Motor #744
Comments
Tuya has become just one huge PITA. Why they couldn't at least differentiate by device type? |
As long as a direct match always wins I wouldn’t say this kills it... |
That's true. Just means that we need to pick for which devices to use a wildcard match and for which ones to use model+manufacturer specific matches. I just hate they are that lazy to change at least the device id |
all these modules come from tuya with the same TS0601 model to the manufacturing shops. the manufactures hit up the tuya sdk site flip a couple things or follow steps from tuya to configure the module for the type of device, output a fw, and push it to the devices. they also add their code for the manufacturer possibly based on the PID or derived from it - you see this mentioned in the tuya docs and what the factory I communicated with kept mentioning. |
I just moved to ZHA from Deconz + Phoscon and I if I'm not mistaken implementing this one will solve the integration for every I'm just getting my feet wet with ZHA quirks and while I've been with Python for a while now, adding functionality etc...seems less intimidating in Zigbee2MQTT than in ZHA quirks. I guess it's just a matter of getting more familiar with Zigbee itself. Any pointers on where I would start to expose the relevant cluster attributes would be super appreciated. |
I have a curtain Zemismart ZM79E-DT (Tuya).
Protocol description: Koenkk/zigbee-herdsman-converters#1159 (comment) |
I have Moeshouse one from here: Paired to ZHA but doesn't show any entities or services.. Below signature: |
Zemismart here https://zigbee.blakadder.com/Zemismart_M515EGB.html { |
It seems like if someone make a quirk for one we can just copy them. They seem like the same product, just different manufacturer |
I've also got roller blinds motor AM43-0.45/40-ES-EB. Recognized by ZHA as Signature:
I've got some Python experience, but I'm new to the ecosystem. Will be ready to help if someone guides me from where to start. |
I am not an expert but managed to do some copy+paste magic and at least make the first step towards working quirk.. So ZHA recognises my quirk and assigns Up/Down/Stop buttons.. but commands are not in right order clicking Up works, but Stop and Down seems to be swapped.. Any advice highly appreciated.. below my code.. Add below code to the end of /usr/local/lib/python3.8/site-packages/zhaquirks/tuya/init.py
Then create a new file called /usr/local/lib/python3.8/site-packages/zhaquirks/tuya/blinds.py with code below:
|
I made a quirks which is working with my Zemismart ZM25TQ. It's here. If you look at the implementation in mqtt2zigbee there are quite few differences but it should be possible to support all the various devices listed here |
Thank you! I gave this a shot with my MOES based one after adjusting the signature to match it, it functions however the buttons are not triggering correctly. Down: motor turns counter clockwise I saw the mapping in init.py for the command but not picking up on how it's done. if you point me in the right direction I can hopefully add support for the moes as well. |
The quirks receives from HA:
The motor I tested wants:
To control properly I map: 1 -> 2 In your case I guess the right mapping should be TUYA_COVER_COMMAND = {0x0000: 0x0001, 0x0001: 0x0002, 0x0002: 0x0000} |
Could you add my model "manufacturer": "_TZE200_xuzcvlku","model": "TS0601" to your PR - From what I can see they are identical, and you can add several models to your quirk (same vendor) |
Excuse my ignorance, as I am no expert, but how do we make these changes work for everyone? Based on the observations from @tube0013 it seems as though each device might have slightly different control mapping. Reviewing the changes, it looks like the mapping is included in the
And then somehow reference that line in the manufacturer specific quirk file Again, sorry if this sounds dumb I'm just trying to wrap my head around this. |
I don't claim to have known what I was doing when I wrote this code ;) It's the first Tuya cover quirks. looking at zigbee2mqtt there are lots of variation. I did not think about how the code would scale for other devices. |
Done |
You got farther than I did! Thank you for getting us this far! Maybe someone with some more experience can chime in on what the typical procedure is for handling multiple devices with small differences? |
@blauret could you please add the below code to ts0601.py The In and out clusters are different on Moes. PS: I have tested it and it works..
|
Thanks @rednus, I have the same model and confirm that this works for me too. (Even the buttons are correct!) |
Added |
Thank you @blauret |
I used a quirk #801 for my Zemismart ZM79E-DT, adding "_TZE200_cowvfni3", but the correct operation of the buttons is provided with the following line: |
@blauret - is your device working with "SET COVER POSITION"??? For me full open and full close working.. but using slider to open to a set position does not. I am getting below error:
|
It won't work. the mapping ("TUYA_COVER_COMMAND") is used for all command ids. Command id 2 should get, I believe a 4 bytes data with the percentage in the lowest byte. the code should look something like that: @@ -608,12 +608,13 @@ class TuyaWindowCoverControl(LocalDataCluster, WindowCovering):
):
"""Override the default Cluster command."""
- if command_id in (0x0000, 0x0001, 0x0002):
- cmd_payload = TuyaManufCluster.Command()
- cmd_payload.status = 0
- cmd_payload.tsn = 0
- cmd_payload.command_id = TUYA_CMD_BASE + self.endpoint.endpoint_id
- cmd_payload.function = 0
+ cmd_payload = TuyaManufCluster.Command()
+ cmd_payload.status = 0
+ cmd_payload.tsn = 0
+ cmd_payload.command_id = TUYA_CMD_BASE + self.endpoint.endpoint_id
+ cmd_payload.function = 0
+
+ if command_id == 0x0001:
cmd_payload.data = [
1,
TUYA_COVER_COMMAND[command_id],
@@ -622,6 +623,16 @@ class TuyaWindowCoverControl(LocalDataCluster, WindowCovering):
return self.endpoint.tuya_manufacturer.command(
TUYA_SET_DATA, cmd_payload, expect_reply=True
)
+ elif command_id == 0x0002:
+ cmd_payload.data = [
+ 4,
+ 100 - position,
+ ] # remap the command to the Tuya command
+
+ return self.endpoint.tuya_manufacturer.command(
+ TUYA_SET_DATA, cmd_payload, expect_reply=True
+ )
+
return foundation.Status.UNSUP_CLUSTER_COMMAND To be honnest, I never used that so I'm not really looking at implementing. Also, I cannot test it at the moment. If you confirm you have something working and I can test, I'll add it to the PR |
@quadrupole1988 @Jrjy3 I have the same motor you have and opened a PR #1278 to add support for it. However, I also haven't got it to calibrate yet (top and bottom position). Did you manage to get it working using the remote? |
I decide to go ZigBee2MQTT so moved away from ZHA (for this and other reasons)......works perfect now
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Jochim ***@***.***>
Sent: Tuesday, January 11, 2022 9:48:13 PM
To: zigpy/zha-device-handlers ***@***.***>
Cc: rob1981forest ***@***.***>; Mention ***@***.***>
Subject: Re: [zigpy/zha-device-handlers] Tuya Curtain Motor (#744)
@quadrupole1988<https://github.com/quadrupole1988> I have the same motor you have and opened a PR #1278<#1278> to add support for it. However, I also haven't got it to calibrate yet (top and bottom position). Did you manage to get it working using the remote?
—
Reply to this email directly, view it on GitHub<#744 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALCGLUH6RKOXA36KYSPGAL3UVSQR3ANCNFSM4WP4W25Q>.
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 were mentioned.Message ID: ***@***.***>
|
Got error in custom quirks >
Solved this by adding GreenPowerProxy to import section My model is _TZE200_r0jdjrvi
I have HAOS in VM, there is no /usr/local/lib/python... SOLVED
Now buttons can be pressed without errors. But the motor won't work |
Hi, Yes, my motors work. I bought the remote from zemismart, but I mainly use it with homeassistant. I did have to use the remote to set the top and bottom positions (calibration) I'm using zigbee2mqtt. I can get it to open fully, stop or close fully. I cannot get the slider thing to work and open it a certain percentage. let me know if you need any help. |
@quadrupole1988 thanks for the info! I guess I will have to buy a remote too then. Do you get the battery % in Home Assistant from the motor using zigbee2mqtt? |
Still trying... I can see a curtains motor status in HA (inverted, but nvm at this moment), but still unable to control it Found debug log
Status.UNSUP_MANUF_CLUSTER_COMMAND sounds not good It was added to Zigbee2Mqtt here Koenkk/zigbee2mqtt#9895 |
Hi, guys, I'm new here. Have also no "Controls" after adding TS0601 by _TZE200_r0jdjrvi |
@Igorockkk |
@Kiread-work thanks for the answer! |
@Igorockkk I don't know |
No I don't. I've attached what I see in zigbee2mqtt. Unfortunately I also get these red box errors but it does what I need it to do. |
Any progress on these motors? I happened to get one of those.... |
@shohart nope. We need some kind of programmer here =) |
I have no idea why, but one of the most recent patches to HS broke this. It's just stopped working and nothing I do fixes it. Looks like I may be scrapping this thing and getting a SOMA or something that doesn't give me grief. |
Just received mine today and now realized it’s not supported (yet)… |
Hope this helps someone, I just spent about 2 hours figuring it out. You can change the speed of the motor by going to developer tools > services, choosing Zigbee Home Automation: Issue zigbee cluster command and use YAML mode to enter this
|
@christovic maybe you can help us with a custom quirk in the #1294 |
Added request for Tuya Tubular Roller Blind manufacturer": "_TZE200_uzinxci0 Would it be possible to add this to?? Thanks YOU!!! |
I wish! Not sure how these things are added to devices as attributes - would it have to be another entity? What kind of entity would we be looking at? Happy to give it a crack but if you could point me in the right direction I might have a bit more luck. Currently I'm just using a couple of templates to automate changing the speed and a helper to have some GUI control. Edit: Just looked at the definition for a cover in Home Assistant Core. There's no attribute for speed so it would have to be implemented there first: https://github.com/home-assistant/core/tree/dev/homeassistant/components/cover |
Could you please point me to any reference for setting limits with the RF remote? (I have one, but not the requisite bridge and the supplier cannot provide seemingly.) |
Hi, I've got an issue with an AM43 Tuya Motor Curtain with ZHA. I pair the device successfully and use it, but then after a few hours it's declared unavailable. Reinitialising ZHA fixes it for a few hours then the behaviour repeats itself. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions. |
I can't set the speed on HA 2024.3.0. paste your code on yaml, changed {integer between 0 - 100} to 30 and got an error. I removed the {} -[4, 0, 0, 0, 30] is this correct? |
Is your feature request related to a problem? Please describe.
Request and placehoder for information about the Tuya Curtain motor > specfically:
https://zigbee.blakadder.com/Moes_AM43-0_45_40-ES-EB.html
z2m device: https://github.com/Koenkk/zigbee-herdsman-converters/blob/9e4c36cd79e15449830f5e09540157c0e8d686a1/devices.js#L1481
z2m fromZigbee: https://github.com/Koenkk/zigbee-herdsman-converters/blob/9e4c36cd79e15449830f5e09540157c0e8d686a1/converters/fromZigbee.js#L1490
z2m toZigbee: https://github.com/Koenkk/zigbee-herdsman-converters/blob/9e4c36cd79e15449830f5e09540157c0e8d686a1/converters/toZigbee.js#L3377
Describe the solution you'd like
ZHA support :)
Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.
Additional context
Add any other context or screenshots about the feature request here.
For reference since the only place I found it was in the review comments on Aliexpress. to get into pairing mode, hold the set and down button simultaneously until light blinks.
The text was updated successfully, but these errors were encountered: