JohanBendz / com.tuya.zigbee

MIT License
68 stars 127 forks source link

Bug report - device _TZ3000_ja5osu5g does not work with smart_remote_1_button_2 #1026

Open WJGvdVelden opened 6 days ago

WJGvdVelden commented 6 days ago

Describe the bug

_TZ3000_ja5osu5g (modelId: "TS004F", product ZG-101ZE) is defined in smart_remote_1_button_2, but does not work. This model has 1-click, 2-clicks and longPress capability. The coding picks up no trigger or the wrong one.

To Reproduce

The console output for this device is as follows: ==for 1-click== 2024-11-19T19:09:05.423Z zigbee-clusters:cluster ep: 1, cl: onOff (6) read attributes result { attributes: <Buffer 00 00 00 10 01> } 2024-11-19T19:09:05.424Z [log] [ManagerDrivers] [Driver:plug] [Device:3b973d6c-af9e-4679-9952-82bf92e0598d] handle report (cluster: onOff, capability: onoff), parsed payload: true 2024-11-19T19:09:05.425Z [log] [ManagerDrivers] [Driver:plug] [Device:3b973d6c-af9e-4679-9952-82bf92e0598d] get → onoff → read attribute (cluster: onOff, attributeId: onOff, endpoint: 1) → parsed result true 2024-11-19T19:09:10.912Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] endpointId: 1 , clusterId: 6 , frame: <Buffer 11 6b fd 00> , meta: { transId: 0, linkQuality: 31, dstEndpoint: 1, timestamp: 2105062 } 2024-11-19T19:09:10.913Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 107, 253, 0 ] } 2024-11-19T19:09:10.946Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=twoClicks 2024-11-19T19:09:11.162Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] endpointId: 1 , clusterId: 6 , frame: <Buffer 11 6c 02> , meta: { transId: 0, linkQuality: 31, dstEndpoint: 1, timestamp: 2105842 } 2024-11-19T19:09:11.162Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 108, 2 ] } 2024-11-19T19:09:11.174Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=twoClicks

==for 2-clicks== 2024-11-19T19:09:15.234Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] endpointId: 1 , clusterId: 6 , frame: <Buffer 11 6d fd 01> , meta: { transId: 0, linkQuality: 28, dstEndpoint: 1, timestamp: 2118561 } 2024-11-19T19:09:15.238Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 109, 253, 1 ] } 2024-11-19T19:09:15.253Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=twoClicks 2024-11-19T19:09:15.537Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] endpointId: 1 , clusterId: 6 , frame: <Buffer 11 6e 01> , meta: { transId: 0, linkQuality: 31, dstEndpoint: 1, timestamp: 2119335 } 2024-11-19T19:09:15.538Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 110, 1 ] } 2024-11-19T19:09:15.558Z [log] [ManagerDrivers] [Driver:wall_switch_1_gang] [Device:7ef1dd6f-0f02-4af9-97d0-e0d6b675ae37] set onoff → false (cluster: onOff, endpoint: 1) 2024-11-19T19:09:15.563Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=oneClick

==for longPress== 2024-11-19T19:10:10.844Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 111, 253, 2 ] } 2024-11-19T19:10:10.863Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=twoClicks 2024-11-19T19:10:11.089Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] endpointId: 1 , clusterId: 6 , frame: <Buffer 11 70 00> , meta: { transId: 0, linkQuality: 31, dstEndpoint: 1, timestamp: 2293126 } 2024-11-19T19:10:11.090Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Frame JSON data: { type: 'Buffer', data: [ 17, 112, 0 ] } 2024-11-19T19:10:11.101Z [log] [ManagerDrivers] [Driver:smart_remote_1_button_2] [Device:1f141fa0-e180-4fa7-b117-add4e078305e] Triggered 1 button Smart Remote, action=twoClicks

The second set of signals messes up the result. For solution: With the wall_remote_1_gang driver this is solved with a variable "debounce" to disregard the second set, and the correct frame[3] is used when frame[2] = 253.

Expected behavior

The driver should pick-up the right trigger, ie. 1-click, 2-clicks or longPress. Also a battery indicator would be appreciated.

App and Homey version

  • What Homey version are you running? Homey Pro
  • What version of Homey firmware do you use? 12.2.0
  • What version of the Tuya Zigbee App are you using? The above debug result was based on the driver in version 0.2.73

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Please also see issue #1011. Not sure if the person uses the test version. The most simple way to solve it is to copy the (drivers/wall_remote_1_gang) and add the longPress as solved in the (drivers/wall_remote_2_gang). Works fine with me. As this is a different device (it's round and not a square with rounded edges) I've added an icon and pictures which are more correct.

As always, thanks and have a nice day.

Add any other context about the problem here. icon

large small

WJGvdVelden commented 5 days ago

icon Sorry, wrong icon. This one is more accurate. I will also update the current driver and make a pull-request after I've tested it thoroughly.