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

Zemismart ZM-CSW002-D (TS0302) #621

Closed
xerxes-at opened this issue Sep 18, 2019 · 6 comments
Closed

Zemismart ZM-CSW002-D (TS0302) #621

xerxes-at opened this issue Sep 18, 2019 · 6 comments

Comments

@xerxes-at
Copy link
Contributor

Apparently there are multiple versions of Zemismart ZM-CSW002-D switches, while TS0002 only has a on/off state the TS0302 is a curtain / roller blind switch. While setting up the correct converters for fromZigbee is well documented I can't seem to fully understand how to get the correct format I have to send for toZigbee.
As far as I do understand it is that the clusters in the DB are the functions reported by the device and dir 1 = fromZigbee and dir 2 = toZigbee but I can't figure out what payload to send as there are not attributes. Also I'm not sure if the configure and ep elements are necessary.

{
        zigbeeModel: ['TS0302'],
        model: 'ZM-CSW032-D',
        vendor: 'Zemismart',
        description: 'Curtain // Roller blind switch',
        supports: 'open, close, stop',
        fromZigbee: [fz.ignore_basic_report, fz.closuresWindowCovering_report, fz.ignore_closuresWindowCovering_change],
        toZigbee: [],
        ep: (device) => {
            return {'l1': 1, 'l2': 2};
        },
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
            const device = shepherd.find(ieeeAddr, 1);
            const actions = [
                (cb) => device.bind('genOnOff', coordinator, cb),
                (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            ];

            execute(device, actions, callback);
        }
    }

Database:

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0007687077","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,11],"status":"online","joinTime":1568828126,"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"11":{"profId":260,"epId":11,"devId":1024,"inClusterList":[],"outClusterList":[1280],"clusters":{"ssIasZone":{"dir":{"value":2},"cmdRsps":{"enrollReq":{"exec":"_exec_"},"statusChangeNotification":{"exec":"_exec_"}}}}}},"_id":"jCKwROh6U4L9QrLN"}
{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0007687077","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1568828472,"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}}},"_id":"jCKwROh6U4L9QrLN"}
{"id":2,"type":"Router","ieeeAddr":"0x14b457fffe24f47e","nwkAddr":22993,"manufId":4098,"manufName":"_TYZB01_dazsid15","powerSource":"Mains (single phase)","modelId":"TS0302","epList":[1],"zclVersion":3,"appVersion":65,"stackVersion":0,"hwVersion":1,"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":514,"inClusterList":[0,4,5,258],"outClusterList":[25],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{"65504":null,"65505":null,"65506":19,"65507":null,"65533":1,"65534":0,"zclVersion":3,"appVersion":65,"stackVersion":0,"hwVersion":1,"manufacturerName":"_TYZB01_dazsid15","modelId":"TS0302","dateCode":"","powerSource":1}},"genGroups":{"dir":{"value":1},"attrs":{"65533":1,"nameSupport":0}},"genScenes":{"dir":{"value":1},"attrs":{"65533":1,"count":0,"currentScene":0,"currentGroup":0,"sceneValid":0,"nameSupport":0}},"genOta":{"dir":{"value":2},"attrs":{}},"closuresWindowCovering":{"dir":{"value":1},"attrs":{"currentPositionLiftPercentage":255,"currentPositionTiltPercentage":0}}}}},"dateCode":"","_id":"5W6YvLCCuia0uVFL"}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0007687077","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,11],"status":"online","joinTime":1568828472,"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"11":{"profId":260,"epId":11,"devId":1024,"inClusterList":[],"outClusterList":[1280],"clusters":{"ssIasZone":{"dir":{"value":2},"cmdRsps":{"enrollReq":{"exec":"_exec_"},"statusChangeNotification":{"exec":"_exec_"}}}}}},"_id":"jCKwROh6U4L9QrLN"}

https://www.zemismart.com/zigbee-eu-curtain-wall-light-switch-compatible-with-smartthing-hub-echo-plus-app-phone-voice-control-p0202-p0202.html (I bought mine on AliExpress)

@Koenkk
Copy link
Owner

Koenkk commented Sep 20, 2019

You can try the toZigbee converters of a toZigbee converter https://github.com/Koenkk/zigbee-shepherd-converters/blob/master/devices.js#L3539.

It should then work with zigbee2mqtt/[DEVICE_ID]/set {"state": "OPEN"} (and CLOSE)

@xerxes-at
Copy link
Contributor Author

tz.cover_control worked for me.
It supports OPEN, CLOSE and STOP. Which are as far as I know everything the switch can.
The reported position of the Switch always seems to be either 100, 50 or 0.

What would I have to do to see if ep and config are necessary with that device? Just remove them and restart zigbee2mqtt?

@Koenkk
Copy link
Owner

Koenkk commented Sep 21, 2019

Yes, remove it and check if controlling still works.

@xerxes-at
Copy link
Contributor Author

The device seems to work fine with this config, I did not test re-pairing it.

{
        zigbeeModel: ['TS0302'],
        model: 'ZM-CSW032-D',
        vendor: 'Zemismart',
        description: 'Curtain // Roller blind switch',
        supports: 'open, close, stop',
        fromZigbee: [fz.ignore_basic_report, fz.closuresWindowCovering_report, fz.ignore_closuresWindowCovering_change],
        toZigbee: [ tz.cover_control]
}

@Koenkk
Copy link
Owner

Koenkk commented Oct 13, 2019

Great, can you make a pr?

@xerxes-at
Copy link
Contributor Author

Sure, #684

@Koenkk Koenkk closed this as completed Oct 14, 2019
xmow49 pushed a commit to xmow49/zigbee-herdsman-converters that referenced this issue Jun 14, 2024
Co-authored-by: Koenkk <Koenkk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants