-
Notifications
You must be signed in to change notification settings - Fork 503
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
DS82-Tuya-Zigbee Curtain Drive #4521
Comments
Hello, do you have a linux machine to test code change ? |
Yes - with following considerations: I run DeconZ community container in Debian Buster. If testing is required and existing setup isn't sufficient, I can make another virtual machine. |
Yes, I think it will be better, hard to do on docker, easier on VM.
You will need 2 inclusions without deleting the device for integration. I haven't tested the code on my side, so you can have error on compilation. |
It compiled. Following error was proven to be due to a somewhat tainted environment.
|
Will try on my side, but need some time, you have the error on start ? |
On a fresh install, it compiled and starts up properly after swapping the Conbee II to that VM. Unfortunately the controls in Phoscon appear to do nothing, possibly due to an oversight on my part. Thus, I can't test whether the device connects properly now. I will attempt to add GUI to the VM during the weekend to have a look at it. |
Hu, it will be more complicated ^^ The device is probably not visible in phoscon, and tuya cluster is not usable in the GUI. You need to use third app or directly the API https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/ If you have problem, I can give you curl command to test ? |
Okay, I had time to take this further. Got the API calls working, what am I supposed to request from the server? |
For exemple with curl
IP and PORT : same than for phoscon To get an api key You have open = true/false, and lift= 0 to 100 |
requesting /lights/ID returns
requesting /lights/ID/state returns
|
Oh nevermind, using CURL and not REST client made something happen. The motor started moving. |
I have tested |
Read the manual for calibration before, there is a command to trigger a zigbee calibration, but IDK what it do on the device. And I think you need to set it to false after.
To change side, it s possible with code, but try before (because the device have return state, and this one can be reversed too)
|
Unfortunately the manual is for the wifi version and only tells how to reverse motor direction or attach remote (also puts to zigbee pairing mode). I have however learned the device should auto calibrate during first run. I was able to force auto calibration by long-pressing pairing key to reset position data, then starting the motor in each direction in sequence and stopping the motor shaft with pliers. This auto calibration happens the same whether motor is started by manually rotating it or giving zigbee signal. Additional edit for accuracy, after testing multiple times: Motor now responds to "lift": 1..100 as expected, and opens/closes to positions "calibrated" by stopping the motor. |
You mean to calibrate the device, you have re-included it, and used it immediately ? I m realy interested by the method, lot of user ask for it.
So all is working ? no need to reserve a side or a return ?
or ALL values reversed. |
To reset calibration of the device, I simply long-pressed the include key. This should be enough, although a full reset will work for sure: like with pairing mode, one would triple-press and long press in sequence. To reverse motor, it could be done with RF remote according to manual, or supposedly thru Zigbee command as described in zigbee2mqtt device info. https://www.zigbee2mqtt.io/devices/TS0601_cover.html For Where do I see this JSON info? |
To have the JSON just go For the reverse it s the same command than for zigbee2mqtt, can you show the curl command you are using ? (no "state" inside) |
Something happened with the motor with this:
The open/close commands still move it the same way, but it reports reversed state.
|
Ha ? I think you have find a new issue.
For deconz if lift < 100 , the covering is not closed, It's because the covering is not full closed or because of the calibration ?
Are you sure the command have worked (because for me the difference in JSON is not from that) ? I don't think it change something, but try with removing the last "/" |
It was by coincidence that the motor value changed. The motor moves a little bit back and forth when the reverse command is issued. I'm now using Mozilla RESTClient extension to make it easier. All commands report success in response field. commands, after which I checked for changes in the JSON:
Note how the status was "not open" until issuing the open command. The motor didn't spin except for about a full rotation back and forth when attempting to apply reverse mode. |
So need some cycle to stabilise the "machine" ? But I don't see difference for { "open": true } with "reverse" = true or false. |
I found the hardware didn't function in a different manner no matter the setting. |
Ok, I have found a problem in the "reverse" command, can you try with the new code.
No need to re-include the device, just close deconz before changing file, adn restart it. |
Tested multiple times, consistent results immediately after reaching position: Issuing '{"open": true}' always moves to position 100, and '{"open": false}' always moves to position 0. These change the open status accordingly if motor was already in that position, overriding the reverse setting behavior. This state appears to fix itself without interaction. Not sure how that happened, unable to reproduce by waiting. |
So the "reverse" command now have an impact ? But how you can reverse the motor side ? We can't switch wire on this device.
So if the "reverse" command switch lift position, it mean in a situation 100 is up and the other 100 is down ? |
Yes, with current behavior this appears to be the case.
Attaching double curtain to different sides of the rail. Single curtain, attaching it on the other side. Movement direction would then change. Because doing this is possible, reversing shouldn't be neccessary in a real world scenario so it may only exist for convenience, or because this might be shared firmware for roller curtains - those have a valid use case for a mirrored installation. |
Ha ok. So it s device dependant, for your device, to reverse side, we need
so the motor still run in the same side, but the automation have the return reversed. Thx a lot for the "reverse" issue, I realy have skipped this bug, can explain why there is so much user with side direction problem .... And BTW, so your device works correctly finaly ? nothing to change ? |
Didn't find any functional issues with the device last night. Btw, when manually pulling the curtain (or rotating the motor without anything attached), it will move to either min or max point, and report the state change once the move completes. |
Nice feature for me, can make the motor move without using remote, just with moving a little the covering ? Pr done |
Apparently I was not able to copy built plugin properly the first time |
Confirming Kllrv finding about 'reserse' command has no effect. |
To reverse direction with motor button, one short press and one long press did it for me. Works the same as the command, as described above. |
Can you share logs ("info") when using the command, with the last code. And BTW I have find why it can be hard to include the device some time >Smanar@31eb4b6 |
Unable to compile the changes I pulled just now:
|
Just now ? you are trying wich one branch ? The tuya_14 ? or the DS82 ? |
DS82. Did you want me to try the other one? |
Depend if the device is reconized or not ? |
In the DeconZ UI, it's appearing as the wrong device type - but otherwise functions as expected through API. Not sure if this would be fixed by removing and re-adding, not eager to break a working setup right now. |
cherry-picked 31eb4b6 into DS28 branch,
I captured log, what I should grep from it of interest? |
So perhpas a solution ...
Yep, this is normal, the device present itself as a smart plug, but I can cheat for the API
I don't know exactly how work the reverse command, I just mimic the command send by the gateway, the last users that have tested it have said it NOT change the motor direction, but the state return when it reach a position.
Yep the log starting by "tuya debug" when you have do the reverse command pls. |
Given reverse now works in only in one direction (CCW), maybe there is another command for an opposite direction (CW)? Is command sent via tuya cluster? Log for reverse: |
I can't see the command to reverse device. Can you show the rest API command you have used ? The error handling is not perfect, so you can have a success message but without the command working Yes it use the tuya cluster, but tuya command are not standard, you can't use the GUI for that, but If you change the side manualy on the device it s possible seing the command on deconz log (not working for all command)
This is for command received, but you have too send request The command to change side is (0x04 0x05) |
tested { "reverse": true } again: :false after manual (using button on motor) reverse: |
If I send command to tuya cluster using deconz gui { Dp: 0x405 the rest fields are zeros } it does change direction to opposite of REST reverse command and there is no record about it in logs (how I can enable logging of what is send via deconz GUI). Seemingly it looks like the command that 'reverse' command also sends but it sets opposite direction, which is strange |
I m think im wrong again in the request, I need to send "00" and "01" not "0000" and "0001".
replaced in
If I m right when you do the request, the device need to answer with same command (I think) |
It works as expected with this change. |
Arf, IDK what I have missed that, thx, I will correct the PR immediatly. |
Hello, for users that have the _TZE200_zpzndjez |
Not possible, the tuya cluster have a special "synthax" not compatible with deconz core. And since the last message (22 days ago) the code have moved ^^ |
Hi @Smanar ,
I've read the entire thread and you said here that it's normal, but I couldn't understand if that was solved already or not. |
Yep, except I have made a mistake, on the actual code all tuya covering have a new type "Window covering device" |
@Smanar Sorry, not sure I understand, so there's no hope of seeing it appear as a cover device in the phoscon UI and in apps such as home assistant? |
_TZE200_zpzndjez need to appear as cover in third app (like HA), because it s modified in the API |
This is supposedly a Zigbee 3.0 compliant curtain rail motor, released in 2020 or Jan 2021.
https://www.aliexpress.com/item/1005001874380608.html?
Device
Screenshots
Somewhat misidentified as a smart plug
basic
tuya specific
otau
The text was updated successfully, but these errors were encountered: