Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.24k stars 1.69k forks source link

Attempt to pair Livolo Zigbee switch #592

Closed Ton1965 closed 4 years ago

Ton1965 commented 6 years ago

I have bought a Livolo zigbee switch like this one: https://www.aliexpress.com/item/Livolo-Touch-ZIGBEE/32918552579.html?spm=a2g0v.10010108.1000016%2FB.1.12754ab2JVEKJU

It seems to be a good option for its price.

The original Livolo instruction is to buy their own gateway and pair using their application. The pairing should be done by keeping a switch button pressed for 5 seconds. It should beep and pair after that.

The problem is it does not want to pair to zigbee2mqtt. I tried the following:

All the time I kept the device close to the zigbee stick.

I just could not observe any activity in zigbee2mqtt log in any of these cases. I have double checked that 'permit_join' is set to true and log_level set to 'debug'. I even tried to run zigbee2mqtt together with DEBUG=zigbee-shepherd* - no result.

Does anyone have any suggestions/advices/ideas? It would be very nice to add support to this device since this model seems to be much more attractive than the corresponding RF model.

khzd commented 6 years ago

Hi Ton1965 I order one too, hop it's work with zigbee2mqtt did not get it yet, i will post my finding too cheers

Ton1965 commented 6 years ago

Hi @khzd,

I am glad I am not the only one! I still could not succeed in pairing the switch to zigbee2mqtt 😞. It just does not produce any output in the logs. Probably it is just broken but I hope for the best. I do not want to buy their gateway since it means installing it instead of some outlet and I do not have any spare ones.

Best wishes.

khzd commented 6 years ago

Asap i got it I will give a try :) I will maybe confirme that yours is not broken :) Still in the flight

kirovilya commented 6 years ago

My friend also bought this switch. And also could not pair it with the coordinator :( Nothing in log

khzd commented 6 years ago

Hi What about using winshark to hack it? Asap I got it il will give a try Anyone to help for this hack ?

Ton1965 commented 6 years ago

@khzd , I am ready to help although I am not very experienced in this kind of things. But I will try to do my best although I will probably need some direction. Can wireshark really be used to sniff on zigbee? I thought it is used for http traffic going through the router, but as I said I do not know much about this.

lych commented 6 years ago

Hi guys. When I was buying this switch, a seller warned me it works only with their gateway. I've tried wireshark with zigbee sniffer. I wasn't able to catch any zigbee packets. So, I see two options, it's encrypted or it uses their own proprietary protocol. I'm waiting for another CC2531 dongle because I have only one and it's difficult to flash it each time. When I get the new device, I'll continue the experiments to understand if it's encrypted or not.

Lumbricus commented 6 years ago

I also bought one of the switches and have the same problem. Would be nice to pair it, because the RF version doesn't give a feedback. There's only a receiver inside.

If you open the switch you can see, that they use a CC2630.

khzd commented 6 years ago

Hi guys,

I did not get yet mine, i planned to by 12 unit to equipe my house :( I choose this one for a mechanical constraint : the far side of the device is circular so fit exactly in my France installation. the xiaomi alternative one has a square fare side so need to change all holes ( irreversible operation)

Remarque : they sold it as conform to Zigbee alliance, is is a new release ? Zigbee 3?

cheers

Ton1965 commented 6 years ago

@khzd, I am in almost the same situation: I want it to fit into the European hole. I have bought just one for now since I suspected there might be some difficulties. If you have already ordered all 12 then you probably would be better off to get their coordinator althoug I do not like this idea😞. I still hope that probably someone does have a coordinator and will be able to hack the protocol. PS. I have Livolo RF switch and it is running fine but it does not return its state so it is not always convenient.

Koenkk commented 6 years ago

A bit offtopic: but for european holes I would highly recommend the Shelly 1 with tasmota (wifi esp8266 device). It fits easily and allows you to keep your normal switch. Ive installed 20 of them in my home and they work perfect!

khzd commented 6 years ago

Hi ton1966 I planned to bay 12 but I did not , I see that it s not planned to be supported by zigbee2mqtt :( I m happy to order only one, the loose is limited :) For European holes, zigbee will wait ...

mpisek commented 6 years ago

Does their gateway support TCP/IP stack? I guess its a zigbee to wifi device? Does it have a local or cloud API?

lych commented 6 years ago

According to their advertisment, their gateway is able to work with Amazon Alexa but I haven't seen any APIs yet.

ptvoinfo commented 6 years ago

@Lumbricus Is it possible to flash this chip? Could you please make a hi-res photo of the board with this chip?

Ton1965 commented 6 years ago

A bit offtopic: but for european holes I would highly recommend the Shelly 1 with tasmota (wifi esp8266 device). It fits easily and allows you to keep your normal switch. Ive installed 20 of them in my home and they work perfect!

Shelly would have been nice but I do not have any neutral line in my apartment. Just two wires in each hole. That is why Livolo suits me well, their switches do not require neutral.

lych commented 6 years ago

Hi guys, I have a news. I still don't know if it's good or not, but using zboss sniffer and Wireshark I see "Beacon Requsts" packets from the switcher. They are on the channel 0x1A (26) whereas zigbee2mqtt packets on the channel 0x0B (11). I know almost nothing about ZigBee protocol, so I need to read something to figure out how it works. If anybody knows what my next step should be, give me a tip please.

kirovilya commented 6 years ago

@lych run zigbee2mqtt on channel 26 and try to pair livolo switch

lych commented 6 years ago

@kirovilya Thanks! It looks encouraging!

zigbee2mqtt:info 2018-11-25 18:58:54 New device with address 0x00124b000befc0b9 connected!

zigbee2mqtt:info 2018-11-25 18:58:54 MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00124b000befc0b9"}'

zigbee2mqtt:warn 2018-11-25 18:58:54 Device with modelID 'TI0001 ' is not supported.

kirovilya commented 6 years ago

@lych now try press switch button and record debug log. We need messages ;)

Ton1965 commented 6 years ago

@lych Great to hear! I have always believed someone would be able to pair this device!

I would like to do my own experiments now but I have the only stick and it is so to say in production mode now.

This switch seems to work on channel 26 only. I do not really know the channel my stick is running on but it should be some other one since the pairing failed in my case. If I change my zigbee2mqtt coordinator to channel 26 now would it mean re-pairing all the devices? Or probably they will all shift to a different channel :crossed_fingers: ?

lych commented 6 years ago

@Ton1965 You shouldn't change your coordinator channel, at least now, I haven't been able to make it to work yet. I am not sure about re-pairing, after changing the channel I still see data from my temperature sensor without repairing, but another my device (Xiaomi button) doesn't work. I think it depends on endpoint device. @kirovilya There is nothing interesting in zigbee2mqtt log, see my previous post, there is the most interesting part of the log.

I've attached pcap file for wireshark [livolo_pairing.zip] (https://github.com/Koenkk/zigbee2mqtt/files/2613373/livolo_pairing.zip). There is the pairing process and some touches of sensor. It looks like the pairing process can't be finished on the switcher side. The switcher wants some kind of response from coordianator, but sends something when I touch the sensor. It's the worst part, the message is encrypted.

lych commented 6 years ago

@ptvoinfo There is a photo of the board dsc02111 I think it's possible to flash it, but to do it one have to figure out how to connect the programmer and hack the protocol between CC2630 and main PIC controller. I still hope that it's possible to use the switch without such difficulties.

kirovilya commented 6 years ago

@lych I wanted to look at a debug log from zigbee2mqtt, but not wireshark :) https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-debug

lych commented 6 years ago

@kirovilya As I've already said there is nothing in zigbee2mqtt log.

zigbee2mqtt:info 2018-11-25 18:58:54 New device with address 0x00124b000befc0b9 connected!

zigbee2mqtt:info 2018-11-25 18:58:54 MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00124b000befc0b9"}'

zigbee2mqtt:warn 2018-11-25 18:58:54 Device with modelID 'TI0001 ' is not supported.

It's all, nothing else.

kirovilya commented 6 years ago

@lych Even when you press the switch button after that? Did you run zigbee2mqtt with debug parameter? https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-debug#zigbee-shepherd-debug-logging Must be more data.

lych commented 6 years ago

@kirovilya Which level is more informative info or debug? I'll try it with zigbee-shepherd debug info tonight.

kirovilya commented 6 years ago

@lych debug

Koenkk commented 6 years ago

It could be that reporting/binding needs to be setup, can you try with:

    {
        zigbeeModel: ['TI0001 '],
        model: 'TI0001 ',
        description: 'Zigbee switch',
        supports: 'on/off',
        vendor: 'Livolo',
        fromZigbee: [],
        toZigbee: [tz.on_off],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const device = shepherd.find(ieeeAddr, 1);
            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
            const actions = [
                (cb) => device.bind('genOnOff', coordinator, cb),
                (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            ];

            execute(device, actions, callback);
        },
    },
lych commented 6 years ago

@Koenkk Thanks a lot. I'll try it tonight.

lych commented 6 years ago

There is a log with Koenkk's changes. log.txt Nothing in the log when I touch the sensor, but there is a packet in wireshark:

ZigBee Network Layer Data, Dst: 0x0000, Src: 0x4195
    Frame Control Field: 0x0248, Frame Type: Data, Discover Route: Enable, Security Data
        .... .... .... ..00 = Frame Type: Data (0x0)
        .... .... ..00 10.. = Protocol Version: 2
        .... .... 01.. .... = Discover Route: Enable (0x1)
        .... ...0 .... .... = Multicast: False
        .... ..1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x0000
    Source: 0x4195
    Radius: 30
    Sequence Number: 70
    [Extended Source: TexasIns_00:0b:ef:c0:b9 (00:12:4b:00:0b:ef:c0:b9)]
    [Origin: 31]
    ZigBee Security Header
        Security Control Field: 0x28, Key Id: Network Key, Extended Nonce
            ...0 1... = Key Id: Network Key (0x1)
            ..1. .... = Extended Nonce: True
        Frame Counter: 33
        Extended Source: TexasIns_00:0b:ef:c0:b9 (00:12:4b:00:0b:ef:c0:b9)
        Key Sequence Number: 0
        Message Integrity Code: 3c12cfd8
        [Expert Info (Warning/Undecoded): Encrypted Payload]
            [Encrypted Payload]
            [Severity level: Warning]
            [Group: Undecoded]
    Data (24 bytes)
        Data: 0b18a65039a5299431e37b635bb920f26f862eac4304d5d5
        [Length: 24]
kirovilya commented 6 years ago

I think that model is not 'TI0001 '... somthing more :) need database.db after pairing

lych commented 6 years ago

database.zip It's "TI0001 " :)

kirovilya commented 6 years ago

"TI0001 " - 10th spaces after TI0001 :)

lych commented 6 years ago

When I press a button on a xiaomi button I see the message in log:

zigbee2mqtt:debug 27/11/2018, 01:40:59 Received zigbee message of type 'attReport' with data '{"cid":"genMultistateInput","data":{"presentValue":1}}' of device 'lumi.remote.b1acn01' (0x00158d0001ef628b) and a command in wireshark: Command: Report Attributes, Seq: 12

When I touch the sensor on Livilo swich, nothing in log, but I see a comand in wireshark: ZigBee Cluster Library Frame, Mfr: Unknown (0x15d2), Command: Read Attributes, Seq: 216

Is it possible that the switch is waiting for some kind of response from the coordinator before sending its state?

khzd commented 6 years ago

Good progress @lych, I got mine today,I will join tests also. Can you recap all steps ? Cheers

lych commented 6 years ago

@khzd Unfortunately, I haven't had any progress yet. I figured out that Livolo works on channel 26. According to logs, the joining process looks ok. After it, if I touch the sensor there is a packet in Wireshark, but it marked as malformed. I wasn't able to find any trails of these packets in cc-znp (the dongle doesn't send anything like this packet to /dev/ttyACM0), so I suspect that dongle just discards such packets. Moreover, if I turn Livolo's power off then on, it starts the joining process again as if it doesn't remember that it had already been joined. I suspect that something wrong with the joining process. My switch starts the joining process immediately as I turn the power on, doesn't matter if I touch sensor for 5 seconds or not.

khzd commented 6 years ago

Hi @lych, same causes same effects same results as you, I followed all previous steps given by @kirovilya and @Koenkk. the join process seems ok : i got a record in the DB {"id":60,"type":"EndDevice","ieeeAddr":"0x00124b000bf0725e","nwkAddr":19896,"manufId":0,"manufName":"LIVOLO\u0000\u0010TI0001 ","powerSource":"Mains (single phase)","modelId":"TI0001 ","epList":[6],"status":"offline","joinTime":null,"endpoints":{"6":{"profId":260,"epId":6,"devId":0,"inClusterList":[0,3],"outClusterList":[6],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":2},"attrs":{}}}}},"_id":"Kz5WoE1MBGXoZwWc"}

BUT after restart i have in the log: 2018-11-28 13:59:24 - info: my_office_light_up (0x00124b000bf0725e): TI0001 - Livolo Zigbee switch (EndDevice) 2018-11-28 13:59:24 - error: Failed to configure my_office_light_up 0x00124b000bf0725e

I got 2018-11-28 13:59:24 - info: MQTT publish, topic: 'zigbee2mqtt/my_office_light_up', payload: '{"state":"ON"}'

and after that all the network crach : no device is connected :(

@kirovilya and @Koenkk any help ?

kirovilya commented 6 years ago

I also helped a friend to pair the switch with the coordinator. But then he tried to send genOnOff commands to switch endpoint 6. No success. :( 6 failed with error Error: AF data request fails, status code: 240. MAC transaction expired.

Ton1965 commented 6 years ago

Hi @khzd,

I have found some difference between your database and the one pasted here by @lych in this message. Your database shows the switch status as offline but his has several records with online status so the device can at least be brought to online state. I am not sure if this fact is helpful though. Another strange thing is the modelId that has 9 extra spaced in @lych's database but not in yours.

lych commented 6 years ago

About extra spaces. It's just because of github parser. It eats extra spaces, that's why I attached the file.

khzd commented 6 years ago

I confirm, I have the @kirovilya 10 spaces :)

khzd commented 6 years ago

"For European holes, zigbee is progressing ..." Hi, the device is recognized correctly what about the specific fromZigbee code to handel it : { zigbeeModel: ['TI0001 '], model: 'TI0001 ', description: 'Zigbee switch', supports: 'on/off', vendor: 'Livolo', fromZigbee: [MISSING THIS SECTION], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const actions = [ (cb) => device.bind('genOnOff', coordinator, cb), (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), ]; execute(device, actions, callback); }, },

and ONOFF from HA i m getting: Nov 28 16:51:25 ubuntu59 npm[22564]: zigbee2mqtt:info 2018-11-28 16:51:25 Zigbee publish to '0x00124b000bf0725e', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null Nov 28 16:51:43 ubuntu59 npm[22564]: zigbee2mqtt:error 2018-11-28 16:51:43 Zigbee publish to '0x00124b000bf0725e', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null failed with error Error: AF data request fails, status code: 183. APS no ack.

Any idea @kirovilya ?

lych commented 6 years ago

There is a mistake in config. I think it must be toZigbee: [tz.onoff], instead of toZigbee: [tz.on_off], (I probably have an old version)

khzd commented 6 years ago

Hi did you got good results ? Onoff in converters is not there , only on_off is!

Question how to debug a specific function , with more than 30 devices I have a huge log :(

lych commented 6 years ago

Now, if I try to change a state, zigbee2mqtt sends the command "ZCL OnOff" and Livolo answers "Success" but nothing really happens (reley doesn't change its state). Then zigbee2mqtt sends "Discover Attributes", Livolo answers "Unsupported General Command" then, zigbee2mqtt sends "Read Attributes" and Livolo answers its current state (on or off), it is the real state (it's only one thing which looks working in right way)

If a switch has more than one button, how should the command look like? It cannot just be on / off. There must be something else, like pointing to a specific button.

khzd commented 6 years ago

hi, was able to debug : I reduce all devices from DB (router and LIVOLO) and got this after sendig ON via mqtt : results same as you :(

zigbee2mqtt:debug 2018-11-29 21:36:15 Received MQTT message on 'zigbee2mqtt/my_office_light_up/set' with data 'ON' zigbee2mqtt:info 2018-11-29 21:36:15 Zigbee publish to '0x00124b000bf0725e', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null zigbee-shepherd:request REQ --> AF:dataRequest, transId: 3 +8s cc-znp:SREQ --> AF:dataRequest, { dstaddr: 63208, destendpoint: 6, srcendpoint: 1, clusterid: 6, transid: 3, options: 48, radius: 30, len: 3, data: <Buffer 01 03 01> } +1ms serialport:main _write 18 bytes of data +8s serialport:bindings write 18 bytes +8s serialport:unixWrite Starting write 18 bytes offset 0 bytesToWrite 18 +3m serialport:unixWrite write returned null 18 +1ms serialport:unixWrite wrote 18 bytes +0ms serialport:unixWrite Finished writing 18 bytes +0ms serialport:main binding.write write finished +1ms serialport:poller received "readable" +8s serialport:bindings read +10ms serialport:unixRead Starting read +8s serialport:unixRead Finished read 6 bytes +0ms serialport:main binding.read finished +9ms cc-znp { sof: 254, cc-znp len: 1, cc-znp type: 'SRSP', cc-znp subsys: 'AF', cc-znp cmd: 'dataRequest', cc-znp payload: { status: 0 }, cc-znp fcs: 100, cc-znp csum: 100 } +12ms serialport:main _read reading +2ms serialport:bindings read +2ms serialport:unixRead Starting read +2ms cc-znp:SRSP <-- AF:dataRequest, { status: 0 } +1ms zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +0ms serialport:unixRead waiting for readable because of code: EAGAIN +1ms serialport:poller Polling for "readable" +3ms serialport:poller received "readable" +7s serialport:bindings read +7s serialport:unixRead Starting read +7s serialport:unixRead Finished read 30 bytes +0ms serialport:main binding.read finished +7s cc-znp { sof: 254, cc-znp len: 25, cc-znp type: 'AREQ', cc-znp subsys: 'AF', cc-znp cmd: 'incomingMsg', cc-znp payload: cc-znp { groupid: 0, cc-znp clusterid: 10, cc-znp srcaddr: 38930, cc-znp srcendpoint: 1, cc-znp dstendpoint: 1, cc-znp wasbroadcast: 0, cc-znp linkquality: 57, cc-znp securityuse: 0, cc-znp timestamp: 16055769, cc-znp transseqnumber: 0, cc-znp len: 5, cc-znp data: <Buffer 10 9a 00 00 00> }, cc-znp fcs: 173, cc-znp csum: 173 } +7s serialport:main _read reading +3ms serialport:bindings read +4ms serialport:unixRead Starting read +4ms cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 10, srcaddr: 38930, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 57, securityuse: 0, timestamp: 16055769, transseqnumber: 0, len: 5, data: <Buffer 10 9a 00 00 00> } +1ms zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +1ms zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +0ms serialport:unixRead waiting for readable because of code: EAGAIN +1ms serialport:poller Polling for "readable" +6ms serialport:poller received "readable" +11s serialport:bindings read +11s serialport:unixRead Starting read +11s serialport:unixRead Finished read 8 bytes +1ms serialport:main binding.read finished +11s cc-znp { sof: 254, cc-znp len: 3, cc-znp type: 'AREQ', cc-znp subsys: 'AF', cc-znp cmd: 'dataConfirm', cc-znp payload: { status: 183, endpoint: 1, transid: 3 }, cc-znp fcs: 114, cc-znp csum: 114 } +11s serialport:main _read reading +3ms serialport:bindings read +4ms serialport:unixRead Starting read +4ms cc-znp:AREQ <-- AF:dataConfirm, { status: 183, endpoint: 1, transid: 3 } +2ms zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object] +0ms zigbee-shepherd:msgHdlr IND <-- AF:dataConfirm, transId: 3 +1ms zigbee2mqtt:error 2018-11-29 21:36:33 Zigbee publish to '0x00124b000bf0725e', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null failed with error Error: AF data request fails, status code: 183. APS no ack. serialport:unixRead waiting for readable because of code: EAGAIN +3ms serialport:poller Polling for "readable" +8ms serialport:poller received "readable" +10s serialport:bindings read +10s serialport:unixRead Starting read +10s serialport:unixRead Finished read 30 bytes +1ms serialport:main binding.read finished +10s cc-znp { sof: 254, cc-znp len: 25, cc-znp type: 'AREQ', cc-znp subsys: 'AF', cc-znp cmd: 'incomingMsg', cc-znp payload: cc-znp { groupid: 0, cc-znp clusterid: 10, cc-znp srcaddr: 36978, cc-znp srcendpoint: 1, cc-znp dstendpoint: 1, cc-znp wasbroadcast: 0, cc-znp linkquality: 76, cc-znp securityuse: 0, cc-znp timestamp: 16119899, cc-znp transseqnumber: 0, cc-znp len: 5, cc-znp data: <Buffer 10 5e 00 00 00> }, cc-znp fcs: 154, cc-znp csum: 154 } +10s serialport:main _read reading +5ms serialport:bindings read +6ms serialport:unixRead Starting read +5ms cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 10, srcaddr: 36978, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 76, securityuse: 0, timestamp: 16119899, transseqnumber: 0, len: 5, data: <Buffer 10 5e 00 00 00> } +2ms zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +1ms zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +0ms serialport:unixRead waiting for readable because of code: EAGAIN +2ms serialport:poller Polling for "readable" +8ms

khzd commented 6 years ago

my mini DB {"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0012022f78","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1543522885,"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":"9qLpaadwaFy8kHOl"} {"id":64,"type":"EndDevice","ieeeAddr":"0x00124b000bf0725e","nwkAddr":63208,"manufId":0,"manufName":"LIVOLO\u0000\u0010TI0001 ","powerSource":"Mains (single phase)","modelId":"TI0001 ","epList":[6],"status":"offline","joinTime":null,"endpoints":{"6":{"profId":260,"epId":6,"devId":0,"inClusterList":[0,3],"outClusterList":[6],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":2},"attrs":{}}}}},"_id":"vzW78bhgIYIkCu6z"} {"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}} {"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0012022f78","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6],"status":"online","joinTime":1543523552,"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":"9qLpaadwaFy8kHOl"} {"id":64,"type":"EndDevice","ieeeAddr":"0x00124b000bf0725e","nwkAddr":63208,"manufId":0,"manufName":"LIVOLO\u0000\u0010TI0001 ","powerSource":"Mains (single phase)","modelId":"TI0001 ","epList":[6],"status":"offline","joinTime":null,"endpoints":{"6":{"profId":260,"epId":6,"devId":0,"inClusterList":[0,3],"outClusterList":[6],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":2},"attrs":{}}}}},"_id":"vzW78bhgIYIkCu6z"}

khzd commented 6 years ago

Now, if I try to change a state, zigbee2mqtt sends the command "ZCL OnOff" and Livolo answers "Success" but nothing really happens (reley doesn't change its state). Then zigbee2mqtt sends "Discover Attributes", Livolo answers "Unsupported General Command" then, zigbee2mqtt sends "Read Attributes" and Livolo answers its current state (on or off), it is the real state (it's only one thing which looks working in right way)

If a switch has more than one button, how should the command look like? It cannot just be on / off. There must be something else, like pointing to a specific button.

for 2 switchs you may have two diffrents commands, see the difference in devices.js for the dual switch xiaomi: { zigbeeModel: ['lumi.ctrl_ln2.aq1'], model: 'QBKG12LM', vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', supports: 'on/off, power measurement', fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, ], toZigbee: [tz.on_off], ep: {'left': 1, 'right': 2}, },

lych commented 6 years ago

My swith has only one button, but I suspect that they all have the same firmware