Skip to content
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 2 Gang ZigBee Dimmer Module #5320

Closed
vishivishy opened this issue Sep 23, 2021 · 46 comments · Fixed by #5869
Closed

Tuya 2 Gang ZigBee Dimmer Module #5320

vishivishy opened this issue Sep 23, 2021 · 46 comments · Fixed by #5869

Comments

@vishivishy
Copy link

vishivishy commented Sep 23, 2021

Device

  • Product name: MoesHouse 2 Gang ZigBee Dimmer Module MS-105BZ
  • Manufacturer: _TZE200_e3oitdyu
  • Model identifier: TS0601
  • Device type : Light

Screenshots

Screen Shot 2021-09-24 at 3 26 24 pm

Basic

Screen Shot 2021-09-24 at 3 10 28 pm

Groups

Screen Shot 2021-09-24 at 3 23 56 pm

Screen Shot 2021-09-24 at 3 24 19 pm

Scenes

Screen Shot 2021-09-24 at 3 24 35 pm

Screen Shot 2021-09-24 at 3 33 46 pm

Screen Shot 2021-09-24 at 3 34 11 pm

Screen Shot 2021-09-24 at 3 25 00 pm

Other clusters that are not mentioned above

Screen Shot 2021-09-24 at 3 25 16 pm

Screen Shot 2021-09-24 at 3 25 42 pm

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 23, 2021

Can you please add all screens?

@vishivishy
Copy link
Author

Can you please add all screens?

Hi Mimiix, 👋 vishivishy here. Hope you've been well.
Sorry I couldn't figure out earlier how to get additional cluster info screens. I've added them now, do let me know if there's anything else needed.
Thanks!!

@Smanar
Copy link
Collaborator

Smanar commented Sep 24, 2021

It s perhaps a 1 line edit modification.

Do you have a linux machine with full OS to test a code modification ?

Edit:
I confirm it s a _TZE200_la2c2uo9 clone, so the code is already ready.

Edit2:
Bad news, sorry, it s a 2 gangs, so not sure it will be possible to create a fake endpoint.

@vishivishy
Copy link
Author

Hi @Smanar thanks for looking into this. So is it that 2 gang can not be supported by deconz or that I wont be able to test the new modified code?

@Smanar
Copy link
Collaborator

Smanar commented Sep 24, 2021

Can work, as you are not using common Mac adress, from the issue it seem the only one other device that use this mac adress is a covering.

You have a linux machine with full OS ?

@vishivishy
Copy link
Author

I can setup a new linux vm if that works.. (if you can give me details of the setup)

@Smanar
Copy link
Collaborator

Smanar commented Sep 25, 2021

Yes it work on VM, so you need to set the VM, update the OS, install deconz using package method https://www.phoscon.de/en/conbee2/install

For the rest you have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Compiling-the-REST-plugin-for-device-specific-testing
So for you, after having installed deconz :

sudo apt install deconz-dev
git clone --branch tuya_dimmer_test_1 https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

But from the code, you need to have at least the on/off working for one gang ?

@vishivishy
Copy link
Author

vishivishy commented Sep 25, 2021

I already am able to use on/off for 1 gang on the current homeassistant-deconz (6.10.0) firmware(26660700).
but do not have control over brightness or the second gang.

@vishivishy
Copy link
Author

Yes it work on VM, so you need to set the VM, update the OS, install deconz using package method https://www.phoscon.de/en/conbee2/install

For the rest you have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Compiling-the-REST-plugin-for-device-specific-testing
So for you, after having installed deconz :

sudo apt install deconz-dev
git clone --branch tuya_dimmer_test_1 https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

But from the code, you need to have at least the on/off working for one gang ?

@Smanar so I ran the updated plugin on the linux vm and I'm able to control brightness of the 1 gang that I was able to turn on and off earlier.
I do however see 2 additional lights in the Phoscon app but turning them on/off does not translate to actions on gang 2.

here are some screenshots from the test

Screen Shot 2021-09-26 at 2 20 31 am

Screen Shot 2021-09-26 at 2 21 23 am

Basic

Screen Shot 2021-09-26 at 2 24 12 am

Groups

Screen Shot 2021-09-26 at 2 24 52 am

Scenes

Screen Shot 2021-09-26 at 2 25 31 am

Other

Screen Shot 2021-09-26 at 2 25 47 am

Screen Shot 2021-09-26 at 2 26 53 am

@Smanar
Copy link
Collaborator

Smanar commented Sep 26, 2021

Yes the code create 3 "light", it s because this part is a hack used for 3 gangs devices.
Have modified the code again, to try to enable the second gang.

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

@vishivishy
Copy link
Author

Hi @Smanar! I've tested the new changes and here are the findings:

  • I still have 3 lights visible in the phoscon and deconz webapp
  • I am able to turn on/off and change brightness of gang 1 in Phoscon app as one would expect.
  • I am able to "only turn on" and change the brightness of gang 2 in phoscon app (the light does not show if it is turned on, it always shows light is off. and sometime after setting the brightness, the brightness slider moves back to 0% brightness as it seems to not be able to read the status of the device) and because the phoscon app thinks the light is not turned on it does not let me turn off the light. I have tried showing this in the following screenshots.

Screen Shot 2021-09-26 at 6 42 27 pm

The light turned on and brightness was set correctly on the device but that does not reflect in the phoscon app later (problem only with gang 2)

Screen Shot 2021-09-26 at 6 44 10 pm

  • The deconz webapp is not able to turn on any of the lights. so both gang 1 and gang 2 do not respond in the deconz webapp but other single gang relay based zigbee switches can be turned on/off from the app.

Screen Shot 2021-09-26 at 7 04 49 pm

Node Info

Screen Shot 2021-09-26 at 6 43 02 pm

Basic

Screen Shot 2021-09-26 at 6 43 27 pm

@Smanar
Copy link
Collaborator

Smanar commented Sep 26, 2021

I still have 3 lights visible in the phoscon and deconz webapp

Yeap, this is normal for the moment, will be corrected in the future with ddf file, I need to remove this hack

And you was right for the rest, it s because the return state was bad. Have updated the code again.

But for the code is not working using the second Webapp, it s strange, are you able to find some logs somewhere ? using the dev console, deconz logs, or others ?

@vishivishy
Copy link
Author

Hooray! Both the gang lights are working as expected in the Phoscon app!
But as for the deconz webapp its the same outcome as before. I did however follow the step 9 from following guide to generate the attached log file.

https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Compiling-the-REST-plugin-for-device-specific-testing

I could only see these errors in the logs but have attached the log file in case you need to check something else out.

00:07:54:568 Erase task req-id: 11, type: 14 zcl seqno: 70 send time 1, profileId: 0x0104, clusterId: 0x0006
00:07:55:595 API error 6, /lights/4/state, parameter, id, not available
00:07:57:071 Daylight now: nadir, status: 100, daylight: 0, dark: 1
00:07:57:858 void deCONZ::zmNode::setFetched(deCONZ::RequestId, bool) fetched item: 8, node: 0x93F3
00:07:57:858 neigbor 0x00158d00067efd68 is unknown child
00:07:57:858 neigbor 0x00158d00023e8027 is unknown child
00:07:58:314 CTRL skip creating node 0x00158D00067EFD68 while permit join is disabled
00:07:58:771 API error 6, /lights/4/state, parameter, id, not available
00:07:58:790 CTRL skip creating node 0x00158D00023E8027 while permit join is disabled
00:08:00:180 API error 6, /lights/5/state, parameter, id, not available
00:08:02:272 API error 6, /lights/5/state, parameter, id, not available
00:08:02:656 void deCONZ::zmNode::setFetched(deCONZ::RequestId, bool) fetched item: 8, node: 0xEC07

test_debug.log
I kept the test quick and short under 1 minute so there is not too much noise and log file stays small, hope this helps. Do let me know if you need me to get you any other logs. Thanks!

@Smanar
Copy link
Collaborator

Smanar commented Sep 26, 2021

Hu .., In fact I have some problem ATM, I have no internet connexion, and no deconz running to check ^^ (for at least 2 days)
But I can't understand why it work on phoscon and not the old webapp.

00:07:58:771 API error 6, /lights/4/state, parameter, id, not available

Something is bad on the request

Something you can try is enabling the developper console on your web browser to check http request or easier check for "http" logs on deconz.

Take care care thoses logs are realy talkative, so enable only "http", on thoses logs you will see incoming and outgoing requests from deconz, so you will see the request made by phoscon and the one made by the old webapp.
Perhaps you will see something different in them ?

@vishivishy
Copy link
Author

vishivishy commented Sep 27, 2021

Hi @Smanar, so I had a look at the requests being sent by Phoscon and deconz webapp, and seems like the two apps are sending different payload in the put request.
Phoscon is sending this and getting response code 200

{"on":true,"bri":25,"transitiontime":9}

and deconz webapp is sending this and getting response code 400

{"id":"4","on":true}

it seemed like the api is not expecting the "id" parameter in the payload so I tested on postman and can confirm that when we send id param in payload the server sends a 400 response, but if I remove the id param the server responds with 200 and turns on the light.

An interesting thing I noted is that sending "id" parameter in payload for a device with single gang does not return a bad request 400 response and it turns on the light as shown in the screenshots below. (*But the phoscon app does not send the id param in the payload regardless of what kind of light it is, probably because the "id" is a path parameter)

2 gang device

Screen Shot 2021-09-27 at 10 41 54 pm

Screen Shot 2021-09-27 at 10 42 18 pm

Screen Shot 2021-09-27 at 10 42 35 pm

1 gang device

Screen Shot 2021-09-27 at 10 43 02 pm

Screen Shot 2021-09-27 at 10 43 16 pm

Screen Shot 2021-09-27 at 10 43 31 pm

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2021

Ok have added a code part to make the "id" skipable for the tuya part. (Same command to update your code)
But I have not understand yet why it work for simple gang ....

@vishivishy
Copy link
Author

vishivishy commented Sep 28, 2021

Thanks @Smanar everything seems to be working now!! What's next?

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2021

Have just made the PR.
ATM we are waiting for DDF file, so lot of PR are locked in waiting list.

Next is waiting for validation, but it s possible I change the code to use DDF file ( to remove the useless "light" entry)

@vishivishy
Copy link
Author

Cool, sounds good. I'll look forward to troubleshooting and fixing another tuya device with you someday.. :)

@github-actions
Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Oct 21, 2021
@vishivishy
Copy link
Author

Hi @Smanar! just following up to see if this is getting merged soon..

@github-actions github-actions bot removed the stale label Oct 23, 2021
@vishivishy
Copy link
Author

Hi @Mimiix! How have you been? just following up to see if this is getting merged soon..

@Mimiix
Copy link
Collaborator

Mimiix commented Oct 26, 2021

@vishivishy Hi! :) All good here. How about you? Thanks for asking :)

I'll ask manup to merge it, but can't make promises.

@vishivishy
Copy link
Author

@Mimiix I'm good too, thanks :)
No worries, thank you for looking into this!
also just one more question, do you know how frequently is the deconz home assistant add-on updated?

@Mimiix
Copy link
Collaborator

Mimiix commented Oct 26, 2021

@vishivishy It gets updated once a new deCONZ stable is out.

@blaz122
Copy link

blaz122 commented Nov 10, 2021

Hi, what to do to have working dimming on those dimmers? Do we just have to wait to be implemented?

If I understood correctly 1 gang and 3 gang moes are already supported?

@Smanar
Copy link
Collaborator

Smanar commented Nov 10, 2021

It's totaly random, there is new tuya every days, and all look same (and can have same product name), need to compare according the manufacture name and MAC address.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2021

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 2, 2021
@vishivishy
Copy link
Author

not stale

@github-actions
Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 24, 2021
@github-actions
Copy link
Contributor

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

@vishivishy
Copy link
Author

not merged yet

@Mimiix Mimiix reopened this Jan 1, 2022
@github-actions github-actions bot removed the stale label Jan 2, 2022
@randysnel
Copy link

looking forward to buy one, so hope it will be merged soon!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Feb 7, 2022
@vishivishy
Copy link
Author

not stale

@github-actions github-actions bot removed the stale label Feb 9, 2022
@LongTimeUser77
Copy link

I have the phoscon II and de deconz software on my pi.
The moes 2 gang from ali express installed in my kitchen.
but in the software only getting a light bulb. No dimmer function of two dimmers shown.
I see that on the 2mqtt this _TZE200_e3oitdyu works as it should.
When will this be available on the deconz?
I have a phonscon II on my pi 3
deconz firmware 26720700
version 2.14.00

@Smanar
Copy link
Collaborator

Smanar commented Feb 9, 2022

For the moment PR are locked to use only DDF #5733

This device can't be added using DDF, so need to improve the DDF core to manage tuya cluster.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2022

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Mar 3, 2022
@vishivishy
Copy link
Author

not stale

@github-actions github-actions bot removed the stale label Mar 4, 2022
@manup manup added this to the v2.15.0-beta milestone Mar 15, 2022
@manup manup linked a pull request Mar 15, 2022 that will close this issue
@Smanar
Copy link
Collaborator

Smanar commented Mar 15, 2022

For information there is a PR and a DDF for this device #5869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment