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]: Tuya Curtain Motor (_TZE204_xu4a5rhj) #22614

Closed
FliesWithWind opened this issue May 13, 2024 · 2 comments
Closed

[New device support]: Tuya Curtain Motor (_TZE204_xu4a5rhj) #22614

FliesWithWind opened this issue May 13, 2024 · 2 comments
Labels
new device support New device support request

Comments

@FliesWithWind
Copy link

Link

https://www.aliexpress.us/item/3256805121866593.html?spm=a2g0o.order_list.order_list_main.17.23ff1c24xgAcbe&gatewayAdapt=glo2usa4itemAdapt

Database entry

{ "id": 5, "type": "Router", "ieeeAddr": "0xa4c138510ab3d6d0", "nwkAddr": 24621, "manufId": 4417, "manufName": "_TZE204_xu4a5rhj", "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": { "stackVersion": 0, "dateCode": "" } } }, "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": 1715600001520 }

Comments

Tuya curtain motor that seems to be similar to #17506 and #17518

I've tried to get it to work using a converter but failed so far since I'm still getting familiar with zigbee2mqtt.

External definition

const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE204_xu4a5rhj',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

module.exports = definition;
@FliesWithWind FliesWithWind added the new device support New device support request label May 13, 2024
@FliesWithWind FliesWithWind changed the title [New device support]: [New device support]: Tuya Curtain Motor (_TZE204_xu4a5rhj) May 13, 2024
@FliesWithWind
Copy link
Author

FliesWithWind commented May 13, 2024

I guess it works under TS0601_cover_1

const legacy = require('zigbee-herdsman-converters/lib/legacy');
const fz = {...require('zigbee-herdsman-converters/converters/fromZigbee'), legacy: require('zigbee-herdsman-converters/lib/legacy').fromZigbee};
const tz = {...require('zigbee-herdsman-converters/converters/toZigbee'), legacy: require('zigbee-herdsman-converters/lib/legacy').toZigbee};
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
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 e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [
        {modelID: 'TS0601', manufacturerName: '_TZE204_xu4a5rhj'},
    ],
    model: 'TS0601_cover_1',
    vendor: 'TuYa',
    description: 'Curtain motor/roller blind motor/window pusher/tubular motor',
    fromZigbee: [legacy.fromZigbee.tuya_cover, fz.ignore_basic_report],
    toZigbee: [legacy.toZigbee.tuya_cover_control, legacy.toZigbee.tuya_cover_options],
    exposes: [
        e.cover_position().setAccess('position', ea.STATE_SET),
        e.composite('options', 'options', ea.STATE_SET)
            .withFeature(e.numeric('motor_speed', ea.STATE_SET)
                .withValueMin(0).withValueMax(255).withDescription('Motor speed'))
            .withFeature(e.binary('reverse_direction', ea.STATE_SET, true, false)
                .withDescription('Reverse the motor direction'))
    ],
};

module.exports = definition;

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue May 14, 2024
@Koenkk
Copy link
Owner

Koenkk commented May 14, 2024

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