You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I don't have any here to try with, but it'd make a cool app for Bangle.js

    I just googled it and found:

    https://www.reddit.com/r/Hue/comments/eq­0y3y/philips_hue_bluetooth_developer_doc­umentation/

    So I think something like this might work?

    function onoff(isOn) {
    var gatt;
    NRF.requestDevice({ filters: [{ name: 'Puck.js abcd' }] }).then(function(device) {
      console.log("found device");
      return device.gatt.connect();
    }).then(function(g) {
      gatt = g;
      console.log("connected");
      return gatt.startBonding();
    }).then(function() {
      console.log("bonded", gatt.getSecurityStatus());
      return gatt.getPrimaryService("932c32bd-0000-47­a2-835a-a8d455b859dd");
    }).then(function(service) {
      return service.getCharacteristic("932c32bd-0002­-47a2-835a-a8d455b859dd");
    }).then(function(characteristic) {
      return characteristic.writeValue(isOn ? 1 : 0);
    }).then(function() {
      gatt.disconnect();
      console.log("Done!");
    });
      gatt.disconnect();
    }).catch(function(e) {
      console.log("ERROR",e);
    });
    }
    

    But it might be you have to restart your light somehow first? They mentioned something about only being able to have one bonded device at a time...

About

Avatar for Gordon @Gordon started