zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support] TS0601 from _TZE284_3mzb0sdz

Open segadora opened this issue 1 year ago • 27 comments

Link

https://www.aliexpress.com/item/1005009983470699.html?spm=a2g0o.order_list.order_list_main.5.34241802ooRK6a

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

Details

zigbee-herdsman-converters: 25.35.1 software_build_id: undefined date_code: `` endpoints:

{"1":{"bindings":[],"clusters":{"input":["genGroups","genScenes","manuSpecificTuya","genBasic","zosungIRTransmit"],"output":["genOta","genTime"]},"configured_reportings":[],"scenes":[]}}

External definition:



export default {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE284_3mzb0sdz',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

segadora avatar Oct 15 '25 07:10 segadora

🙏 Thank you for creating this issue and sharing your external converter!

In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.

If NOT all features work, please follow the How To Support new devices Since this is a Tuya also consider How To Support new Tuya devices

If you need help with the process, feel free to ask here and we'll be happy to assist.

github-actions[bot] avatar Oct 16 '25 22:10 github-actions[bot]

I have brought a tuya hub and will look to integrate it

segadora avatar Oct 18 '25 17:10 segadora

I just purchased a Zemismart ZM16B tubular motor for my blinds and would like help on this also

33doodles avatar Oct 22 '25 06:10 33doodles

@33espressooo i have a solution to take them up and down, but I can’t test, because I can’t set limits without remote. If you have them already, I can share the code

segadora avatar Oct 22 '25 06:10 segadora

I've already got it working by following this https://github.com/Koenkk/zigbee2mqtt/issues/28796#issuecomment-3393086374

Hoping we can get official support for this tubular motor.

I have a remote so was able to set limits.

Pretty sure I've seen posts where people have been able to set limits via Zigbee2mqtt

33doodles avatar Oct 22 '25 06:10 33doodles

@33espressooo i have a solution to take them up and down, but I can’t test, because I can’t set limits without remote. If you have them already, I can share the code

Actually it's misbehaving and not showing it's correct state even though it can be controlled.

When it's closed, HA says it's 1% open. When it's 100% open, HA reports it's closed. Open, close and stop all work.

What was the code you used?

33doodles avatar Oct 22 '25 07:10 33doodles

@33espressooo i have a solution to take them up and down, but I can’t test, because I can’t set limits without remote. If you have them already, I can share the code

Actually it's misbehaving and not showing it's correct state even though it can be controlled.

When it's closed, HA says it's 1% open. When it's 100% open, HA reports it's closed. Open, close and stop all work.

What was the code you used?

I only have code to open and close, same as you. I have ordered a tuya hub to get the correct states and should have a solution within a month

segadora avatar Oct 22 '25 08:10 segadora

Hi just bought the same motor and having the same problem :( But I have an Zemismart hub and I've aded it to Tuya app, so if I can help with anything to fix support for this version please let me know. I'm no coder or programer but maybe with some help I can do it.

Bogdis avatar Oct 24 '25 13:10 Bogdis

Could you try to:

  • Stop Z2M
  • Open data/database.db with a text editor and change all occurrences of _TZE284_3mzb0sdz to _TZE204_a2jcoyuk
  • Start Z2M and see if the device now works
  • If it doesn't work, try the manufacturer name from any of the other TS0601_cover_* definitions

Koenkk avatar Oct 24 '25 20:10 Koenkk

Could you try to:

  • Stop Z2M
  • Open data/database.db with a text editor and change all occurrences of _TZE284_3mzb0sdz to _TZE204_a2jcoyuk
  • Start Z2M and see if the device now works
  • If it doesn't work, try the manufacturer name from any of the other TS0601_cover_* definitions

Hi, I've tried a few none work properly but the open, close and stop work, I've used this one _TZE200_68nvbio9 the same like my other motors [ZM16EL-03/33] that worked perfectly in HA. The slider or percentage, reversing the motor doesn't work, setting down and upp limit seems to work but not deleting the limits. Haven't tested that much yet.

Bogdis avatar Oct 24 '25 22:10 Bogdis

Here is working external converter, please test and verify and I will create a pr

import {access, presets, options} from "zigbee-herdsman-converters/lib/exposes";
import * as tuya from "zigbee-herdsman-converters/lib/tuya";
import * as legacy from "zigbee-herdsman-converters/lib/legacy";

export default {
"description": "Tubular motor",
    "model": "ZM16B",
    "options": [],
    "source": "generated",
    "supports_ota": false,
    "vendor": "Zemismart",
        "fingerprint": tuya.fingerprint("TS0601", ["_TZE284_3mzb0sdz"]),
        whiteLabel: [tuya.whitelabel("Zemismart", "ZM16B", "Tubular motor", ["_TZE284_3mzb0sdz"])],
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,
    options: [options.invert_cover()],
    exposes: [
        presets.cover_position().setAccess("position", access.STATE_SET),
        presets.enum("motor_direction", access.STATE_SET, ["forward", "back"]).withDescription("Motor direction"),
        presets.enum("border", access.STATE_SET, ["up", "down", "up_delete", "down_delete", "remove_top_bottom"]).withDescription("Limit setting"),
        //presets.enum("work_state", access.STATE, ["opening", "closing"]).withDescription("Cover state"),
        //presets.numeric("position_best", access.STATE_SET).withValueMin(0).withValueMax(100).withUnit("%").withDescription("Best position"),
presets.battery(),
    ],
    meta: {
        tuyaDatapoints: [
            [1, "state", tuya.valueConverterBasic.lookup({OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2)})],
            [9, 'position', tuya.valueConverter.coverPosition], // Percent control - set position (0-100)
            [8, 'position', tuya.valueConverter.coverPosition], // Percent state - current position (0-100)
            [11, "motor_direction", tuya.valueConverterBasic.lookup({forward: tuya.enum(0), back: tuya.enum(1)})],
            [16, "border", tuya.valueConverterBasic.lookup({up: tuya.enum(0),down: tuya.enum(1), up_delete: tuya.enum(2), down_delete: tuya.enum(3), remove_top_bottom: tuya.enum(4)}),],
[13, 'battery', tuya.valueConverter.raw],
            //[3, "work_state", tuya.valueConverter.raw],
            //[19, "position_best", tuya.valueConverter.raw],
        ],
    },
};

segadora avatar Oct 24 '25 22:10 segadora

LEGENDARY! You mapped out the DPs!

The only change I made to the code was line 31

Changed from coverPositionInverted to coverPosition so it reports for me the correct way around, 100% = fully open, 0% = fully closed

33doodles avatar Oct 24 '25 22:10 33doodles

Here is working external converter, please test and verify and I will create a pr

import {access, presets, options} from "zigbee-herdsman-converters/lib/exposes"; import * as tuya from "zigbee-herdsman-converters/lib/tuya"; import * as legacy from "zigbee-herdsman-converters/lib/legacy";

export default { "description": "Tubular motor", "model": "ZM16B", "options": [], "source": "generated", "supports_ota": false, "vendor": "Zemismart", "fingerprint": tuya.fingerprint("TS0601", ["_TZE284_3mzb0sdz"]), whiteLabel: [tuya.whitelabel("Zemismart", "ZM16B", "Tubular motor", ["_TZE284_3mzb0sdz"])], fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, options: [options.invert_cover()], exposes: [ presets.cover_position().setAccess("position", access.STATE_SET), presets.enum("motor_direction", access.STATE_SET, ["forward", "back"]).withDescription("Motor direction"), presets.enum("border", access.STATE_SET, ["up", "down", "up_delete", "down_delete", "remove_top_bottom"]).withDescription("Limit setting"), //presets.enum("work_state", access.STATE, ["opening", "closing"]).withDescription("Cover state"), //presets.numeric("position_best", access.STATE_SET).withValueMin(0).withValueMax(100).withUnit("%").withDescription("Best position"), presets.battery(), ], meta: { tuyaDatapoints: [ [1, "state", tuya.valueConverterBasic.lookup({OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2)})], [9, 'position', tuya.valueConverter.coverPosition], // Percent control - set position (0-100) [8, 'position', tuya.valueConverter.coverPositionInverted], // Percent state - current position (0-100) [11, "motor_direction", tuya.valueConverterBasic.lookup({forward: tuya.enum(0), back: tuya.enum(1)})], [16, "border", tuya.valueConverterBasic.lookup({up: tuya.enum(0),down: tuya.enum(1), up_delete: tuya.enum(2), down_delete: tuya.enum(3), remove_top_bottom: tuya.enum(4)}),], [13, 'battery', tuya.valueConverter.raw], //[3, "work_state", tuya.valueConverter.raw], //[19, "position_best", tuya.valueConverter.raw], ], }, };

Wow nice thank you very mutch. Seems to work great, only thing that dosent seem to work is battery status but it also says It may take up to 24h.

Bogdis avatar Oct 25 '25 12:10 Bogdis

LEGENDARY! You mapped out the DPs!

The only change I made to the code was line 31

Changed from coverPositionInverted to coverPosition so it reports for me the correct way around, 100% = fully open, 0% = fully closed

You are correct, the PR will reflect this

segadora avatar Oct 26 '25 09:10 segadora

Here is working external converter, please test and verify and I will create a pr import {access, presets, options} from "zigbee-herdsman-converters/lib/exposes"; import * as tuya from "zigbee-herdsman-converters/lib/tuya"; import * as legacy from "zigbee-herdsman-converters/lib/legacy"; export default { "description": "Tubular motor", "model": "ZM16B", "options": [], "source": "generated", "supports_ota": false, "vendor": "Zemismart", "fingerprint": tuya.fingerprint("TS0601", ["_TZE284_3mzb0sdz"]), whiteLabel: [tuya.whitelabel("Zemismart", "ZM16B", "Tubular motor", ["_TZE284_3mzb0sdz"])], fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, options: [options.invert_cover()], exposes: [ presets.cover_position().setAccess("position", access.STATE_SET), presets.enum("motor_direction", access.STATE_SET, ["forward", "back"]).withDescription("Motor direction"), presets.enum("border", access.STATE_SET, ["up", "down", "up_delete", "down_delete", "remove_top_bottom"]).withDescription("Limit setting"), //presets.enum("work_state", access.STATE, ["opening", "closing"]).withDescription("Cover state"), //presets.numeric("position_best", access.STATE_SET).withValueMin(0).withValueMax(100).withUnit("%").withDescription("Best position"), presets.battery(), ], meta: { tuyaDatapoints: [ [1, "state", tuya.valueConverterBasic.lookup({OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2)})], [9, 'position', tuya.valueConverter.coverPosition], // Percent control - set position (0-100) [8, 'position', tuya.valueConverter.coverPositionInverted], // Percent state - current position (0-100) [11, "motor_direction", tuya.valueConverterBasic.lookup({forward: tuya.enum(0), back: tuya.enum(1)})], [16, "border", tuya.valueConverterBasic.lookup({up: tuya.enum(0),down: tuya.enum(1), up_delete: tuya.enum(2), down_delete: tuya.enum(3), remove_top_bottom: tuya.enum(4)}),], [13, 'battery', tuya.valueConverter.raw], //[3, "work_state", tuya.valueConverter.raw], //[19, "position_best", tuya.valueConverter.raw], ], }, };

Wow nice thank you very mutch. Seems to work great, only thing that dosent seem to work is battery status but it also says It may take up to 24h.

Battery status reflects instantly for me

33doodles avatar Oct 26 '25 10:10 33doodles

Official support has been added in 25.54.0

segadora avatar Oct 27 '25 07:10 segadora

@33espresooo Mine won’t show battery still 🙁

Bogdis avatar Oct 27 '25 11:10 Bogdis

@33espresooo Mine won’t show battery still 🙁

@Bogdis in the Tuya app you can toggle if it should show battery, maybe you need to click this toggle? Mine is reporting battery fine

segadora avatar Oct 27 '25 12:10 segadora

@segadora I have removed it from the tuya app, I will try to add it again and se.

Edit: Added to Tuya app and turned on battery status and then added it back to z2m but still no battery status 😞 Even updated to Edge to get the latest 25.54.0 and removed it from z2m and then added it back again and still ´null´

2025-10-27 14:59:55] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Oscars Fönster Gardin Left', payload '{"battery":null,"border":null,"linkquality":184,"motor_direction":null,"position":100,"state":"STOP"}'

Tried everything I can come up with and still no battery status, even factory reset of the device 😞

Bogdis avatar Oct 27 '25 12:10 Bogdis

@33espresooo Mine won’t show battery still 🙁

@Bogdis in the Tuya app you can toggle if it should show battery, maybe you need to click this toggle? Mine is reporting battery fine

I never had to use the Tuya app.

@segadora I have removed it from the tuya app, I will try to add it again and se.

Edit: Added to Tuya app and turned on battery status and then added it back to z2m but still no battery status 😞 Even updated to Edge to get the latest 25.54.0 and removed it from z2m and then added it back again and still ´null´

2025-10-27 14:59:55] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Oscars Fönster Gardin Left', payload '{"battery":null,"border":null,"linkquality":184,"motor_direction":null,"position":100,"state":"STOP"}'

Tried everything I can come up with and still no battery status, even factory reset of the device 😞

Are you sure you have ZM16B motor?

33doodles avatar Oct 27 '25 20:10 33doodles