Apollon77 / hap-controller-node

Node.js library to implement a HAP (HomeKit) controller
Mozilla Public License 2.0
54 stars 16 forks source link

Pairing Issue #23

Closed NebzHB closed 3 years ago

NebzHB commented 3 years ago

Dear,

i've tried to connect to a shelly 1, with a homekit firmware (https://github.com/mongoose-os-apps/shelly-homekit)

i've used the code of your exemple :

const {HttpClient, IPDiscovery} = require('hap-controller');

const discovery = new IPDiscovery();

const pin = '145-54-123';

discovery.on('serviceUp', (service) => {
  console.log('Found device!');
    console.log(service);
  const client = new HttpClient(service.id, service.address, service.port);
  client.pairSetup(pin).then(() => {
    console.log('Paired! Keep the following pairing data safe:');
    console.log(JSON.stringify(client.getLongTermData(), null, 2));
  }).catch((e) => console.error(e));
});
discovery.start();

and i receive that error "M4: Empty TLV" :

Found device!
{
  name: 'shelly1-A4CF12F41DFD',
  address: '192.168.1.254',
  port: 9000,
  'c#': 1,
  ff: 0,
  id: 'AD:93:A6:08:3B:29',
  md: 'Shelly1',
  pv: '1.1',
  's#': 1,
  sf: 1,
  ci: 8
}
M4: Empty TLV
mrstegeman commented 3 years ago

I wonder if this might be related to #22? Also, is the Shelly paired with any other device, e.g. an iOS device?

NebzHB commented 3 years ago

yes i can pair it with an iOS device without problem, then i unpair it (and reset homekit on the accessory to be sure) and i receive that problem. it seems to go fine with the lib you're contributor : https://github.com/jlusiardi/homekit_python

mrstegeman commented 3 years ago

What Node version are you using?

NebzHB commented 3 years ago

tried on nodejs 12 and nodejs 14

mrstegeman commented 3 years ago

This should be fixed in v0.5.0. See #32.