You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am after advice on how to modify this Bluetooth-plugin such that it will reach to the BLE door opener that I have.
I have the following code that will toggle the door. But I am unsure as to what the best location and architecture is to put into the homebridge plugin.
Thanks, I am new to NodeJS and homebridge.
noble.on('discover', function(peripheral) {
console.log("hello world - discovered " +peripheral.advertisement.localName+ ": " + peripheral.uuid );
if(peripheral.uuid == "568c300974984c9b96ea051f02a46fea")
{
peripheral.connect(function(error) {
console.log('connected to peripheral: ' + peripheral.advertisement.localName);
console.log('advertising the following service uuid\'s: ' + peripheral.advertisement.serviceUuids);
peripheral.discoverServices(['1802'], function(error, services) {
for (var i in services) {
deviceInformationService =services[i];
deviceInformationService.discoverCharacteristics(['2a06'], function(error, characteristics) {
for (var i in characteristics) {
console.log(' ' + i + " Service UUDI:"+characteristics[i]._serviceUuid+ ' uuid: ' + characteristics[i].uuid +" name:"+characteristics[i].name + " ServiceProperties:"+characteristics[i].properties);
}
var alertLevelCharacteristic = characteristics[0];
console.log("The door just triggered, uncomment the lines below to actually make it open");
// alertLevelCharacteristic.write(new Buffer([0x00,0x80,0x54,0x03,0xb3,0xf6,0x35,0x84]), true, function(error) {
// console.log('Door toggled');
// });
peripheral.disconnect()
});
}
});
});
}
});
The text was updated successfully, but these errors were encountered:
Thanks for opening the issue here. I went through your code and I think the best solution would be to write your own plugin for Homebridge.
Reason is that this plugin is a relatively simple and straightforward mapping from HomeKit to BLE. If the control messages between the two don't match and need some translation logic in between (like in your case) it's not so easy to specify.
It's doable, but I think it would be easier in a separate project. You can mix this example with some code from here to handle the BLE layer and you'll be mostly removing stuff that's not needed.
Don't worry about node.js and just try it. You can google everything about it. I had no prior experience before doing this project... ;)
I am after advice on how to modify this Bluetooth-plugin such that it will reach to the BLE door opener that I have.
I have the following code that will toggle the door. But I am unsure as to what the best location and architecture is to put into the homebridge plugin.
Thanks, I am new to NodeJS and homebridge.
The text was updated successfully, but these errors were encountered: