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

ZG-DS112L - Lonsonho L+N switches are incorectly identyfied as TS0011, TS0012, TS0013 #4886

Closed
klami85 opened this issue Nov 6, 2020 · 6 comments
Labels
problem Something isn't working stale Stale issues

Comments

@klami85
Copy link

klami85 commented Nov 6, 2020

What happened

I have 16 Lonsonho Tuya Zigbee Smart switches with Live+Neutral wires. All variants: 1 Gang, 2 Gangs, 3 Gangs.
Interrior/exterrior photos of 1 Gang version here: https://abload.de/img/switchxmjr2.jpg
2 and 3 gang versions looks the same - just more components soldered.
They are identyfied as TS0011, TS0012, TS0013 (no neutral wire, end device).
Switches work fine except:

form database.db:

{"id":8,"type":"EndDevice","ieeeAddr":"0xec1bbdfffedf63b5","nwkAddr":9423,"manufId":4098,"manufName":"_TYZB01_qeqvmvti","powerSource":"Battery","modelId":"TS0011","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":256,"inClusterList":[0,4,5,6],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"65506":19,"modelId":"TS0011","manufacturerName":"_TYZB01_qeqvmvti","powerSource":3,"appVersion":65,"zclVersion":3,"stackVersion":0,"hwVersion":1,"dateCode":""}},"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1604673189878}
{"id":12,"type":"EndDevice","ieeeAddr":"0xec1bbdfffe8a19eb","nwkAddr":1804,"manufId":4098,"manufName":"_TYZB01_vzrytttn","powerSource":"Battery","modelId":"TS0012","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":256,"inClusterList":[0,4,5,6],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"65506":19,"modelId":"TS0012","manufacturerName":"_TYZB01_vzrytttn","powerSource":3,"zclVersion":3,"stackVersion":0,"hwVersion":1,"dateCode":"","appVersion":65}},"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0014d4887b","endpointID":1}],"meta":{}},"2":{"profId":260,"epId":2,"devId":256,"inClusterList":[4,5,6],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0014d4887b","endpointID":1}],"meta":{}}},"appVersion":255,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":1},"lastSeen":1604673109704}
{"id":18,"type":"EndDevice","ieeeAddr":"0xec1bbdfffeb7cef8","nwkAddr":13324,"manufId":4098,"manufName":"_TYZB01_mqel1whf","powerSource":"Battery","modelId":"TS0013","epList":[1,2,3],"endpoints":{"1":{"profId":260,"epId":1,"devId":256,"inClusterList":[0,4,5,6],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"65506":19,"modelId":"TS0013","manufacturerName":"_TYZB01_mqel1whf","powerSource":3,"zclVersion":3,"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":""}},"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0014d4887b","endpointID":1}],"meta":{}},"2":{"profId":260,"epId":2,"devId":256,"inClusterList":[4,5,6],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":256,"inClusterList":[4,5,6],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":0,"onTime":0,"offWaitTime":0}}},"binds":[],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1604682384538}

What did you expect to happen

They should be identified with powerSource: Mains (single phase), and they should be routers.

How to reproduce it (minimal and precise)

Just pair them with coordinator and they are visible as TS0011, TS0012, TS0013.

Debug info

Zigbee2MQTT version: 1.16.1
Adapter hardware: CC2531
Adapter firmware version:
{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20190608,"transportrev":2},"type":"zStack12"}

@klami85 klami85 added the problem Something isn't working label Nov 6, 2020
@Koenkk
Copy link
Owner

Koenkk commented Nov 7, 2020

Zigbee2MQTT cannot add (or take away) the router functionality, what you see in the database is just how the device announces itself. Since these are whitelabel devices these are identified as the generic TS0011, TS0012, TS0013 devices so this is expected.

@klami85
Copy link
Author

klami85 commented Nov 7, 2020

I am trying to add (fix) support for this device but I am new to this.
3 Gang switch with L+N wires connected to it identyfied itself as TS0013, 2 Gang (L+N) as TS0012, 1 Gang (L+N) as TS0011,
TS0013 is an end device with no N wire and also looks totally different so it is clearly a different device than mine.
I assume that different devices share the same identifier like in issue #2778

Is it possible that this device is not a router despite have L+N wires? or is it firmware fault?

For now I do that for device.js - this fixes my errors from issue #4872
I will find photos of this switches to add to supported devices list.

        fingerprint: [{modelID: 'TS0013', manufacturerName: '_TYZB01_mqel1whf'}],
        model: 'Lonsonho 3 Gang zigbee smart switch',
        vendor: 'Lonsonho',
        description: '3 gang switch module with neutral wire',
        extend: generic.switch,
        exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right')],
        endpoint: (device) => {
            return {'left': 1, 'center': 2, 'right': 3};
        },
        meta: {configureKey: 1, multiEndpoint: true},
        configure: async (device, coordinatorEndpoint) => {
            await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
            await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
            await bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
        },
    },
	{
        fingerprint: [{modelID: 'TS0012', manufacturerName: '_TYZB01_vzrytttn'}],
        model: 'Lonsonho 2 Gang zigbee smart switch',
        vendor: 'Lonsonho',
        description: '2 gang switch module with neutral wire',
        extend: generic.switch,
        exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right')],
        endpoint: (device) => {
            return {'left': 1, 'right': 2};
        },
        meta: {configureKey: 1, multiEndpoint: true},
        configure: async (device, coordinatorEndpoint) => {
            await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
            await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
        },
    },
	{
        fingerprint: [{modelID: 'TS0011', manufacturerName: '_TYZB01_qeqvmvti'}],
        model: 'Lonsonho 1 Gang zigbee smart switch',
        vendor: 'Lonsonho',
        description: '1 gang switch module with neutral wire',
        extend: generic.switch,
                },

@Koenkk
Copy link
Owner

Koenkk commented Nov 8, 2020

These changes are only cosmetic but will not change the device from being an end device to router. The firmware of this device says its an end device, not a router.

Note that pictures can be off for these white label devices (since they are whitelabel)

@klami85
Copy link
Author

klami85 commented Nov 10, 2020

After checking out tuya developer platform all becomes clear to me.
Someone (lonsonho) ordered TYZS3 module from TUYA with firmware for end device switch and put it in to L+N Switch (maybe they got too many...)
Seems like lonsonho makes another devices the same way. That's why we get duplicate IDs for some devices.
Before checking, I thought that if module is universal for tuya family devices the firmware is also universal and I can flip some values on the fly.
SDK for used SOC is available so maybe someone, someday make it better...
https://www.silabs.com/wireless/zigbee/efr32mg13-series-1-socs/device.efr32mg13p732f512gm48

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@adizag
Copy link

adizag commented Feb 15, 2023

@klami85 Did you have success with fixing it? did you flash a new FW?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests

3 participants