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

MKS-CM-W5 by tuya work only one way #1542

Closed
Ciubas opened this issue Sep 9, 2020 · 8 comments
Closed

MKS-CM-W5 by tuya work only one way #1542

Ciubas opened this issue Sep 9, 2020 · 8 comments

Comments

@Ciubas
Copy link

Ciubas commented Sep 9, 2020

I have this product: https://www.houseiq.pl/pl/p/Przelacznik-2-kanaly-ZigBee-3.0-Bialy-TUYA-seria-EM/914 (2 gang)

On Zigbee2MQTT its working at MKS-CM-W5:
image

Only 2 channels is active, photo is this: https://www.zigbee2mqtt.io/images/devices/MKS-CM-W5.jpg

And work great but only in HA, when I push the physical button, the HA don't show this. On Zigbee2MQTT log dont show any action of that (log is empty), only when I set MQTT:

Zigbee2MQTT:info  2020-09-09 12:17:37: MQTT publish: topic 'zigbee2mqtt/0xec1bbdfffefd6161', payload '{"state_l1":"ON","state_l2":"ON","state_l3":"OFF","state_l4":"OFF"}'
Zigbee2MQTT:info  2020-09-09 12:17:40: MQTT publish: topic 'zigbee2mqtt/0xec1bbdfffefd6161', payload '{"state_l1":"OFF","state_l2":"ON","state_l3":"OFF","state_l4":"OFF"}'

Where find solution for this problem?

@Koenkk
Copy link
Owner

Koenkk commented Sep 9, 2020

Can you change the entry in devices.js to:

{
    zigbeeModel: ['qnazj70'],
    fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_nkjintbl'}],
    model: 'TS0601_switch',
    vendor: 'TuYa',
    description: '1, 2, 3 or 4 gang switch',
    supports: 'on/off',
    fromZigbee: [fz.tuya_switch, fz.ignore_basic_report, fz.tuya_switch2],
    toZigbee: [tz.tuya_switch_state],
    meta: {configureKey: 1, multiEndpoint: true},
    whiteLabel: [
        {vendor: 'Norklmes', model: 'MKS-CM-W5'},
        {vendor: 'Somgoms', model: 'ZSQB-SMB-ZB'},
    ],
    configure: async (device, coordinatorEndpoint) => {
        await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
        await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
    },
    endpoint: (device) => {
        // Endpoint selection is made in tuya_switch_state
        return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
    },
},

See https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html on how to modify devices.js

@SewerynHellak
Copy link
Contributor

Hi,

I checked devices.js with added binded endpoint, now it works on all TS0601 switches without anny issues.
Thanks!

@Koenkk
Copy link
Owner

Koenkk commented Sep 18, 2020

Thanks, implemented.

Changes will be available in the latest dev branch tomorrow (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@Koenkk Koenkk closed this as completed Sep 18, 2020
@Waldi81
Copy link

Waldi81 commented Sep 20, 2020

I have a similar problem...

Device description
I have this product: https://www.houseiq.pl/pl/p/Przelacznik-1-kanal-ZigBee-3.0-Bialy-TUYA-seria-EM/912 (1 gang)
It's model: WS-EUB1-ZG :https://www.moeshouse.com/collections/zigbee-version/products/tuya-zigbee-push-light-switch-zigbee-hub-required-smart-home-automation-wireless-remote-control-work-with-tuya-zigbee-hub-only

Zigbee2mqtt detects it as:
obraz

{'dateCode': '', 'description': '1, 2, 3 or 4 gang switch', 'friendly_name': '0x842e14fffe13d502', 'hardwareVersion': 1, 'ieeeAddr': '0x842e14fffe13d502', 'lastSeen': 1600632592497, 'manufacturerID': 4098, 'manufacturerName': '_TZE200_oisqyl4o', 'model': 'TS0601_switch', 'modelID': 'TS0601', 'networkAddress': 54693, 'powerSource': 'Mains (single phase)', 'type': 'Router', 'vendor': 'TuYa'}], 'type': 'devices'}

but no devices are added.

MQTT messages from device

2020-09-20 22:30:34.962 (z2b) MQTT message: zigbee2mqtt/0x842e14fffe13d502 {'linkquality': 42, 'state_l1': 'OFF', 'undefined': 'OFF'}
2020-09-20 22:30:34.962 (z2b) This plugin does not support zigbee device with model "TS0601_switch" yet
2020-09-20 22:30:34.962 (z2b) If you would like plugin to support this device, please create ticket by this link: https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/issues/new?labels=new+device&template=new-device-support.md
2020-09-20 22:30:36.165 (z2b) MQTT message: zigbee2mqtt/0x842e14fffe13d502 {'linkquality': 47, 'state_l1': 'ON', 'undefined': 'OFF'}
2020-09-20 22:30:36.165 (z2b) This plugin does not support zigbee device with model "TS0601_switch" yet
2020-09-20 22:30:36.165 (z2b) If you would like plugin to support this device, please create ticket by this link: https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/issues/new?labels=new+device&template=new-device-support.md

@SewerynHellak
Copy link
Contributor

You need to add new manufacturer name to related device in devices.js
{modelID: 'TS0601', manufacturerName: '_TZE200_oisqyl4o'}

@Waldi81
Copy link

Waldi81 commented Sep 21, 2020

I did it before writing

    {
        zigbeeModel: ['qnazj70', 'kjintbl'],
        fingerprint: [
            {modelID: 'TS0601', manufacturerName: '_TZE200_nkjintbl'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_wunufsil'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_kyfqmmyl'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_vhy3iakz'},
	    {modelID: 'TS0601', manufacturerName: '_TZE200_oisqyl4o'},
        ],
        model: 'TS0601_switch',
        vendor: 'TuYa',
        description: '1, 2, 3 or 4 gang switch',
        supports: 'on/off',
        fromZigbee: [fz.tuya_switch, fz.ignore_basic_report, fz.tuya_switch2],
        toZigbee: [tz.tuya_switch_state],
        meta: {configureKey: 1, multiEndpoint: true},
        whiteLabel: [
            {vendor: 'Norklmes', model: 'MKS-CM-W5'},
            {vendor: 'Somgoms', model: 'ZSQB-SMB-ZB'},
	    {vendor: 'Moes', model: 'WS-EUB1-ZG'},
			
        ],
        configure: async (device, coordinatorEndpoint) => {
            await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
            if (device.getEndpoint(2)) await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
            if (device.getEndpoint(3)) await bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
            if (device.getEndpoint(4)) await bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
        },
        endpoint: (device) => {
            // Endpoint selection is made in tuya_switch_state
            return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
        },
    },

@Koenkk
Copy link
Owner

Koenkk commented Sep 21, 2020

@Waldi81 check your log, you need to create a ticket:

2020-09-20 22:30:34.962 (z2b) If you would like plugin to support this device, please create ticket by this link: https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/issues/new?labels=new+device&template=new-device-support.md

I will update the devices.js to match your entry

@Waldi81
Copy link

Waldi81 commented Sep 21, 2020

OK

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

4 participants