dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 490 forks source link

Tuya Zigbee 3.0 Remote Control (2 Gang) || Zigbee ID: "TS0042"; "_TZ3000_i3rjdrwu" #5571

Closed julunde closed 2 years ago

julunde commented 2 years ago

Device

device

Screenshots

Switch Info

Switch info

Node Info

node info

Basic Cluster Info

Basic Cluster

Power Config Cluster Info, Button 1

Power Config 1

On/Off Cluster Info, Button 1

On off Node 1 - 1

On off Node 1 - 2

On off Node 1 - 3

Power Config Cluster Info, Button 2

Power Config 2

On/Off Cluster Info, Button 2

On off Node 2 - 1

On off Node 2 - 2

On off Node 2 - 3

Basic

Identify

Alarms

Device Temperature

Groups

Scenes

On/Off

Level Control

Color Control

Simple Metering

Diagnostics

Other clusters that are not mentioned above

julunde commented 2 years ago

I attempted to get this to work myself by following this device request the changes here and adding the manufacturer ID to the button_maps.json and then de_web_plugin.cpp file and trying to complile the deconz_rest_plugin but unfortunately I just get the following error when I try:

Capture

I'm hoping someone more familiar with the product can do better than I can 😄

Smanar commented 2 years ago

Hello, I think you have an error some lines above. Your changes are online or only locals ?

You can try to compile the code "official first" (but in other place or need to delete the previous folder)

git clone https://github.com/dresden-elektronik/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

Can try without the -j2 (I think it will remove the "waiting for unfinished jobs")

julunde commented 2 years ago

That worked @Smanar it compiled in the end, not sure what was different but the button events are showing up in the API now. Thank you so much!

Maybe the team can add it to a future release so its compatible for anyone buying in future? 😄

ebaauw commented 2 years ago
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/4: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":1,"etag":"1bfd4b4f5640d78e988d53cf84773807","lastannounced":null,"lastseen":"2021-12-16T20:14Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch (2)","state":{"buttonevent":1002,"lastupdated":"2021-12-16T20:11:40.488"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7e-01-0006"}

[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/5: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":2,"etag":"7a73b8f209294b3804ad1dee739f35aa","lastannounced":null,"lastseen":"2021-12-16T20:14Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch (2)","state":{"buttonevent":2002,"lastupdated":"2021-12-16T20:14:11.247"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7e-02-0006"}

The remote seems to exposed using two ZHASwitch resources, one for each endpoint? I thought we settled on combining all endpoints into a single resource, cf. e.g. the ubisys?

Smanar commented 2 years ago

Maybe the team can add it to a future release so its compatible for anyone buying in future?

The core is changing ATM, we will use soon a way to support device.

The remote seems to exposed using two ZHASwitch resources, one for each endpoint? I thought we settled on combining all endpoints into a single resource, cf. e.g. the ubisys?

Ha yes right, like for all battery switch. But If I remember it need to be

                             manufacturer == QLatin1String("_TZ3000_a7ouggvs"))
                    {
                        //Making the device only for endpoint 0x01
                        if (i->endpoint() == 0x01)
                        {
                            fpSwitch.inClusters.push_back(ci->id());
                        }
                    }

Perhaps the device is not on this check ?

julunde commented 2 years ago

Perhaps the device is not on this check ?

I'm not sure if that was my doing when trying to get it to work, but I all I did was add the device ID _TZ3000_i3rjdrwu to the 3 three statements containing sensorNode->manufacturer lightNode.manufacturer and manufacturer for Tuya devices.

github-actions[bot] commented 2 years ago

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.

julunde commented 2 years ago

Maybe the team can add it to a future release so its compatible for anyone buying in future?

The core is changing ATM, we will use soon a way to support device.

The remote seems to exposed using two ZHASwitch resources, one for each endpoint? I thought we settled on combining all endpoints into a single resource, cf. e.g. the ubisys?

Ha yes right, like for all battery switch. But If I remember it need to be

                             manufacturer == QLatin1String("_TZ3000_a7ouggvs"))
                    {
                        //Making the device only for endpoint 0x01
                        if (i->endpoint() == 0x01)
                        {
                            fpSwitch.inClusters.push_back(ci->id());
                        }
                    }

Perhaps the device is not on this check ?

@Smanar - Just for your info, I got 2 more switches and upon further testing it seems that DeConz/Phoscon creates an endpoint per switch if you add -> delete-> re-add a switches without first deleting it in the device manager on the webapp. If you pair them first time, it will use a 01 endpoint for both buttons and differentiate buttons based on the event IDs (as expected).

Smanar commented 2 years ago

Hu ? So new inclusion > 2 uniqueID with 0x01 ? 2 inclusions > 1 uniqueID by endpoint ?

But you need to have only 1 entry in the API, no 2 ?

julunde commented 2 years ago

If you re-pair the device without removing it from Phoscon, you get the following:

Endpoint for single press on button 1: 8c:f6:81:ff:fe:91:0b:7e-01-0006 and "buttonevent":1002
Endpoint for single press on button 2: 8c:f6:81:ff:fe:91:0b:7e-02-0006 and "buttonevent":2002

Two endpoints, and two button events.

If you add the device new, or remove it from Phoscon and then re-pair it, you get the following:

Endpoint for single press on button 1: 8c:f6:81:ff:fe:91:0b:7e-01-0006 and "buttonevent":1002
Endpoint for single press on button 2: 8c:f6:81:ff:fe:91:0b:7e-01-0006 and "buttonevent":2002

One endpoint, and two button events. 
Smanar commented 2 years ago

Ha ? funny, and you have added your device in this code part (in the check list)

                             manufacturer == QLatin1String("_TZ3000_a7ouggvs"))
                    {
                        //Making the device only for endpoint 0x01
                        if (i->endpoint() == 0x01)
                        {
                            fpSwitch.inClusters.push_back(ci->id());
                        }
                    }
github-actions[bot] commented 2 years ago

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[bot] commented 2 years ago

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.