Questions about hardware that can be controlled by Indigo (but not through the interfaces and plugins listed). If Indigo doesn't support some bit of hardware you're interested in, and you don't find a 3rd Party Plugin for it, add it to this forum. Be sure to include links to as much information as you can find about it.
Note: adding it here does not mean we're going to add it - in fact it's possible one of our 3rd party developers may decide to write a plugin for it. We add hardware/features based on a lot of different factors beyond just having a request for it.
For anyone wanting to write their own code to control the bulbs, I've attempted to document the comms protocol (based on packet captures) at my Github page (https://github.com/magicmonkey/lifxjs). I've got implementations in NodeJS of CLI programs to turn on / off the lights and change their colours, and also a tiny proof-of-concept web interface and a bridge onto MQTT to control the lights.
Next task is to use NodeRed to make it notify when I get an email or SMS, via MQTT. This is the fun I backed the project for!
If any kind of developer community built up, I'd happily contribute - all my research is on that Github repo (Protocol.md). I'm not really a JS programmer, but it's enough to see what's happening and I'd happily take pull requests.
Indy_Larry wrote:Thanks Du Lou. I hadn't seen this post, but I'll look into it. So far I'm liking these bulbs.
Indy_Larry wrote:Well after a long wait I just got one of my two lifx LED bulbs tonight. Going to try and make time to play with it and see what can be done with integrating it with Indigo.
var lifx = require('./lifx');
var util = require('util');
var step = 64;
var bulbs = [];
var bulbsFound = 0;
var currentHue = 0;
var saturation = 32767;
var luminance = 65535;
var whiteLevel = 0
var timing = 0;
var timer = 0;
setColors = function() {
for ( i = 0; i < bulbsFound; i++ ) {
lx.lightsColour((currentHue + i * 16384) & 0xFFFF, saturation, luminance, whiteLevel, timing, bulbs[i]);
//console.log('Bulb ' + i + ' hue set to ' + ((currentHue + i * 16384) & 0xFFFF));
}
currentHue = (currentHue + step) & 0xFFFF;
}
initBulbs = function() {
console.log('Initializing bulbs');
lx.lightsOn();
currentHue = 0;
setColors();
timer = setInterval(setColors, 500);
}
var lx = lifx.init();
lx.on('bulb', function(b) {
console.log('New bulb found: ' + b.name);
bulbs[bulbsFound++] = b;
if (4 == bulbsFound) {
initBulbs();
}
});
var stdin = process.openStdin();
process.stdin.setRawMode(true)
process.stdin.resume();
stdin.on('data', function (key) {
//process.stdout.write('Got key ' + util.inspect(key) + '\n');
switch (key[0]) {
case 0x31: // 1
for ( i = 0; i < bulbsFound; i++ ) {
console.log('bulb[' + i + ']: ' + bulbs[i].name);
}
break;
case 0x03: // ctrl-c
console.log("Closing...");
if (timer) {
clearInterval(timer);
}
lx.lightsOff();
lx.close();
process.stdin.pause();
//process.exit();
break;
}
});
Users browsing this forum: No registered users and 4 guests