Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
456 stars 277 forks source link

New Livolo switch and malformed packet #127

Closed kirovilya closed 4 years ago

kirovilya commented 4 years ago

I try to use new Livolo switch https://aliexpress.ru/item/4000385782177.html

Wireshark log livolo_switch.zip

But in log I see malformed packet when Livolo Gateway send command to turn switch on/off. I try to repeat this action in converters:

    await entity.command('genOnOff', 'toggle', {}, {});
    const payload = {0x0001: {value, type: 0}};
    await entity.write('genPowerCfg', payload, {manufacturerCode: 0x1ad2, disableDefaultResponse: true});

And got result logs livolo_switch_herdsman.zip

I can not repeat payload data for command. What we can do for this?

kirovilya commented 4 years ago

I can’t choose the type of value to send an array of zeros

Koenkk commented 4 years ago

What is the ID in wireshark of the on off command?

kirovilya commented 4 years ago

image image

401 and down... 425, 448, 498

Koenkk commented 4 years ago

I've created an example for the on and off: https://github.com/Koenkk/zigbee-herdsman/commit/dec27ed0b027671167d49b134945b4830bfbea24#diff-8158e442a03e3ab9574aeb1a2259d330R609 (requires latest herdsman)

so this would translate to:

    await entity.command('genOnOff', 'toggle', {}, {});
    const payloadOn = {0x0001: {value: Buffer.from([1, 0, 0, 0, 0, 0, 0, 0]), type: 1}};
    const payloadOff = {0x0001: {value: Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]), type: 1}};
    await entity.write('genPowerCfg', payloadOn OR payloadOff, {manufacturerCode: 0x1ad2, disableDefaultResponse: true});
kirovilya commented 4 years ago

Thank you, I will try it tomorrow

kirovilya commented 4 years ago

It is better now, but image frame header not equal... switch not toggle :( livolo_switch_herdsman2.zip

Koenkk commented 4 years ago

Can you change https://github.com/Koenkk/zigbee-herdsman/blob/master/src/controller/model/endpoint.ts#L188 Zcl.Direction.CLIENT_TO_SERVER to Zcl.Direction.SERVER_TO_CLIENT, if this works I will provide a proper solution to pass it.

kirovilya commented 4 years ago

I've done everything. Now even the leading bits match. But switching does not work ... :( Livolo may have done something tricky at the pairing stage that the device does not accept commands... livolo_switch_herdsman3.zip

kirovilya commented 4 years ago

even reset the sequence numbers on the toggle command ...

Koenkk commented 4 years ago

Strange, it's really annoying that Livolo doesn't respect the ZCL, this makes it very hard to integrate.

sjorge commented 4 years ago

Strange, it's really annoying that Livolo doesn't respect the ZCL, this makes it very hard to integrate.

So I guess the Livolo devices are also not zigbee certified?

Koenkk commented 4 years ago

@sjorge definitely not, in terms of zigbee compliance, these are the worst devices I've ever seen.

stale[bot] commented 4 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.