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

[New device support]: Zigbee Motor Curtain _TZE204_a2jcoyuk #25429

Closed
hsimm opened this issue Jan 3, 2025 · 4 comments
Closed

[New device support]: Zigbee Motor Curtain _TZE204_a2jcoyuk #25429

hsimm opened this issue Jan 3, 2025 · 4 comments
Labels
new device support New device support request

Comments

@hsimm
Copy link

hsimm commented Jan 3, 2025

Link

https://www.aliexpress.com/item/1005007956016252.html?spm=a2g0o.order_list.order_list_main.16.2f9b1802Q9fKoZ

Database entry

{"id":18,"type":"Router","ieeeAddr":"0xa4c1380d9bd7c54f","nwkAddr":636,"manufId":4417,"manufName":"_TZE204_a2jcoyuk","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"��\n/\u0013��\n/e��\n/\u0012\u0003\u0000\u0000\u0000\u0013\u0005\u0000\u0000\u0000e\u0006\u0000\u0000\u0000\u0012#\u0000\u0000\u0000e\u0000\u0000\u0000\u0000g","65506":56,"65508":0,"stackVersion":0,"dateCode":"","appVersion":74}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1736433935321}

Zigbee2MQTT version

1.42.0

Comments

This is the data points investigation outcome through Tuya Gateway:
Based on the new Tuya device instructions:

{"1":"Control","2":"Curtain position setting","3":"Current curtain position","5":"Motor Direction","6":"Auto Power","7":"Work State","11":"Situation_set","12":"Fault"}

image

External definition

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 legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [
        {modelID: 'TS0601', manufacturerName: '_TZE204_a2jcoyuk'}
    ],
    model: 'TS0601_cover_dev',
    vendor: 'Tuya',
    description: 'Curtain motor',
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    exposes: [
        e.cover_position().setAccess('position', ea.STATE_SET),
        e.enum('motor_direction', ea.STATE_SET, ['normal', 'reversed']).withDescription('Set the motor direction'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'control', tuya.valueConverterBasic.lookup({OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2), CONTINUE: tuya.enum(3)})], // <- mapped the datapoint
            [2, 'percent_control', tuya.valueConverter.raw],
            [3, 'percent_state', tuya.valueConverter.coverPosition],
            [5, 'motor_direction', tuya.valueConverterBasic.lookup({forward: true, back: false})],
            [6, 'auto_power', tuya.valueConverter.trueFalse1],
            [7, 'work_state', tuya.valueConverterBasic.lookup({opening: tuya.enum(0), closing: tuya.enum(1)})],
            [11, 'situation_set', tuya.valueConverterBasic.lookup({opened: tuya.enum(0), closed: tuya.enum(1)})],
            [12, 'fault', tuya.valueConverter.raw],
        ],
    },
};

module.exports = definition;

What does/doesn't work with the external definition?

created external definition as ext_converter.js
image

image

device still showing up as unsupported when pairing

logs

[2025-01-10 00:34:02] debug: 	zh:ezsp: Device join request received: 22763 a4c1380d9bd7c54f
[2025-01-10 00:34:02] debug: 	zh:controller: Device '0xa4c1380d9bd7c54f' joined
[2025-01-10 00:34:02] debug: 	zh:controller: Device '0xa4c1380d9bd7c54f' accepted by handler
[2025-01-10 00:34:02] debug: 	zh:controller: Deleted device '0xa4c1380d9bd7c54f' joined, undeleting
[2025-01-10 00:34:02] debug: 	zh:controller:database: Writing database to '/config/zigbee2mqtt/database.db'
[2025-01-10 00:34:02] debug: 	zh:controller: Device '0xa4c1380d9bd7c54f' is already in database with different network address, updating network address
[2025-01-10 00:34:02] debug: 	zh:controller:database: Writing database to '/config/zigbee2mqtt/database.db'
[2025-01-10 00:34:02] info: 	zh:controller: Interview for '0xa4c1380d9bd7c54f' started
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - start device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - skip node descriptor request for '0xa4c1380d9bd7c54f', already got it
[2025-01-10 00:34:02] debug: 	zh:ezsp: ~~~> [ZDO ACTIVE_ENDPOINTS_REQUEST UNICAST to=0xa4c1380d9bd7c54f:22763 payload=20eb58]
[2025-01-10 00:34:02] info: 	z2m: Device '0xa4c1380d9bd7c54f' joined
[2025-01-10 00:34:02] info: 	z2m: Starting interview of '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1380d9bd7c54f","ieee_address":"0xa4c1380d9bd7c54f"},"type":"device_joined"}'
[2025-01-10 00:34:02] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1380d9bd7c54f","ieee_address":"0xa4c1380d9bd7c54f","status":"started"},"type":"device_interview"}'
[2025-01-10 00:34:02] debug: 	zh:controller: Device '0xa4c1380d9bd7c54f' joined
[2025-01-10 00:34:02] debug: 	zh:controller: Device '0xa4c1380d9bd7c54f' accepted by handler
[2025-01-10 00:34:02] debug: 	zh:controller: Not interviewing '0xa4c1380d9bd7c54f', completed 'false', in progress 'true'
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - got active endpoints for device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] debug: 	zh:ezsp: ~~~> [ZDO SIMPLE_DESCRIPTOR_REQUEST UNICAST to=0xa4c1380d9bd7c54f:22763 payload=21eb5801]
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - got simple descriptor for endpoint '1' device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] debug: 	zh:controller:endpoint: ZCL command 0xa4c1380d9bd7c54f/1 genBasic.read(["stackVersion"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false,"sendPolicy":"immediate"})
[2025-01-10 00:34:02] debug: 	zh:ezsp: sendZclFrameToEndpointInternal 0xa4c1380d9bd7c54f:22763/1 (0,0,1), timeout=10000
[2025-01-10 00:34:02] debug: 	z2m: Received Zigbee message from '0xa4c1380d9bd7c54f', type 'readResponse', cluster 'genBasic', data '{"stackVersion":0}' from endpoint 1 with groupID 0
[2025-01-10 00:34:02] debug: 	z2m: Skipping message, still interviewing
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - got 'stackVersion' for device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] debug: 	zh:controller:endpoint: ZCL command 0xa4c1380d9bd7c54f/1 genBasic.read(["dateCode"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false,"sendPolicy":"immediate"})
[2025-01-10 00:34:02] debug: 	zh:ezsp: sendZclFrameToEndpointInternal 0xa4c1380d9bd7c54f:22763/1 (0,0,1), timeout=10000
[2025-01-10 00:34:02] debug: 	z2m: Received Zigbee message from '0xa4c1380d9bd7c54f', type 'readResponse', cluster 'genBasic', data '{"dateCode":""}' from endpoint 1 with groupID 0
[2025-01-10 00:34:02] debug: 	z2m: Skipping message, still interviewing
[2025-01-10 00:34:02] debug: 	zh:controller:device: Interview - got 'dateCode' for device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:02] debug: 	zh:controller:endpoint: ZCL command 0xa4c1380d9bd7c54f/1 genBasic.read(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false,"sendPolicy":"immediate"})
[2025-01-10 00:34:02] debug: 	zh:ezsp: sendZclFrameToEndpointInternal 0xa4c1380d9bd7c54f:22763/1 (0,0,1), timeout=10000
[2025-01-10 00:34:02] debug: 	z2m: Received Zigbee message from '0xa4c1380d9bd7c54f', type 'readResponse', cluster 'genBasic', data '{}' from endpoint 1 with groupID 0
[2025-01-10 00:34:02] debug: 	z2m: Skipping message, still interviewing
[2025-01-10 00:34:03] debug: 	zh:controller:endpoint: Error: ZCL command 0xa4c1380d9bd7c54f/1 genBasic.read(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false,"sendPolicy":"immediate"}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.checkStatus (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:349:28)
    at Endpoint.zclCommand (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:954:26)
    at Endpoint.read (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29)
    at Device.interviewInternal (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/model/device.ts:933:42)
    at Device.interview (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/model/device.ts:750:13)
    at Controller.onDeviceJoined (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/controller.ts:731:17)
[2025-01-10 00:34:03] debug: 	zh:controller:device: Interview - failed to read attribute 'softwareBuildID' from endpoint '1' (Error: ZCL command 0xa4c1380d9bd7c54f/1 genBasic.read(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false,"sendPolicy":"immediate"}) failed (Status 'UNSUPPORTED_ATTRIBUTE'))
[2025-01-10 00:34:03] debug: 	zh:ezsp: ~~~> [ZDO SIMPLE_DESCRIPTOR_REQUEST UNICAST to=0xa4c1380d9bd7c54f:22763 payload=25eb58f2]
[2025-01-10 00:34:03] debug: 	zh:controller:device: Interview - got simple descriptor for endpoint '242' device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:03] debug: 	zh:controller:device: Interview - completed for device '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:03] debug: 	zh:controller:database: Writing database to '/config/zigbee2mqtt/database.db'
[2025-01-10 00:34:03] info: 	zh:controller: Succesfully interviewed '0xa4c1380d9bd7c54f'
[2025-01-10 00:34:03] info: 	z2m: Successfully interviewed '0xa4c1380d9bd7c54f', device has successfully been paired
[2025-01-10 00:34:03] warning: 	z2m: Device '0xa4c1380d9bd7c54f' with Zigbee model 'TS0601' and manufacturer name '_TZE204_a2jcoyuk' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
[2025-01-10 00:34:03] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1380d9bd7c54f","ieee_address":"0xa4c1380d9bd7c54f","status":"successful","supported":false},"type":"device_interview"}'

@hsimm hsimm added the new device support New device support request label Jan 3, 2025
@hsimm
Copy link
Author

hsimm commented Jan 9, 2025

@Koenkk are you able to assist here?

@Koenkk
Copy link
Owner

Koenkk commented Jan 9, 2025

Could you try to:

  • Stop Z2M
  • Open data/database.db with a text editor and change all occurrences of _TZE204_a2jcoyuk to _TZE284_udank5zs
  • Start Z2M and see if the device now works

@hsimm
Copy link
Author

hsimm commented Jan 10, 2025

Thanks @Koenkk , it's working now!
image

@Koenkk
Copy link
Owner

Koenkk commented Jan 10, 2025

Added!

Changes will be available in the dev branch in a few hours from now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request
Projects
None yet
Development

No branches or pull requests

2 participants