Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.93k stars 1.66k forks source link

Device support: 'Nue' / '3A Smarthome' smart switch range #176

Closed highground88 closed 5 years ago

highground88 commented 6 years ago

Hi all,

I think I've hit a snag and would appreciate some tips if someone could? It's been quite a mission just to get this far, I'm not very experienced in linux and even getting a machine up and running wasn't much fun.

I've taken two " 'Nue' 2 gang smart switches " off the supplied 'Nue' hub, and believe I have updated the 'devices.js' appropriately as they are being detected (copy of terminal below). Here's the model info lines from both entries in the 'devices' file:

zigbeeModel: ['FB56+ZSW1HKJ2.5'] and zigbeeModel: ['FB56+ZSW1HKJ1.7']

Funnily enough I think these are the same model 2 switch devices.. Perhaps one is a later revision? Regardless, this is the two switch model. I am yet to test on the 1 switch, 3 switch, dimmer and also the 1 and four button 'scene' switches I have just installed. PRODUCT LINK

Once the 'devices.js' file is updated, and zigbee2mqtt is restarted, I'm struggling to see any immediate messages when the switches are turned on and off - there doesn't seem to be anything coming through, and no sort of pattern reflecting how I've switched them on/off.

Where should I go next?

I don't know if this is helpful or not, but others seem to have been attaching these switches to the SmartThigns hub, via a similar detection method which is supplied by the distributor - would this be useful? LINK TO PDF

Thanks!

PASTEBIN DUMP

Koenkk commented 6 years ago

Can you:

    // Nue
    {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'TODO',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const device = shepherd.find(ieeeAddr, 1);
            execute(device, [(cb) => device.bind('genOnOff', coordinator, cb)], callback);
        },
    },
highground88 commented 6 years ago

Thanks @Koenkk

I will try this tonight and let you know how I get on, and will gather all the other model details I can for the other devices

highground88 commented 6 years ago

@Koenkk ,

This is the database.db contents. Below I will post the shepherd results, but there were not any "no converter available" messages. I hope this helps and appreciate your time.

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530775671,"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":"Iir7FWKHwlHAGayt"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530775707,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530777270,"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":"Iir7FWKHwlHAGayt"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"offline","joinTime":null,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530777271,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530777271,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScene{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530775671,"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":"Iir7FWKHwlHAGayt"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530775707,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530777270,"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":"Iir7FWKHwlHAGayt"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"offline","joinTime":null,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530777271,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1287651328,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":1772,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530777271,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1371668480,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}
s":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1371668480,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"QvXnFnosVrO4lSis"}

SHEPHERD DUMP:

(I have tried pairing, keeping pairing alive, and also switch presses during this dump but no response was noted to switches again)

PASTEBIN

Koenkk commented 6 years ago

Thanks, can you check with this code:

    // Nue
    {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'TODO',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const ep16 = shepherd.find(ieeeAddr, 16);
            execute(ep16, [(cb) => ep16.bind('genOnOff', coordinator, cb)], () => {
                const ep17 = shepherd.find(ieeeAddr, 17);
                execute(ep17, [(cb) => ep17.bind('genOnOff', coordinator, cb)], callback);
            });
        },
    },
highground88 commented 6 years ago

Thanks @Koenkk again for your help.

I've tried the new code, debug below. I still cannot detect any messages coming through with state changes from the switch. Is there something else I should be doing?

For info, I am running the dongle on a laptop with Debian, which is connecting back to the Hass.io MQTT server on my Pi okay.

Here's the latest log:

PASTEBIN

DATABASE.db

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530839641,"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":"Ga9UJCSjxYwJ7w4y"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":41819,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530839681,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1220411392,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"oefxCQ8kiRfFmtbx"}
{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1530840127,"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":"Ga9UJCSjxYwJ7w4y"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":41819,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"offline","joinTime":null,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1220411392,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"oefxCQ8kiRfFmtbx"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":41819,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530840127,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1220411392,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"oefxCQ8kiRfFmtbx"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":41819,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1530840127,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1455685632,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}}},"_id":"oefxCQ8kiRfFmtbx"}
Koenkk commented 6 years ago

Can you try with this code:

    // Nue
    {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'TODO',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const ep16 = shepherd.find(ieeeAddr, 16);
            const ep17 = shepherd.find(ieeeAddr, 17);

            const actions = [
                (cb) => ep16.bind('genOnOff', coordinator, cb),
                (cb) => ep17.bind('genOnOff', coordinator, cb),
                (cb) => ep16.report('genOnOff', 'onOff', 0, 1000, 0, cb),
                (cb) => ep17.report('genOnOff', 'onOff', 0, 1000, 0, cb),
            ];

            execute(ep16, actions, callback);
        },
    },
highground88 commented 6 years ago

Dump below (just Shepherd in debug, let me know if you need all debugged). Still no movement when switches triggered, though the board itself looks like it is probably universal between 1, 2 and 3 gang models, this one is just missing the resistors and switches in the other position (e.g. this 2 gang has positions 1 and 3 populated). Thanks @Koenkk

PASTEBIN

Koenkk commented 6 years ago

Can you try with:

    // Nue
    {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'TODO',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const ep16 = shepherd.find(ieeeAddr, 16);
            const ep17 = shepherd.find(ieeeAddr, 17);
            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

            const actions = [
                (cb) => ep16.bind('genOnOff', coordinator, cb),
                (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
                (cb) => ep17.bind('genOnOff', coordinator, cb),
                (cb) => ep17.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            ];

            execute(ep16, actions, callback);
        },
    },
highground88 commented 6 years ago

Hi @Koenkk , I have tried the new code, below is a debug log. Again I did not see any new messages when cycling the switches, and I also have a MQTT sniffer subscribed to the topic in case something was missed, but no luck. Could it be something I'm doing wrong? Thanks for you continuing efforts in helping! Much appreciated.

PASTEBIN

Koenkk commented 6 years ago

Strange that still nothing is reported.

In the meantime somebody got a different Nue model working: https://github.com/Koenkk/zigbee-shepherd-converters/pull/29#issuecomment-403803514

highground88 commented 6 years ago

Hi @Koenkk ,

I haven't given up... yet! But I'm getting close I'm afraid, as this is all a bit beyond my skill level getting this far. I would really like this to work however as a lot of my plans for the smart side of our renovation rely on this, and I mistakenly thought this would be easy (hah!). I figured that if Alexa can do it then I could too!

I'm wondering though if this will be of benefit:

https://community.smartthings.com/t/help-with-new-dh-for-aust-3-gang-light-switch-catchall-included/101434/86?

The SmartThings guys seem to have most of this figured out for HomeAssistant/MQTT and utilising the Smart Things hub - I'm just hoping that the device handlers for that hub may in fact be ported over to Zigbee2MQTT easily in this case?

As always, your help and great interface is very much appreciated!

Koenkk commented 6 years ago

Could you try the following code? According to the smartthings docs these are the commands that are executed in the configure method:

    // Nue
    {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'TODO',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const ep16 = shepherd.find(ieeeAddr, 16);
            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

            const actions = [
                (cb) => ep16.read('genOnOff', 'onOff', cb),
                (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            ];

            execute(ep16, actions, callback);
        },
    },
highground88 commented 6 years ago

Hi @Koenkk , sorry for the delay in trying this, and thanks again for continuing to help. I decided to try reflashing the firmware on the CC2531 first to see if that made a difference (I'm currently using your latest with the large buffer - let me know if that's a bad idea!)

I have used the above code you provided for the devices.js file.

The good news is that I've noticed some new lines in the log - but at this time cycling the switches does not result in immediate messages, however I have seen them appear once seemingly out of the blue:

Log.txt file:

2018-08-16T11:47:31.668Z - debug: Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[11]},"dbPath":"/opt/zigbee2mqtt/data/database.db","sp":{"baudrate":115200,"rtscts":true}}'
2018-08-16T11:47:31.690Z - info: Starting zigbee2mqtt version 0.1.2 (commit #7dd1c75)
2018-08-16T11:47:31.690Z - info: Starting zigbee-shepherd
2018-08-16T11:47:32.079Z - info: zigbee-shepherd started
2018-08-16T11:47:32.080Z - debug: zigbee-shepherd info: {"enabled":true,"net":{"state":"Coordinator","channel":11,"panId":"0x1a62","extPanId":"0xdddddddddddddddd","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0},"firmware":{"transportrev":2,"product":0,"version":"2.6.3","revision":20180815},"startTime":1534420052,"joinTimeLeft":0}
2018-08-16T11:47:32.082Z - info: Currently 1 devices are joined:
2018-08-16T11:47:32.082Z - info: 0x00124b0014afe1fb (0x00124b0014afe1fb): TODO - Nue Smart light switch - 2 gang (Router)
2018-08-16T11:47:32.084Z - warn: `permit_join` set to  `true` in configuration.yaml.
2018-08-16T11:47:32.084Z - warn: Allowing new devices to join.
2018-08-16T11:47:32.085Z - warn: Set `permit_join` to `false` once you joined all devices.
2018-08-16T11:47:32.085Z - info: Zigbee: allowing new devices to join.
2018-08-16T11:47:32.086Z - info: Connecting to MQTT server at mqtt://192.168.0.101
2018-08-16T11:47:32.144Z - info: zigbee-shepherd ready
2018-08-16T11:47:32.151Z - info: Connected to MQTT server
2018-08-16T11:47:32.151Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
**2018-08-16T11:47:32.447Z - debug: Recieved zigbee message with data {"cid":"genOnOff","data":{"onOff":1}}
2018-08-16T11:47:32.447Z - warn: No converter available for 'TODO' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":1}}'**
2018-08-16T11:47:32.447Z - warn: Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.
2018-08-16T11:47:32.810Z - info: Succesfully configured 0x00124b0014afe1fb
2018-08-16T11:48:02.426Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.483Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.538Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.654Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.867Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.922Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:02.980Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:03.096Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:03.102Z - debug: Recieved zigbee message with data "0x00124b0014afe1fb"
2018-08-16T11:48:03.103Z - info: Device incoming...
2018-08-16T11:48:03.104Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-08-16T11:48:03.106Z - debug: Recieved zigbee message with data "online"
2018-08-16T11:48:32.098Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:49:32.113Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:50:32.127Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:51:32.141Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:52:32.154Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:53:32.169Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:54:32.181Z - debug: Check online 0x00124b0014afe1fb
2018-08-16T11:55:32.194Z - debug: Check online 0x00124b0014afe1fb

This is a segment from the debug terminal:

2018-8-16 11:47:32 INFO zigbee-shepherd started
2018-8-16 11:47:32 DEBUG zigbee-shepherd info: {"enabled":true,"net":{"state":"Coordinator","channel":11,"panId":"0x1a62","extPanId":"0xdddddddddddddddd","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0},"firmware":{"transportrev":2,"product":0,"version":"2.6.3","revision":20180815},"startTime":1534420052,"joinTimeLeft":0}
2018-8-16 11:47:32 INFO Currently 1 devices are joined:
2018-8-16 11:47:32 INFO 0x00124b0014afe1fb (0x00124b0014afe1fb): TODO - Nue Smart light switch - 2 gang (Router)
2018-8-16 11:47:32 WARN `permit_join` set to  `true` in configuration.yaml.
2018-8-16 11:47:32 WARN Allowing new devices to join.
2018-8-16 11:47:32 WARN Set `permit_join` to `false` once you joined all devices.
2018-8-16 11:47:32 INFO Zigbee: allowing new devices to join.
2018-8-16 11:47:32 INFO Connecting to MQTT server at mqtt://192.168.0.101
  zigbee-shepherd:request REQ --> ZDO:mgmtPermitJoinReq +53ms
2018-8-16 11:47:32 INFO zigbee-shepherd ready
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +14ms
spinlock: false []
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +2ms
2018-8-16 11:47:32 INFO Connected to MQTT server
2018-8-16 11:47:32 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
  zigbee-shepherd:msgHdlr IND <-- ZDO:permitJoinInd +17ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:mgmtPermitJoinRsp +18ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +17ms
  zigbee-shepherd:request REQ --> ZDO:activeEpReq +0ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:activeEpRsp +38ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +1ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +43ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +0ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +42ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 1 +13ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +13ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +27ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 1 +1ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 2 +11ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +5ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +17ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
  zigbee-shepherd Identified Device: { manufacturer: Feibit Inc co.  , product: FB56+ZSW1HKJ1.7 } +2ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +3ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 3 +6ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +2ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 2 +0ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +10ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +9ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
2018-8-16 11:47:32 DEBUG Recieved zigbee message with data {"cid":"genOnOff","data":{"onOff":1}}
2018-8-16 11:47:32 WARN No converter available for 'TODO' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":1}}'
2018-8-16 11:47:32 WARN Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.
  zigbee-shepherd-converters:devices Configured '(cb) => ep16.read('genOnOff', 'onOff', cb)' with result 'OK' +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +13ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 3 +0ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 4 +293ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +9ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +30ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 4 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +15ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +3ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
  zigbee-shepherd-converters:devices Configured '(cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb)' with result 'OK' +361ms
2018-8-16 11:47:32 INFO Succesfully configured 0x00124b0014afe1fb
2018-8-16 11:48:02 DEBUG Recieved zigbee message with data "0x00124b0014afe1fb"
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 5 +30s
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +11ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +24ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 5 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +14ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +3ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-16 11:48:02 DEBUG Recieved zigbee message with data "0x00124b0014afe1fb"
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 6 +5ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +11ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +22ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 6 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +19ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-16 11:48:02 DEBUG Recieved zigbee message with data "0x00124b0014afe1fb"
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 7 +1ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +14ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +23ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 7 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +12ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +6ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 8 +3ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +13ms

This is now populated into the database.db:

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1534420052,"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":"gQuNFAzty9asR4kN"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":19235,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"offline","joinTime":null,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1657339904,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"JqvG0hCarzOZ6oZP"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":19235,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1534420052,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1657339904,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"JqvG0hCarzOZ6oZP"}
{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":19235,"manufId":0,"manufName":"Feibit Inc co.  ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1534420052,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1085997056,"hwVersion":0,"manufacturerName":"Feibit Inc co.  ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030        ","powerSource":1,"locationDesc":"                ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"JqvG0hCarzOZ6oZP"}

I feel like I'm getting close!!! Does this look like it's going in the right direction now? I'm just still using the one device (for reference the 2 gang switch model number is "HGZB-042") and I'm leaving the manufacturers hub switched off, and re-pairing the switch on each reboot.

Once I get one working, I'll be happy to find and properly format the settings data for the 5 or so related devices I have and create a PR, so hopefully this will help others also.

Any further steps forward would be great!! Thank you again.

Koenkk commented 6 years ago

After 2018-08-16T11:47:32.810Z - info: Succesfully configured 0x00124b0014afe1fb. Do you still see any No converter available messages when toggling the switch?

highground88 commented 6 years ago

No, that was the first time I've ever seen the "no converter available" message appear, and the associated payloads, eg.:

2018-8-16 11:47:32 DEBUG Recieved zigbee message with data {"cid":"genOnOff","data":{"onOff":1}} 2018-8-16 11:47:32 WARN No converter available for 'TODO' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":1}}'

Toggling the switch does not produce any messages that I can see on the debug output or the log. Is this due to needing to further setup

(Sorry closed issue by accident on my phone)

Koenkk commented 6 years ago

The one report is because of the read in the configure method. Somehow, the device just refuses to report it's state change :(.

Could you try pairing your FB56+ZSW1HKJ2.5 ?

highground88 commented 6 years ago

@Koenkk sure thing. I just need to find which switch it is in the house!

For the time being, I also added a Nue "FB56-ZSW05HG1.2" in-line switch whilst debugging, before I forever sealed it in plasterboard tomorrow.

This device is that referred to in Nue in wall switch #29

Log below - I'll try some other model switches now. Thanks again.

PASTEBIN LOG

highground88 commented 6 years ago

I believe this is the same FB56+ZSW1HKJ2.5,

Debug output:

  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +25ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 22 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +20ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +7ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
  zigbee-shepherd Identified Device: { manufacturer: Feibit Inc co.  , product: FB56+ZSW1HKJ2.5 } +0ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 23 +5ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +14ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +23ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 23 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +12ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +2ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
2018-8-18 12:30:05 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:05 INFO Connecting with device...
2018-8-18 12:30:05 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 24 +7ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +12ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +26ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 24 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +12ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +3ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:05 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:05 INFO Connecting with device...
2018-8-18 12:30:05 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 25 +7ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +13ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +24ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 25 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +10ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +4ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
2018-8-18 12:30:05 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:05 INFO Connecting with device...
2018-8-18 12:30:05 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 26 +9ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +17ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +336ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 26 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +11ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +3ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:06 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:06 INFO Connecting with device...
2018-8-18 12:30:06 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 27 +14ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +15ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +348ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 27 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +12ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:06 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:06 INFO Connecting with device...
2018-8-18 12:30:06 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 28 +2ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +13ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +171ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 28 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +13ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +3ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms
2018-8-18 12:30:06 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:06 INFO Connecting with device...
2018-8-18 12:30:06 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 29 +4ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +16ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +300ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 29 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +6ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:07 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:07 INFO Connecting with device...
2018-8-18 12:30:07 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 30 +1ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +13ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +588ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 30 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +10ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:07 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:07 INFO Connecting with device...
2018-8-18 12:30:07 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
  zigbee-shepherd Device: 0x00124b0019e14fa6 join the network. +1ms
2018-8-18 12:30:07 DEBUG Recieved zigbee message with data "0x00124b0019e14fa6"
2018-8-18 12:30:07 INFO Device incoming...
2018-8-18 12:30:07 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-8-18 12:30:07 INFO New device with address 0x00124b0019e14fa6 connected!
2018-8-18 12:30:07 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00124b0019e14fa6"}'
2018-8-18 12:30:07 DEBUG Recieved zigbee message with data "online"
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 31 +305ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +14ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +34ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 31 +0ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +13ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +1ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +0ms
2018-8-18 12:30:08 DEBUG Recieved zigbee message with data {"cid":"genOnOff","data":{"onOff":0}}
2018-8-18 12:30:08 WARN No converter available for 'TODO' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":0}}'
2018-8-18 12:30:08 WARN Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.
  zigbee-shepherd-converters:devices Configured '(cb) => ep16.read('genOnOff', 'onOff', cb)' with result 'OK' +20m
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 32 +304ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +15ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +23ms
  zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 32 +0ms
2018-8-18 12:30:14 DEBUG Check online 0x00124b0014afe1fb
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +6s
2018-8-18 12:30:14 DEBUG Check online 0x00124b000bd6d293
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +2ms
2018-8-18 12:30:14 DEBUG Check online 0x00124b0019e14fa6
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +0ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +65ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +2ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +403ms
  zigbee-shepherd-converters:devices Configured '(cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb)' with result 'Error: Timed out after 30000 ms' +30s
2018-8-18 12:30:38 ERROR Failed to configure 0x00124b0019e14fa6
2018-8-18 12:31:14 DEBUG Check online 0x00124b0014afe1fb
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +60s
2018-8-18 12:31:14 DEBUG Check online 0x00124b000bd6d293
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +1ms
2018-8-18 12:31:14 DEBUG Check online 0x00124b0019e14fa6
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +0ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +57ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +3ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +268ms

Log.txt:

2018-08-18T12:30:05.634Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:05.635Z - info: Connecting with device...
2018-08-18T12:30:05.636Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:05.696Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:05.697Z - info: Connecting with device...
2018-08-18T12:30:05.698Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:05.758Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:05.759Z - info: Connecting with device...
2018-08-18T12:30:05.761Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:06.138Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:06.139Z - info: Connecting with device...
2018-08-18T12:30:06.141Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:06.521Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:06.522Z - info: Connecting with device...
2018-08-18T12:30:06.522Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:06.724Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:06.726Z - info: Connecting with device...
2018-08-18T12:30:06.726Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:07.051Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:07.051Z - info: Connecting with device...
2018-08-18T12:30:07.052Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:07.665Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:07.665Z - info: Connecting with device...
2018-08-18T12:30:07.665Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-08-18T12:30:07.666Z - debug: Recieved zigbee message with data "0x00124b0019e14fa6"
2018-08-18T12:30:07.667Z - info: Device incoming...
2018-08-18T12:30:07.667Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-08-18T12:30:07.667Z - info: New device with address 0x00124b0019e14fa6 connected!
2018-08-18T12:30:07.668Z - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00124b0019e14fa6"}'
2018-08-18T12:30:07.669Z - debug: Recieved zigbee message with data "online"
2018-08-18T12:30:08.034Z - debug: Recieved zigbee message with data {"cid":"genOnOff","data":{"onOff":0}}
2018-08-18T12:30:08.035Z - warn: No converter available for 'TODO' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":0}}'
2018-08-18T12:30:08.035Z - warn: Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.
2018-08-18T12:30:14.641Z - debug: Check online 0x00124b0014afe1fb
2018-08-18T12:30:14.644Z - debug: Check online 0x00124b000bd6d293
2018-08-18T12:30:14.644Z - debug: Check online 0x00124b0019e14fa6
2018-08-18T12:30:38.341Z - error: Failed to configure 0x00124b0019e14fa6
2018-08-18T12:31:14.655Z - debug: Check online 0x00124b0014afe1fb
2018-08-18T12:31:14.657Z - debug: Check online 0x00124b000bd6d293
2018-08-18T12:31:14.657Z - debug: Check online 0x00124b0019e14fa6

This is my devices.js entry:

// Nue
{
    zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
    model: 'TODO',
    vendor: 'Nue',
    description: 'Smart light switch - 2 gang',
    supports: 'TODO',
    fromZigbee: [],
    toZigbee: [],
    configure: (ieeeAddr, shepherd, coordinator, callback) => {
        const ep16 = shepherd.find(ieeeAddr, 16);
        const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

        const actions = [
            (cb) => ep16.read('genOnOff', 'onOff', cb),
            (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
        ];

        execute(ep16, actions, callback);
    },
},
{
    zigbeeModel: ['FB56+ZSW05HG1.2'],
    model: 'Nue Smart Inline Switch',
    vendor: 'Nue',
    descritpion: 'Smart inline switch',
    supports: 'TODO',
    fromZigbee: [],
    toZigbee: [],
},
Koenkk commented 6 years ago

The configure failed:

  zigbee-shepherd-converters:devices Configured '(cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb)' with result 'Error: Timed out after 30000 ms' +30s
2018-8-18 12:30:38 ERROR Failed to configure 0x00124b0019e14fa6

Can you try repairing?

highground88 commented 6 years ago

Sorry I'm currently away with work - the device might be difficult to get to now but I can try.

Is there any chance this is related to the sniffer, and/or firmware? I'm holding out for some changes to Zigbee2MQTT that allow modification of the .js files, as this will make the process much easier to debug.

Something else (a little off topic) that I've been wondering about for a while now is if/when I get this up and running, is how to continue to utilise Alexa integration.

The supplied usb hub I assume will become redundant, but therefore so will the links to the hub via the app, which is the Alexa link. Is it possible to utilise the CC2531 as a repeater, rather than a coordinator, but still to pass/receive messages to HASS.io?

Koenkk commented 6 years ago

You could try updating to: https://github.com/Koenkk/Z-Stack-firmware/tree/increased_buffer/coordinator/CC2531/bin

No this is not possible, as zigbee2mqtt has to be the coordinator. (and you cannot have more than one coordinator in a zigbee network).

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ryanbeaton commented 5 years ago

@highground88 how did you go in the end. As, seemingly, the only AU approved switches there should be interest.

highground88 commented 5 years ago

Hi @ryanbeaton, I haven't got any further myself, but am still planning to try. There seems to be some great new features added in the past week which will make sniffing easier - unfortunately when I moved from ResinOS to HassOS, I had issues getting Zigbee2MQTT up and running as before. I think this may have resolved itself now and hopefully I'll have a look at my system again soon. If/when I do get anything definitive, I'll make sure I push it through. Still keen to hear from anyone else who's made more progress - it seems these have been selling pretty well, so I'm surprised really.

highground88 commented 5 years ago

Still not having much luck but will kepp trying. I notcied that in addition to SmartThings, the Hubitat users have also managed to import the handlers etc into their ecosystem and can utilise this with HA (although there seems to be problems getting the 3rd switch from the 3 gang units working). Unfortunately WAF too low to purchase a new hub right now....

I have also found this information on the Feibet site which I'm hoping might help those smarter than me figure out more of the problem perhaps? (translated into Chinglish from here: http://www.feibit.com/changjianwenti.html ). Unsure if this is referencing the app control or communication to the gateway unit.

  1. What is the gateway API interface protocol?

Interface Protocol: TCP Socket Interface

Port number: 8001

The illuminance data is parsed high in the previous low position and converted to decimal in D554 . The illuminance intensity is 54612.

  1. Flying than cloud server interface protocol

Interface protocol: socket and web socket

Port number: socket 8090 , web socket 8092

Format: packet length (2 bytes ) data type (2 bytes ) data length (2 bytes ) data ( variable length )

highground88 commented 5 years ago

Hi @Koenkk & @ryanbeaton ,

My apologies for the delay in getting back to this - just getting a bit of time now to re-visit, and see that there's been some more revisions.

I've updated to a fresh version (1.0.1) of the add-on and have had a clean up, and I think I'm finally starting to see some of the messages based on switch activation which I wasn't able to see previously. Still trying to get my head around this but I think I'm getting somewhere now!

Unfortunately I've tried a few variants of the handler that you originally kindly provided me with Koen, but the device isn't being accepted fully, e.g. (Message without device / Device with modelID 'undefined is not supported')

From what I can tell, there's two end points (sorry if not correct terminology), 16 and perhaps 17. The last device handler you gave me seems to only relate to 16, therefore this is perhaps why both activations of the switches appear with the same output data without differentiation? I'm currently trying to piece together some code that might work for the two based on your previous examples and I'll update if I make a breakthrough - but I have very limited programming knowledge.

If you could offer any sort of further advice, I'd be really appreciative - I feel I'm very close, and then hopefully I'll be able to start getting some of this together without so much help for the other 4 or 5 models of these switches I have.

devices.js entry: `` { zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'], model: 'TODO', vendor: 'Nue', description: 'Smart light switch - 2 gang', supports: 'TODO', fromZigbee: [], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const ep16 = shepherd.find(ieeeAddr, 16); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

        const actions = [
            (cb) => ep16.read('genOnOff', 'onOff', cb),
            (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
        ];

        execute(ep16, actions, callback);
    },
},

Database and Log LINK

Koenkk commented 5 years ago

That indeed looks good! Some how the modelID is not correct.

Can you:

highground88 commented 5 years ago

Thanks very much again @Koenkk ...

I've followed your instructions (and quite sure I've tried this before too) but seem to get the same result. (Stopped Z2MQTT, cleared out the relevant lines containing the coordinator address, restart Z2MQTT, allow rejoin, hold pairing button on device until the pairing light appears, activate the switches a few times). I've also fully removed the database before with no change.

Is this 'undefined' message relating to the switch or the coordinator (CC2531)? The message: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'undefined' (0x00124b0014bdea20) appears when activating a switch - but the ID of "0x00124b0014bdea20" appears to be the coordinator, not the switch?

Following doing above, this is the log output:

LOG and DATABASE

This is the current devices.js entry I'm trying:

` { zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'], model: 'TODO', vendor: 'Nue', description: 'Smart light switch - 2 gang', supports: 'TODO', fromZigbee: [], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const ep16 = shepherd.find(ieeeAddr, 16); const ep17 = shepherd.find(ieeeAddr, 17); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

        const actions = [
            (cb) => ep16.bind('genOnOff', coordinator, cb),
            (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            (cb) => ep17.bind('genOnOff', coordinator, cb),
            (cb) => ep17.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
        ];

        execute(ep16, actions, callback);
    },
},`
Koenkk commented 5 years ago

0x00124b0014bdea20 is indeed the coordinator, which is very strange.

You are sure that Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20) this message is produced when you click the switch (I've never seen before that the message is then reported by the coordinator).

highground88 commented 5 years ago

Happy New Year @Koenkk

I can confirm that those messages above have been produced by activating the switch, and appear to come from the coordinator. In fact, I reflashed the firmware to your latest, reinstalled Z2MQTT, and re-paired the switch. Same thing is happening. I haven't changed the device handler from that above (not sure if this is correct for the device still or perhaps part of the problem?). Very strange - @danielwelch have you perhaps seen this happening?

Here are the new logs, switch activations occur around 13:50:30...

2019-1-2 13:45:33 - info: Logging to directory: '/share/zigbee2mqtt/log/2019-01-02.13-45-32' 2019-1-2 13:45:33 - debug: Removing old log directory '/share/zigbee2mqtt/log/2018-12-29.15-12-55' 2019-1-2 13:45:37 - debug: Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[11]},"dbPath":"/share/zigbee2mqtt/database.db","sp":{"baudRate":115200,"rtscts":true}}' 2019-1-2 13:45:43 - debug: Loaded state from file /share/zigbee2mqtt/state.json 2019-1-2 13:45:45 - info: Starting zigbee2mqtt version 1.0.1 (commit #unknown) 2019-1-2 13:45:45 - info: Starting zigbee-shepherd 2019-1-2 13:46:30 - info: zigbee-shepherd started 2019-1-2 13:46:30 - info: Coordinator firmware version: '20181024' 2019-1-2 13:46:30 - debug: zigbee-shepherd info: {"enabled":true,"net":{"state":"Coordinator","channel":11,"panId":"0x1a62","extPanId":"0xdddddddddddddddd","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0},"firmware":{"transportrev":2,"product":0,"version":"2.6.3","revision":20181024},"startTime":1546400790,"joinTimeLeft":0} 2019-1-2 13:46:30 - info: Currently 0 devices are joined: 2019-1-2 13:46:30 - info: Zigbee: disabling joining new devices. 2019-1-2 13:46:30 - info: Connecting to MQTT server at mqtt://192.168.0.101:1883 2019-1-2 13:46:31 - info: zigbee-shepherd ready 2019-1-2 13:46:31 - info: Connected to MQTT server 2019-1-2 13:46:31 - info: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online' 2019-1-2 13:46:31 - debug: Mounted the cieApp (epId {epId}) 2019-1-2 13:48:09 - debug: Received MQTT message on 'zigbee2mqtt/bridge/config/permit_join' with data 'true' 2019-1-2 13:48:09 - info: Zigbee: allowing new devices to join. 2019-1-2 13:48:09 - info: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"log_level":"debug","permit_join":true}' 2019-1-2 13:48:54 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:48:54 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:48:54 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:48:59 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:48:59 - warn: Message without device! 2019-1-2 13:48:59 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:48:59 - warn: Message without device! 2019-1-2 13:48:59 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:48:59 - warn: Message without device! 2019-1-2 13:48:59 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:48:59 - warn: Message without device! 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:49:00 - warn: Message without device! 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:49:00 - warn: Message without device! 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:49:00 - warn: Message without device! 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:49:00 - warn: Message without device! 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devIncoming' with data '"0x00124b0014afe1fb"' of device 'FB56+ZSW1HKJ1.7' (0x00124b0014afe1fb) 2019-1-2 13:49:00 - info: Device incoming... 2019-1-2 13:49:00 - info: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}' 2019-1-2 13:49:00 - debug: Received zigbee message of type 'devStatus' with data '"online"' of device 'FB56+ZSW1HKJ1.7' (0x00124b0014afe1fb) 2019-1-2 13:49:02 - info: Succesfully configured 0x00124b0014afe1fb 0x00124b0014afe1fb 2019-1-2 13:49:17 - debug: Received zigbee message of type 'devLeaving' with data '"0x00124b0014afe1fb"' 2019-1-2 13:49:17 - warn: Message without device! 2019-1-2 13:49:52 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:49:52 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:49:52 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:50:03 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:03 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devInterview' with data '"0x00124b0014afe1fb"' 2019-1-2 13:50:04 - warn: Message without device! 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devIncoming' with data '"0x00124b0014afe1fb"' of device 'FB56+ZSW1HKJ1.7' (0x00124b0014afe1fb) 2019-1-2 13:50:04 - info: Device incoming... 2019-1-2 13:50:04 - info: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}' 2019-1-2 13:50:04 - debug: Received zigbee message of type 'devStatus' with data '"online"' of device 'FB56+ZSW1HKJ1.7' (0x00124b0014afe1fb) 2019-1-2 13:50:36 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:50:36 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:50:36 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:50:38 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:50:38 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:50:38 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:50:40 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:50:40 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:50:40 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:50:43 - debug: Saving state to file /share/zigbee2mqtt/state.json 2019-1-2 13:50:54 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:50:54 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:50:54 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html 2019-1-2 13:50:58 - debug: Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20) 2019-1-2 13:50:58 - warn: Device with modelID 'undefined' is not supported. 2019-1-2 13:50:58 - warn: Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html

Database: (line breaks added)

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,11],"status":"online","joinTime":1546400753,"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":[0,1281,3],"outClusterList":[1280,1282,3],"clusters":{"genBasic":{"dir":{"value":1},"acls":{"zclVersion":"R","hwVersion":"R","manufacturerName":"R","modelId":"R","dateCode":"R","powerSource":"R","locationDesc":"RW","physicalEnv":"RW","deviceEnabled":"RW"},"attrs":{"zclVersion":1,"hwVersion":1,"manufacturerName":"sivann inc.","modelId":"hiver0001","dateCode":"20170407","powerSource":1,"locationDesc":" ","physicalEnv":0,"deviceEnabled":1}},"ssIasAce":{"dir":{"value":1}},"ssIasZone":{"dir":{"value":2},"cmdRsps":{"enrollReq":{"exec":"exec"},"statusChangeNotification":{"exec":"exec"}}},"ssIasWd":{"dir":{"value":2}},"genIdentify":{"dir":{"value":3},"acls":{"identifyTime":"RW"},"attrs":{"identifyTime":0}}}}},"_id":"Kh5XvjviRmhykh4Q"}

{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":39693,"manufId":0,"manufName":"Feibit Inc co. ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"online","joinTime":1546400973,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1170014208,"hwVersion":0,"manufacturerName":"Feibit Inc co. ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030 ","powerSource":1,"locationDesc":" ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"PZYL316hqm259LaU"}

{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1546403739,"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":"Kh5XvjviRmhykh4Q"}

{"id":2,"type":"Router","ieeeAddr":"0x00124b0014afe1fb","nwkAddr":39693,"manufId":0,"manufName":"Feibit Inc co. ","powerSource":"Mains (single phase)","modelId":"FB56+ZSW1HKJ1.7","epList":[16,17],"status":"offline","joinTime":null,"endpoints":{"16":{"profId":260,"epId":16,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":1}}}},"17":{"profId":260,"epId":17,"devId":2,"inClusterList":[0,4,5,6],"outClusterList":[0],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"16393":1170014208,"hwVersion":0,"manufacturerName":"Feibit Inc co. ","modelId":"FB56+ZSW1HKJ1.7","dateCode":"20161030 ","powerSource":1,"locationDesc":" ","physicalEnv":0,"deviceEnabled":1}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":1},"attrs":{"onOff":0}}}}},"_id":"PZYL316hqm259LaU"}

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0014bdea20","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,11],"status":"online","joinTime":1546403739,"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":[0,1281,3],"outClusterList":[1280,1282,3],"clusters":{"genBasic":{"dir":{"value":1},"acls":{"zclVersion":"R","hwVersion":"R","manufacturerName":"R","modelId":"R","dateCode":"R","powerSource":"R","locationDesc":"RW","physicalEnv":"RW","deviceEnabled":"RW"},"attrs":{"zclVersion":1,"hwVersion":1,"manufacturerName":"sivann inc.","modelId":"hiver0001","dateCode":"20170407","powerSource":1,"locationDesc":" ","physicalEnv":0,"deviceEnabled":1}},"ssIasAce":{"dir":{"value":1}},"ssIasZone":{"dir":{"value":2},"cmdRsps":{"enrollReq":{"exec":"exec"},"statusChangeNotification":{"exec":"exec"}}},"ssIasWd":{"dir":{"value":2}},"genIdentify":{"dir":{"value":3},"acls":{"identifyTime":"RW"},"attrs":{"identifyTime":0}}}}},"_id":"Kh5XvjviRmhykh4Q"}

EDIT:

I've since added a Aqara door sensor just to ensure all is well, and it is working as expected. I have sent through a graphviz message - below is the result. I noted that the Nue switch is aparently offline - it is not, and still sends a message via the coordinator seemingly when switched. The other strange entry is the line "0x00124b0014afe1fb" -> "0x00124b0014bdea20" [label="87"] . My knowledge of programming is similar to that of Fred Flintstone's, but could this be referring to the message from the switch looking like it's coming from the coordinator? And why would it be labelled '87'?

Please let me know if there's something else I should try.

Graphviz:

zigbee2mqtt:info 2019-1-2 16:01:16 MQTT publish: topic 'zigbee2mqtt/bridge/networkmap/graphviz', payload 'digraph G { node[shape=record]; "0x00124b0014bdea20" [label="{0x00124b0014bdea20|Coordinator|No model information available|online}"]; "0x00124b0014afe1fb" [label="{0x00124b0014afe1fb|Router|Nue Smart light switch - 2 gang (TODO)|offline}"]; "0x00124b0014afe1fb" -> "0x00124b0014bdea20" [label="87"] "0x00158d0002047314" [label="{0x00158d0002047314|EndDevice|Xiaomi Aqara door & window contact sensor (MCCGQ11LM)|online}"]; }'

Koenkk commented 5 years ago

Could you try sniffing the traffic from the device? This will give us some more insight on how it works: https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/how_tos/how_to_sniff_zigbee_traffic.md

highground88 commented 5 years ago

I can sure try, but by chance is there a Windows compatible tool to do this? Otherwise I'll try to find a spare machine to put Ubuntu on.

Do you think this would help with the coordinator issue though? Thanks for your help as always.

Koenkk commented 5 years ago

I would recommend using ubuntu to do this (never tried it on windows).

Probably not, but perhaps it could give us insight on why this happens.

highground88 commented 5 years ago

Sorry for the delay.... had fun getting this all to work/install/run over the last few days now......

I now have Ubuntu running on a laptop and have flashed the CC2531 with the sniffer software. I'm doing my best to follow along, and have interpreted based on trial and error that in your sniffing guide, the command to start wireshark should be "sudo whsniff -c 11 | wireshark -k -i -". Setting this to any other channel seemingly aside from 11 results in the error "unrecognised libpcap format or not libpcap data" (same if I use the command listed). Once I have it up and sniffing, the most I seem to get is a beacon request via IEEE 802.15.4once the switch is in pairing mode (03 08 67 ff ff ff ff 07 58 b2).

EDIT: I take this back..... I've had a breakthrough - it appears that the hub and switches are operating on channel 19. I didn't try this far up the sequence. If I browse to the "FBee Cloud Gateway" page ("Nue Smart Hub device") via IP, I'm greeted with this:

Version:  
Software Version 2.5.5(Nov 22 2017_13:42:58)Light GW
Hardware version FBF109CB V1.0
Serial No XXXXXXXXX

IP Mode | DHCP IP Address | 192.168.XXX IP Mask | 255.255.255.0 IP Gateway | 192.168.XXX MAC Address | 10:A5:D4:XXXXXXX

WAN | Connected FBee Cloud | Full Control User Name | XXXXXXXX

Current Date: | 2019-01-09 Current Time | 18:12:23 (Time Zone:UTC +10:00) Upload bytes | 1783 Download bytes | 16 Free Mem | 14832 Free Mini Mem | 9792 PanID | 5443-XXXXXXXXC60D004B1200-CH:19 Build:021203 Scene Mode: | 1

The CH19 part at the end of PanID tipped me off on the channel number!

I have also captured the Network Encryption Key, so have access to all broadcasts in wireshark now! (Is this a common key, or best I keep private?).

Thank you for getting me this far @koenkk - how can I best help from here with this access? Shall I capture and export a .pcap file or .csv or ..? I'm still treading water as far as understanding the Zigbee protocol, so unfortunately I'll still need a hand but I'd love to contribute as much as I can to both your project and help others with these devices.

From what I understand, the things that need finalisation with these switches for myself and a lot of others is getting them reliably onto the CC2531 platform and recognised under HA via Zigbee2MQTT - this might be device specific in some cases, due to dimming components, different numbers of gang switches, and "scene switch" devices which do not have a physical switch and still manage to retain their bind to other switches without a coordinator switched on.

I'll have a few more days I hope of time to play with this before being back at work, so please let me know what I can do to help. I'll post up some more info shortly once I work out how to get samba shares working...!

Koenkk commented 5 years ago

What messages do you see when you press a button on the switch?

highground88 commented 5 years ago

LINK TO .PCAP ETC

Was having a few issues exporting correctly - please let me know if this is helpful instead. Below is probably the simplest record of the activation of both switches.

LINK TO 2 GANG ACTIVATIONS

Koenkk commented 5 years ago

It seems that the messages are send to the zapp-cie, something that has been added in zigbee2mqtt 1.0.0. This also explains why the switch suddenly started to work.

Can you add the following to https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/zapp/cie.js (before line 56)

cieClusters.init('genOnOff', 'dir', {value: 2}); // Client Side(Output)

cieClusters.init('genOnOff', 'cmds', {
    off: (zapp, argObj, cb) => {
        console.log("Hello there! this is off");
        console.log(zapp, argObj);
    },
    on: (zapp, argObj, cb) => {
        console.log("Hello there! this is ON");
        console.log(zapp, argObj);
    },
});
highground88 commented 5 years ago

Thanks, looks promising. Is this zapp-cie change the likely culprit that has also caused the router device messages to appear as if they are coming from the coordinator perhaps?

I will have to look at setting up another HA device today, as I'm on Hassio and don't believe I can make those changes?

highground88 commented 5 years ago

Hi @Koenkk ,

I think I have done as you suggested via a second Hasbian instance and a fork of your dev build with the modification to the cie.js file. This is the output: PASTEBIN LINK It appears that the coordinator is still passing on the switch activation message unfortunately.

This is the point where the coordinator (0x00124b0014bdea20) starts acting funny and sending messages on activation of the switch (0x00124b0014afe1fb):

zigbee2mqtt:debug 1/10/2019, 6:51:18 AM Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":1}}' of device 'undefined' (0x00124b0014bdea20)
zigbee2mqtt:warn 1/10/2019, 6:51:18 AM Device with modelID 'undefined' is not supported.

The device.js I used is below - again I really have no idea what I shoud be putting in this still, but I have included it for your reference.

 {
        zigbeeModel: ['FB56+ZSW1HKJ2.5', 'FB56+ZSW1HKJ1.7'],
        model: 'TODO',
        vendor: 'Nue',
        description: 'Smart light switch - 2 gang',
        supports: 'on/off',
        fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change, fz.generic_state],
        toZigbee: [tz.on_off],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
        const ep16 = shepherd.find(ieeeAddr, 16);
        const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 10, repChange: 0};

            const actions = [
                (cb) => ep16.read('genOnOff', 'onOff', cb),
                (cb) => ep16.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
        ];

        execute(ep16, actions, callback);
      },
    },
Koenkk commented 5 years ago

Can you post the whole log? (I'm also interested in the startup part)

highground88 commented 5 years ago

Sorry I'd just cut that part - I've re done another full log from the start. FULL LOG

For info, this is the sequence in case it's difficult to see.:

  1. Start Z2M with switch having previously been paired, but switch currently powered down. Wait.
  2. Power up switch. Wait.
  3. Press both buttons on/off once each. Wait.
  4. Re-pair switch. Wait.
  5. Press both buttons on/off once again each. Quit.

Hope this helps, and thank you once more.

Koenkk commented 5 years ago

No luck yet, can you try with:

cieClusters.init('genOnOff', 'dir', {value: 1}); // Client Side(Output)

cieClusters.init('genOnOff', 'cmds', {
    off: (zapp, argObj, cb) => {
        console.log("Hello there! this is off");
        console.log(zapp, argObj);
    },
    on: (zapp, argObj, cb) => {
        console.log("Hello there! this is ON");
        console.log(zapp, argObj);
    },
});
highground88 commented 5 years ago

Sure. Here is the log NEW LOG. I followed the same sequence as above re button presses etc, but it appears that this hasn't unfortunately fixed it either.

The above log did not have the change for the device in the devices.js file, the below log is after this has been modified. Are you able to confirm what the correct handler should be based on what you've seen yet perhaps, and I can update this? I assume this is unrelated to the zapp-cie issue?

DEVICES.JS UPDATED, NO PAIRING

Just in case I'm doing something wrong in the process of making these changes, I stop zigbee2mqtt, delete the /otp/zigbee2mqtt folder, and then made changes to the cie.js file in my fork. I then use sudo git clone https://github.com/highground88/zigbee2mqtt.git /opt/zigbee2mqtt to download the modified version and continue the install as usual.

I'm at least learning a lot about the CLI in this process... until yesterday I didn't know how to remove a folder. :-)

Koenkk commented 5 years ago

That's indeed the good procedure, I've added extra logging to your fork, could you update and provide the logging again?

highground88 commented 5 years ago

Great, thank you - here are the results - lots more data so may have missed the very beginning as Putty appears to have a limit so I'll post a second bootup below the main log...

LOG - Update deviceReceive.js commit a8e6f80

This is the sequence this time:

  1. Fresh install of modified fork, update devices.js, mqtt config.
  2. Start Z2M. Wait.
  3. Power up switch. Wait.
  4. Press both buttons on/off once each. Wait.
  5. Re-pair switch. Wait.
  6. Press both buttons on/off once again each. Quit.

This is the second (full) bootup, with permit join set false and device already added (& actuated switches on/off each):

SECOND BOOT

Koenkk commented 5 years ago

The current problem is that we don't know that it come from the switch. In the logging I can't find any identifiers. I'm out of ideas again..

highground88 commented 5 years ago

At least we have got some kind of reaction out of the switches I guess now. I'm still stumped why this switch isn't working but the other handlers already in shepherd for the other switches do.

Being that these seem to work in SmartThings, would this thread shed any secrets for you perhaps? The distributor '3asmarthome' is also active on that forum so I have reached out to him again.

https://community.smartthings.com/t/instruction-and-device-handler-for-smartthings-hub-controlling-nue-zigbee-in-ceiling-light-controller/127109

I will wire up some different model switches perhaps today and see if anything comes up. I have ordered a second cc2531 so that one can stay connected to Zigbee2Mqtt whilst the other is used as a sniffer. By all means if you have any other ideas or anything else you want me to try please let me know as I'm not quite ready to give up yet! :-)

Thanks Koen

highground88 commented 5 years ago

I've hooked up a different model switch (1 gang + dimmer up/down) which shows as a FB56+ZSC05HG1.0 Product Link and I've created a new dump (just added the model number in behind the previous 2 switches in the devices.js file).

LOG FROM FB56+ZSC05HG1.0

Not sure if it's helpful or not. The other switch was powered off at the time. Pressing any of the buttons resulted in this output:

 zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +31s
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +12ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +10ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +2ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +6s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +10ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +2ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +3s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +10ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +2ms
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +978ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +10ms

From what I understand the Smart Things guys didn't have too much trouble with the other switches, but this dimmer seemed a little more complex.

Device internal images:

FB56+ZSW1HKJ1.7 (2 gang)

FB56+ZSC05HG1.0 (dimmer)

Both appear to have a CC2530 module with an CC2592 'range extender' chip on the same daughter board..

Koenkk commented 5 years ago

Can you add to: https://github.com/Koenkk/zigbee-shepherd/blob/master/lib/components/af.js#L689 console.log(msg.zclMsg.cmdId) and provide the log?

highground88 commented 5 years ago

Sure: LOG with console.log(msg.zclMsg.cmdId)

Both model devices re-paired.