Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.07k stars 1.67k forks source link

[New device support]: Tuya Smart Knob #11207

Closed nygma2004 closed 2 years ago

nygma2004 commented 2 years ago

Link

https://www.aliexpress.com/item/1005003395402995.html

Database entry

{"id":12,"type":"EndDevice","ieeeAddr":"0x84ba20fffe8d63bb","nwkAddr":54947,"manufId":4098,"manufName":"_TZ3000_4fjiwweb","powerSource":"Battery","modelId":"TS004F","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":260,"inClusterList":[0,1,3,4,6,4096],"outClusterList":[25,10,3,4,5,6,8,4096],"clusters":{"genBasic":{"attributes":{"modelId":"TS004F","manufacturerName":"_TZ3000_4fjiwweb","powerSource":3,"zclVersion":3,"appVersion":67,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":67,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1643896782672,"useImplicitCheckin":true}

Comments

I tried to add the different commands to the FromZigbee attribute, but I guess I did the list incorrectly, so my Zigbee2mqtt fails to start now. See my try with the external converter below.

But I think I have all the event from the debug screen:

Single click

Feb 03 14:47:23 NodeRedServer npm[40743]: Zigbee2MQTT:debug 2022-02-03 14:47:23: Received Zigbee message from '0x84ba20fffe8d63bb', type 'commandToggle', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0

CV rotate

Feb 03 14:49:34 NodeRedServer npm[40743]: Zigbee2MQTT:debug 2022-02-03 14:49:34: Received Zigbee message from '0x84ba20fffe8d63bb', type 'commandStep', cluster 'genLevelCtrl', data '{"stepmode":0,"stepsize":13,"transtime":1}' from endpoint 1 with groupID 0

I noticed here, that the stepsize changes from 13 to >100. The higher the number, the fast I rotate the knob. The transtime always appears to remain 1. Also the stepmode is 0 for CV rotation, and 1 for CCV rotation

Press and rotate

Feb 03 14:52:46 NodeRedServer npm[40743]: Zigbee2MQTT:debug 2022-02-03 14:52:46: Received Zigbee message from '0x84ba20fffe8d63bb', type 'commandStepColorTemp', cluster 'lightingColorCtrl', data '{"maximum":500,"minimum":153,"stepmode":3,"stepsize":18,"transtime":1}' from endpoint 1 with groupID 0

Here the stepmode changes between 3 and 1, 3 for CV rotation and 1 for CCV rotation. Stepsize is the rotation speed just like above. The other values do not appear to change at all.

Double Click

I am not seeing any data for double click, although the listing says that double click is supported

Long Press

I get the below message after long press. It is always a single message. I don't understand why it has a data segment as well:

Feb 03 14:58:12 NodeRedServer npm[40743]: Zigbee2MQTT:debug 2022-02-03 14:58:12: Received Zigbee message from '0x84ba20fffe8d63bb', type 'commandMoveHue', cluster 'lightingColorCtrl', data '{"movemode":1,"rate":15}' from endpoint 1 with groupID 0

External converter

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.sens'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'TS004F', // Vendor model number, look on the device for a model number
    vendor: '_TZ3000_4fjiwweb', // Vendor of the device (only used for documentation and startup logging)
    description: 'Tuya Smart Knob', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [fz.commandToggle, fz.commandStep, fz.commandStepColorTemp, fz.commandMoveHue],  // We will add this later
    toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
    exposes: [e.battery(), e.temperature(), e.humidity()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

nygma2004 commented 2 years ago

To be honest it looks very similar to an already supported product: TuYa ERS-10TZBVK-AA

nygma2004 commented 2 years ago

Sorry guys, I updated to the latest of the version and now it is recognized as ERS-10TZBVK-AA.