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]: Roller Shade Motor ZM25R1 - Zemismart #19605

Closed
gregolin opened this issue Nov 6, 2023 · 5 comments
Closed

[New device support]: Roller Shade Motor ZM25R1 - Zemismart #19605

gregolin opened this issue Nov 6, 2023 · 5 comments
Labels
new device support New device support request

Comments

@gregolin
Copy link

gregolin commented Nov 6, 2023

Link

https://www.zemismart.com/products/zm25r1

Database entry

{"id":47,"type":"Router","ieeeAddr":"0x142d41fffe1b39d1","nwkAddr":41770,"manufId":4098,"manufName":"_TZE200_1vxgqfba","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,61184],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS0601","manufacturerName":"_TZE200_1vxgqfba","stackVersion":0,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":83,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1699306161967,"defaultSendRequestWhen":"immediate"}

Comments

I've tried to use another external converter (for ex: https://www.zigbee2mqtt.io/devices/ZM25RX-08_30.html), but no success yet (I don't have experience with new external converters, so it's possible I'm doing some mistake).

External converter

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

const definition = {
    fingerprint: [
        {
        modelID: 'TS0601',
        manufacturerName: '_TZE200_1vxgqfba'
        },
    ],
    model: 'ZM25R1/2',
    vendor: 'Zemismart',
    description: 'Tubular Motor',
    fromZigbee: [legacy.fromZigbee.tuya_cover],
    toZigbee: [legacy.toZigbee.tuya_cover_control, legacy.toZigbee.tuya_cover_options],
    exposes: [e.cover_position().setAccess('position', ea.STATE_SET)],
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

@gregolin gregolin added the new device support New device support request label Nov 6, 2023
@gregolin gregolin changed the title [New device support]: Roller Shade Motor ZM25R1 [New device support]: Roller Shade Motor ZM25R1 - Zemismart Nov 7, 2023
@vinta7
Copy link

vinta7 commented Dec 3, 2023

Hi.

After googling around I created this working external converter, hope you can use it.

Regards

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

const tzDatapoints = {
    ...tuya.tz.datapoints,
    key: [...tuya.tz.datapoints.key, 'upper_stroke_limit', 'middle_stroke_limit', 'lower_stroke_limit']
}

const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE200_1vxgqfba'
},
],
model: 'ZM25R1',
vendor: 'Zemismart',
description: 'Tubular Motor',
fromZigbee: [legacy.fromZigbee.tuya_cover],
toZigbee: [legacy.toZigbee.tuya_cover_control, legacy.toZigbee.tuya_cover_options, tzDatapoints],
exposes: [e.cover_position().setAccess('position', ea.STATE_SET),
          e.enum('upper_stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the upper stroke limit'),
          e.enum('middle__stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the middle stroke limit'),
          e.enum('lower_stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the lower stroke limit'),
],

    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [103, 'upper_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})],
            [104, 'middle_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})],
            [105, 'lower_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})]
        ],
    }
};

module.exports = definition;

@roverell
Copy link

roverell commented Jan 5, 2024

This worked for me! You're a legend, thanks @vinta7, I'd all but given up getting it working.

@Koenkk
Copy link
Owner

Koenkk commented Jan 5, 2024

@vinta7 would you mind making a pull request for out-of-the-box support?

@vinta7
Copy link

vinta7 commented Jan 5, 2024

Thanks for the positive feedback @roverell , there was a small typo "e.enum('middle__stroke_limit'", below is the edited version, I need some help getting this code into the next version of zigbee2mqtt @Koenkk , still a newbie regarding github :-(

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

const tzDatapoints = {
    ...tuya.tz.datapoints,
    key: [...tuya.tz.datapoints.key, 'upper_stroke_limit', 'middle_stroke_limit', 'lower_stroke_limit']
}

const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE200_1vxgqfba'
},
],
model: 'ZM25R1',
vendor: 'Zemismart',
description: 'Tubular Motor',
fromZigbee: [legacy.fromZigbee.tuya_cover],
toZigbee: [legacy.toZigbee.tuya_cover_control, legacy.toZigbee.tuya_cover_options, tzDatapoints],
exposes: [e.cover_position().setAccess('position', ea.STATE_SET),
          e.enum('upper_stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the upper stroke limit'),
          e.enum('middle_stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the middle stroke limit'),
          e.enum('lower_stroke_limit', ea.STATE_SET, ['SET', 'RESET']).withDescription('Reset / Set the lower stroke limit'),
],

    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [103, 'upper_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})],
            [104, 'middle_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})],
            [105, 'lower_stroke_limit', tuya.valueConverterBasic.lookup({'SET': tuya.enum(1), 'RESET': tuya.enum(0)})]
        ],
    }
};

module.exports = definition;

ZM25R1

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

Koenkk commented Jan 5, 2024

@vinta7 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

4 participants