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/eq0y3y/philips_hue_bluetooth_developer_documentation/
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-47a2-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...
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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/eq0y3y/philips_hue_bluetooth_developer_documentation/
So I think something like this might work?
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...