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 Moes ZTS-EUB - 1 gang switch #5505

Closed
orionevo14 opened this issue Nov 21, 2021 · 72 comments · Fixed by #6366
Closed

Tuya Moes ZTS-EUB - 1 gang switch #5505

orionevo14 opened this issue Nov 21, 2021 · 72 comments · Fixed by #6366

Comments

@orionevo14
Copy link

Device

  • Product name: Tuya Moes ZTS-EUB
  • Manufacturer: _TZE200_amp6tsvy
  • Model identifier: TS0601
  • Device type :
    • Switch

Seems to be similar to this one :
#2879

Screenshots

Capture1

node_info

Basic

basic

Groups

group

Scenes

scenes

Other clusters that are not mentioned above

Tuya specific cluster
tuya

@orionevo14 orionevo14 changed the title Device name Tuya Moes ZTS-EUB Nov 21, 2021
@orionevo14 orionevo14 changed the title Tuya Moes ZTS-EUB Tuya Moes ZTS-EUB - 1 gang switch Nov 21, 2021
@Smanar
Copy link
Collaborator

Smanar commented Nov 21, 2021

Hello, it s a wired device ?
If yes, have you a recent deconz version, with DDF ?

@orionevo14
Copy link
Author

Hello, yes it is.
I'm running deCONZ on a RPi4 with Home Assistant integration so I don't have the latest version, only the 2.12.6 so no DDF I think

@chatainsim
Copy link

chatainsim commented Nov 22, 2021

Hello, same here with a 2 gangs.
image
Basic
image
Groups
image
Scenes
image
Others Clusters
image

Same version, Deconz add-on on HA 2.12.6

Thanks

@Smanar
Copy link
Collaborator

Smanar commented Nov 22, 2021

I can explain a way to make it working in 5mn for almost all tuya switch (that use already supported tuya command) and without compiling the code, but you need at least a version that support DDF.

And this method will be beta (disabled at every restart for the moment, waiting for next deconz version)

@chatainsim
Copy link

chatainsim commented Nov 22, 2021

I can explain a way to make it working in 5mn for almost all tuya switch (that use already supported tuya command) and without compiling the code, but you need at least a version that support DDF.

And this method will be beta (disabled at every restart for the moment, waiting for next deconz version)

How can we check if there is DDF support ?

Edit: ok, seems to be in 2.13+

@orionevo14
Copy link
Author

I can explain a way to make it working in 5mn for almost all tuya switch (that use already supported tuya command) and without compiling the code, but you need at least a version that support DDF.

And this method will be beta (disabled at every restart for the moment, waiting for next deconz version)

Hello @Smanar
I can wait. When the method you're talking about will be considered as stable ? In the next 2.13 stable version ?

@Smanar
Copy link
Collaborator

Smanar commented Nov 22, 2021

No sure, will take some time to have the DDF core full working. But if the autodisable at sartup is removed (it s for me the more boring) you can already start to use it.
But yes on the next stable DDF will be usable, even still beta. It will work for exemple for wired switch (already tested on a dimmer one), but not battery one.

@orionevo14
Copy link
Author

Ok thank you for the detailed information, and fast answers too.
Do you have a link or something to some documentation about the way to fix it ? Will surely test that when I'll be able to use 2.13.x

@chatainsim
Copy link

2.13 stable should be release soon I hope:

Current Beta: v2.13.2-beta
Current Stable: v2.12.6

Next Beta: v2.13.3-beta
Next Stable: v2.13.x expected in November.

We also have to wait the HA addon update then.

@Mimiix
Copy link
Collaborator

Mimiix commented Nov 23, 2021

@chatainsim I shouldn't get my hopes up for november. I think december or perhaps january is a more appropriate timeframe.

@Smanar
Copy link
Collaborator

Smanar commented Nov 23, 2021

For the documentation about DDF (sorry the documentation is WIP too)
The hard part > https://dresden-elektronik.github.io/deconz-dev-doc/modules/ddf/
The easy one > https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet

You can find some device already done with capture on the forum or the github

@Mimiix
Copy link
Collaborator

Mimiix commented Nov 24, 2021

@orionevo14 Missing a forum post aswell. Can you please make one?

@orionevo14
Copy link
Author

orionevo14 commented Nov 24, 2021

@orionevo14 Missing a forum post aswell. Can you please make one?

Of course !
https://forum.phoscon.de/t/tuya-moes-zts-eub-1-gang-wired-switch/946

@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 16, 2021
@Der-WU
Copy link

Der-WU commented Dec 16, 2021

Hat anyone the ddf Files ready for the 1 and 2 wa Switch?
Are they still in Progress?

Great

@Smanar
Copy link
Collaborator

Smanar commented Dec 16, 2021

If it s a wired device, it can be possible if you have a deconz version that support DDF.

Take a look here https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet

As device type take on/off light, and you can let all the rest empty, because the device don't use report, don't use bind, don't use classic cluster.

@Der-WU
Copy link

Der-WU commented Dec 16, 2021

I do it. And add 2 on/off light.
But in phoscon it is shown as lightchain and only one light.

@Smanar
Copy link
Collaborator

Smanar commented Dec 16, 2021

Can you show your DDF, and the cluster list of your device ?
You need to use fake Endpoint if you have 2 gangs, because I think at the base you have only one.

@Der-WU
Copy link

Der-WU commented Dec 16, 2021

My DDF looks :

{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE200_g1ib5ldv",
"modelid": "TS0601",
"product": "TS0601",
"sleeper": false,
"status": "Gold",
"path": "/devices/ts0601.json",
"subdevices": [
{
"type": "$TYPE_ON_OFF_LIGHT",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x01"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/on",
"refresh.interval": 5
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_ON_OFF_LIGHT",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x02"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/on",
"refresh.interval": 5
},
{
"name": "state/reachable"
}
]
}
]
}

The Cluster are like the 4th Post.

@github-actions github-actions bot removed the stale label Dec 17, 2021
@Smanar
Copy link
Collaborator

Smanar commented Dec 17, 2021

Ha nice DDF, I would have done the same

But in phoscon it is shown as lightchain and only one light.

I m not sure to understand but phoscon can "custom" display.
Can you checks the 2 devices json ? You can find them in phoscon / help / api information, the result will be more "raw" without phoscon interpretation.

And BTW nothing is working when trying using phoscon on them ?

@Der-WU
Copy link

Der-WU commented Dec 18, 2021

I found some info about the state of ON/OFF.

https://www.zigbee2mqtt.io/devices/TS0601_switch_3_gang.html#tuya-ts0601_switch_3_gang

This is for the 3 way switch.

The 2 way switch used Endpint 1 and 3.

If i Turn in Off on phoscon, nothing Happens.

@Smanar
Copy link
Collaborator

Smanar commented Dec 18, 2021

The 2 way switch used Endpint 1 and 3.

But it's virtual endpoint, your device have only one in reality.
It s easy to check, enable deconz log with "info", you will see line with "tuya debug", and press the 2 buttons, to mimic the request.

@chatainsim
Copy link

@Der-WU did you manage to make it work ?
I've tried to edit the DDF but it's not working.
To light appear in Phoscon but nothing in HA.
They appear in Phoscon, Help, API information.

@Smanar
Copy link
Collaborator

Smanar commented Jan 4, 2022

To light appear in Phoscon but nothing in HA.

Not normal, HA use the same API than deconz

But BTW you have used the same DDF than him ?
How they are working in phoscon ?
Can you show the 2 device json as result of this DDF ?

@TheAlphaLaw
Copy link

Is there any additional info on the above switch. Still not able to utilize in GUI or turn light off or on.

@Smanar
Copy link
Collaborator

Smanar commented Sep 5, 2022

Hello, just to try, can you try this DDF ? (long time we haven't check with recent deconz version)


{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_g1ib5ldv",
  "modelid": "TS0601",
  "product": "TS0601",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 1,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "tuya"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 2,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 2,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "none"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 5, 2022

Reopening.

@TheAlphaLaw
Copy link

Hello, just to try, can you try this DDF ? (long time we haven't check with recent deconz version)


{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_g1ib5ldv",
  "modelid": "TS0601",
  "product": "TS0601",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 1,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "tuya"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 2,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 2,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "none"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

Is there a simple way to copy this info in? I see edit DDF. Thanks!

@Smanar
Copy link
Collaborator

Smanar commented Sep 8, 2022

Yep you can

  • make "edit DDF"
  • Save the file, with looking for the name and the path
  • Edit the file with a text editor and paste this contain

Or can just create a json file in the "devices" folder, what is your OS ?

@TheAlphaLaw
Copy link

Yep you can

  • make "edit DDF"
  • Save the file, with looking for the name and the path
  • Edit the file with a text editor and paste this contain

Or can just create a json file in the "devices" folder, what is your OS ?

Win 11. I used visual basic to make a JSON files and edited DDF. No change.

@Smanar
Copy link
Collaborator

Smanar commented Sep 8, 2022

Deconz check all DDF only at start, so perhaps with restarting deconz.
If you make "edit DDF" now, you will have the edited DDF no ? If you use the editor to make so changes, you can use the "hot reload" fonction in the editor to not have to restart deconz.

If the modified DDF is not used, create a json file in the "devices" folder, it s the defaut folder used by deconz.

@TheAlphaLaw
Copy link

Deconz check all DDF only at start, so perhaps with restarting deconz. If you make "edit DDF" now, you will have the edited DDF no ? If you use the editor to make so changes, you can use the "hot reload" fonction in the editor to not have to restart deconz.

If the modified DDF is not used, create a json file in the "devices" folder, it s the defaut folder used by deconz.

Already done. Does not appear in Home Assistant or Phosconz.

@Smanar
Copy link
Collaborator

Smanar commented Sep 10, 2022

And if you make "Edit DDF" on the GUI on the node with the right clic menu ?
It open the good file ? (the file and the name is visible on the editor title)

@TheAlphaLaw
Copy link

And if you make "Edit DDF" on the GUI on the node with the right clic menu ? It open the good file ? (the file and the name is visible on the editor title)

Correct, but still not picked up by Phoscon or Home Assistant.

@Smanar
Copy link
Collaborator

Smanar commented Sep 14, 2022

Can you enable log in deconz with "DDF" and "info" ("info_l2 if possible) and on the DDF editor make "hot reload"

@TheAlphaLaw
Copy link

Can you enable log in deconz with "DDF" and "info" ("info_l2 if possible) and on the DDF editor make "hot reload"

Nothing shows in either log for that device after hot reload...

@Smanar
Copy link
Collaborator

Smanar commented Sep 16, 2022

With "info" you need to see

12:35:47:792 update ddf TS0601 index 1
12:35:47:794 Hot reload device: 84:fd:27:ff:fe:89:ae:21
12:35:47:902 DEV found DDF for 0x84FD27FFFE892A21, path: /home/pi/.local/share/dresden-elektronik/deCONZ/devices/dimmer_module.json

Else it mean the DDF is not used, why why it's the one selected on the editor when you make "edit DDF", you are sure it's the same and path in the window title bar ?

Thoses value are good, visible in "node information" or cluster 0x0000 ?

  "manufacturername": "_TZE200_g1ib5ldv",
  "modelid": "TS0601",

The node name in deconz is still something like 0xXXXX ?

@nixagit
Copy link

nixagit commented Sep 22, 2022

When I try this the json file doesn't load on restart. I can open the json from Edit DDF menu but node remains 0xXXXX even after hot reload. It's correctly named in the /devices folder. Hot reload isn't noted in the info debug. It just says:

update ddf TS0601 index 0

Nothing more than that.

I have a 1-gang switch so only included the first endpoint.

@Smanar
Copy link
Collaborator

Smanar commented Sep 27, 2022

For me it mean the DDF is not used at all.

  • The DDF is not at the good place
  • The device have different model id / manufacture name, perhaps a typo somewhere ...
  "manufacturername": "_TZE200_g1ib5ldv",
  "modelid": "TS0601",

What is your deconz version ?

@nixagit
Copy link

nixagit commented Sep 28, 2022

Deconz version is 2.17.1

I can't see any errors/typos. Before editing the DDF, the switch reports its manufacturer name as "_TZE200_amp6tsvy". Should I use this or change to "_TZE200_g1ib5ldv"?

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

Ha ? Oups, yeah after reading there is 2 devices in this post, sorry.
"modelid": "TS0601" is good ?

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_amp6tsvy",
  "modelid": "TS0601",
  "product": "Tuya Moes ZTS-EUB - 1 gang switch",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 1,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "tuya"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {
            "fn": "tuya",
            "dpid": 2,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 2,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;"
          },
          "read": {
            "fn": "none"
          },
          "refresh.interval": 300
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

@nixagit
Copy link

nixagit commented Sep 29, 2022

Sorry for ths confusion. I assumed the manufacturer name would be the same for all devices. Apparently not. Anyway, it now works. The switch shows up in the web gui as "fairy lights" but works as expected and I can control it through Home Assistant.

My switch is 1-gang so this is the json I used:

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_amp6tsvy",
  "modelid": "TS0601",
  "product": "TS0601",
  "sleeper": false,
  "status": "Gold",
  "path": "/devices/ts0601.json",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "refresh.interval": 300,
          "read": {
            "fn": "tuya"
          },
          "write": {
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;",
            "fn": "tuya"
          },
          "parse": {
            "dpid": 1,
            "eval": "Item.val = Attr.val;",
            "fn": "tuya"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

@Smanar
Copy link
Collaborator

Smanar commented Sep 29, 2022

Nice, thx, Pr submitted #6366

@TheAlphaLaw
Copy link

TheAlphaLaw commented Oct 17, 2022

Downloaded pre-release and this switch does not pickup new DDF, weird.

Edit: Manually added new DDF and it worked.

@Smanar
Copy link
Collaborator

Smanar commented Oct 18, 2022

Ha ?
Folder issue ?
It was not present on the good folder, the one you have added it ?

@TheAlphaLaw
Copy link

@Smanar

I had to add it manually. Also, anytime I restart Deconz, it reverts and loses DDF profile.

@TheAlphaLaw
Copy link

Latest update working great, thank you!

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

Successfully merging a pull request may close this issue.

7 participants