Giter Club home page Giter Club logo

node-milight-promise's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-milight-promise's Issues

Refactoring

  • modernize the code, use ES6
  • consider using a queue - this may help to simplify the code, see #31

How to send commands to wifi box?

I have a V6 WiFi iBox with light and no other bulbs at the moment, but I cannot find a way to send commands to the bridge itself.

Checksum calculation seems wrong for connection payload

Hi,

The connection payload doesn't have the checksum (it's commented out because the 'calcChecksum' function is doing it). Or is it? ;)
calcChecksum does calculate a checksum, but only for the last 11 bytes. The resulting checksum is not 0x1E for the connection.

I can make a pull request for you, but you might be easier off fixing it the way you like it. What i did:

        self._rpc([
          0x20, 0x00, 0x00, 0x00, 0x16, 0x02, 0x62, 0x3A,
          0xD5, 0xED, 0xA3, 0x01, 0xAE, 0x08, 0x2D, 0x46,
          0x61, 0x41, 0xA7, 0xF6, 0xDC, 0xAF, 0xD3, 0xE6,
          0x00, 0x00, 0x1E
        ]).then(function (response) {
        // ...

And in calcChecksum i merely changed the if to:

  if (bytes.length >= 11 && bytes.length != 27) {

Which now neglects the connection payload and gives it the appropriate checksum.
All in milight-v6-mixin.js obviously.

I found this while debugging the bytes send. I can't get my ibox2 to turn on/off lights with this library. I am getting packet responses so there is nothing wrong with connecting. Just with the packets it seems, but i'm still investigating that. This one bug is worth a fix imho, even though it didn't seem to bother connecting (works before and after this change).

Best regards,
Mark

Programmatic light bulb syncing

Dear Marcus,

I'm a newbie in the Milight world, and I'm wondering if this node can be used to programmatically link my Milight light bulbs to a specified zone?

Current setup without NodeJs

Milight App --> V6 Wifi bridge (iBox 2) --> light bulb

When powering up a light bulb, you have 5 seconds in the Milight App to press a zone number X (from 1 to 4). From that moment on, the light bulb is linked to zone number X.

Remark: when another app is used (e.g. on another smartphone), another zone can be setup for the same light bulb.

New setup with NodeJs

Web application --> Node-Milight-Promise --> V6 Wifi bridge (iBox 2) --> light bulb

I would like to simulate the same behavious, without having to use my original Milight app (or remote control). So when I press some button in my own web application (e.g. Node-Red), I want to let the Node-Milight-Promise node know that the light bulb (that is currently starting up) needs to be linked to zone X.

It is not clear to me if this is currently possible with this node. If not, is this perhaps somewhere on the roadmap?

Thanks in advance !!!!!
Bart Butenaers

YL5 LED strip controller support

It appears as if the Milight YL5 LED strip controller should be supported by this package but I'm having problems getting it to work.

The discoverBridges function does discover the device as v6 with a name of "HF-LPT230" but no other commands I've tried work. I always get "no response timeout" errors.

The device is listening on UDP 5987 and on TCP 80, although I get a 404 not found trying to open the latter through HTTP.

I was also able to find that as soon as it's on wi-fi, it establishes a permanent connection to "cm2.xlink.cn", regardless if it's "activated" in the Milight Cloud app or not. From what I could gather, it would appear that both the YL5 and the Milight Cloud app establish a socket connection with XLink cloud and that the commands are sent and received through that socket. Apart from device discovery and wi-fi connection, everything else going on between the app and the device is done through the cloud but instead of just sending individual API commands through HTTP, it does it through the socket connection. Maybe all of this is already known but I thought I would mention what I was able to find.

Thoughts? Ideas?

V6: RGB BULBS SINGLE CHANNEL/ZONE

Hi,
for V6: RGB BULBS SINGLE CHANNEL/ZONE

RgbCommand.prototype.on = function(zone) {
return [0x31, 0x00, 0x00, 0x05, 0x02, 0x09, 0x00, 0x00, 0x00, 0x01]
};

and

RgbCommand.prototype.off = function(zone) {
return [0x31, 0x00, 0x00, 0x05, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x01]
};

parameter zone is never used. Is that right?

thx
Carsten

Inconsistent colors across commands

First of all, the library is great, thanks so much!

I've been playing around with the different command sets (fullcolor vs fullcolor8zone specifically) and have noticed some inconsistencies in the coloring. On fullcolor, hue 0 is about 10 points closer to blue than it's supposed to be, however on fullColor8Zone, hue 42 (yellow) is about 10 points too green. I've tried on several models of bulbs.

I'll be happy to jump in and help debug this, but figured I'd make sure it wasn't a known (or even expected) behavior first.

changing the delay before light turns on after hitting a switch

Hey guys,
I did not know where to post this so I am hoping that you won't be mad and even might have a solution.
Right now when I turn on my milights with my phone it works instantaneously. But as soon as I use a switch to turn on the "electricity" it waits roughly 200ms before it turns on. Somewhere I read that this is intended and is used to "listen" for a command after a power cut or something. However, I don't want this delay. Anybody experienced the same or know a solution to this?
Regards.
Tim

White bulb/stripe control

Hi,
is it right, that I can control only RGBW bulbs/stripes?!
I see in the App "EVE" only the 4 zones of the RGBW controller.
Is it possible to Add also the 4 zones of the Single/Dual White controller?
thanks
Oggy

Second bridge doesn't work

First Limitless LED bridge ibox2 works like a charm. Yesterday I added a second ibox2 bridge - nothing.

my config.json:

{
                "platform":"MiLight",
                "name":"MiLight",
                "bridges": [
                        {
                        "ip_address": "192.168.10.105",
                        "version": "v6",
                        "lights": {"fullColor": ["Room1"],
                                "rgbw": ["Room1A","Room2","Room3"]},
                        "repeat": 1,
                        "delay": 100
                        }, {
                        "ip_address": "192.168.10.106",
                        "lights": {"rgbw": ["Test"]}
                        }

homebridge DEBUG:

[2017-10-19 22:43:03] [MiLight] [Test] Setting power state to on
[2017-10-19 22:43:03] [MiLight] [Test] Setting brightness to 100
[2017-10-19 22:43:03] [MiLight] [Test] Ommiting 'on' command as we've sent it to this bulb most recently
2017-10-19T20:43:03.426Z Milight: bytesSent=3, buffer=[0x45,0x00,0x55]
2017-10-19T20:43:03.536Z Milight: bytesSent=3, buffer=[0x4E,0x19,0x55]
[2017-10-19 22:43:05] [MiLight] [Test] Setting power state to off
2017-10-19T20:43:05.136Z Milight: bytesSent=3, buffer=[0x46,0x00,0x55]
[2017-10-19 22:38:04] [MiLight] [Room2] Setting power state to on
[2017-10-19 22:38:04] [MiLight] [Room2] Ommiting 'on' command as we've sent it to this bulb most recently
[2017-10-19 22:38:04] [MiLight] [Room2] Setting brightness to 100
2017-10-19T20:38:04.094Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x62,0x00,0x00,0x05,0x00,0x31,0x00,0x00,0x07,0x03,0x01,0x00,0x00,0x00,0x01,0x00,0x3D]
2017-10-19T20:38:04.149Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x05,0x00], remote=192.168.10.105
2017-10-19T20:38:04.250Z Milight: ready for next command

If I add version v6 in the second bridge:
[2017-10-19 21:49:27] [MiLight] [Test] Setting power state to on
[2017-10-19 21:49:27] [MiLight] [Test] Setting brightness to 100
Unhandled rejection Error: no response timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-milight/node_modules/node-milight-promise/src/milight-v6-mixin.js:123:26)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

Best practice regarding Milight instance

Hi !

I'm the founder of Gladys ( https://github.com/GladysProject/gladys ), and I'm using your module in my Gladys-milight module.

As Gladys is a long-running program, I would like to know what is your point of view regarding the life cycle of the Milight object ( see below ). Should I rather create this object once when Gladys start, and use it forever, or should I create an instance of this object each time I want to send a command to a lamp ?

I think keeping it forever can be a good idea for maximum performance, but maybe we can lose the connection with the bridge on the long-term ? What's your point of view ? :)

    var light = new Milight({
        ip: 'IP' ,
        delayBetweenCommands: 75,
        commandRepeat: 2
    });

Thanks for your module !

Quick feedback: Your README documentation is great, but you should specify that pieces of code you are showing are in javascript, so the markdown engine of Github can highlight your code better :)

Unable to connect to Milight YT1

I am unable to control a Mi-Light YT1 bridge.

What I know:

I tried to run the following examples, no success

[tmaurer@host node-milight-promise]$ curl 192.168.178.22
<HTML><HEAD><TITLE>401 Unauthorized</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>401 Unauthorized</H4>
Authorization required.
</BODY></HTML>

[tmaurer@host node-milight-promise]$ node examples/discover-bridges
[]

[tmaurer@host node-milight-promise]$ node examples/discover-bridges-v6
[]

[tmaurer@host node-milight-promise]$ grep ip: examples/example*
examples/example-8zone-v6.js:    ip: "192.168.178.22",
examples/example-bridge-v6.js:    ip: "192.168.178.22",
examples/example-dual-white.js:        ip: "192.168.178.22",
examples/example-dual-white-v6.js:    ip: "192.168.178.22",
examples/example-full-colour-interleaved.js:    ip: "192.168.178.22",
examples/example-full-colour-interleaved.js:  ip: "192.168.178.22",
examples/example-full-colour.js:    ip: "192.168.178.22",
examples/example-full-colour-link.js:    ip: "192.168.178.22",
examples/example-rgbw.js:        ip: "192.168.178.22",
examples/example-rgbw-v6.js:    ip: "192.168.178.22",

[tmaurer@host node-milight-promise]$ node examples/example-8zone-v6.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
[tmaurer@host node-milight-promise]$ node examples/example-8zone-v6.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

[tmaurer@host node-milight-promise]$ node examples/example-bridge-v6.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

[tmaurer@host node-milight-promise]$ node examples/example-dual-white-v6.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
[tmaurer@host node-milight-promise]$ node examples/example-dual-white.js 
Invocation of asynchronous Milight commands done
All command have been executed - closing Milight

[tmaurer@host node-milight-promise]$ node examples/example-full-colour-interleaved.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

[tmaurer@host node-milight-promise]$ node examples/example-full-colour.js 
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

[tmaurer@host node-milight-promise]$ node examples/example-full-colour-link.js 
Invocation of asynchronous Milight commands done
All command have been executed - closing Milight
Unhandled rejection Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Unhandled rejection Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Unhandled rejection Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

[tmaurer@host node-milight-promise]$ node examples/example-rgbw.js 
Invocation of asynchronous Milight commands done
All command have been executed - closing Milight

[tmaurer@host node-milight-promise]$ node examples/example-rgbw-v6
Error: no response timeout
    at Timeout._onTimeout (/home/tmaurer/tmp/ml/node_modules/node-milight-promise/src/milight-v6-mixin.js:128:26)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Queue

I've been inspecting the code and I think I figured out how it works. The _synchronize function is building up some kind of queue with promises right? Why do you use this instead of creating an actual queue that s fetches commands when the previous one is done? This would make the code way more readable.

So something like:

const queue = [];
let active = false;

function sendCommand(cmd) {
  queue.push(cmd);
    
  if(!active) {  
    setActive(true);
  }
}

function setActive(bool) {
  active = bool;
  
  if(active) {
    console.log("Activated");
  
    processCommands();
  } else {
    console.log("Deactivated");
  }
}

function processCommands() {
  if(queue.length > 0) {
    let cmd = queue.shift();
  
    processCommand(cmd).then(processCommands)
  }
  else {
    setActive(false);
  }
}

function processCommand(cmd) {
  return new Promise((resolve, reject) => {
    setTimeout(function() {
      console.log(cmd);
      
      resolve();
    }, 100);
  });
}

sendCommand(1);
sendCommand(2);
sendCommand(3);
sendCommand(4);

setTimeout(function() {
  sendCommand(5);
}, 1000);

Fiddle here: https://jsfiddle.net/wgogdb12/

Unhandled rejection Error: no response timeout

2017-07-18T12:37:59.873Z Milight: bytesSent=27, buffer=[0x20,0x00,0x00,0x00,0x16,0x02,0x62,0x3A,0xD5,0xED,0xA3,0x01,0xAE,0x08,0x2D,0x46,0x61,0x41,0xA7,0xF6,0xDC,0xAF,0xD3,0xE6,0x00,0x00,0xC9]
Unhandled rejection Error: no response timeout
    at null._onTimeout (C:\Users\marcus\PIDEV\pimatic-xx\node_modules\pimatic-milight-reloaded\node_modules\node-milight-promise\src\milight-v6-mixin.js:123:26)
    at Timer.listOnTimeout (timers.js:92:15)

Need help on how to use the legacy bridge with command2

Hallo everyone

Im quite new to this and i need some help

I have a old milight bridge and it seems i cannnot get this to work with just installing and running node server.js

so i tried to make a test.js with this inside:

var Milight = require('node-milight-promise').MilightController;
var commands = require('node-milight-promise').commands2;

// Important Notes:
// Instead of providing the global broadcast address which is the default, you should provide the IP address
// of the Milight Controller for unicast mode. Don't use the global broadcast address on Windows as this may give
// unexpected results. On Windows, global broadcast packets will only be routed via the first network adapter. If
// you want to use a broadcast address though, use a network-specific address, e.g. for `192.168.0.1/24` use
// `192.168.0.255`.

var light = new Milight({
		ip: "255.255.255.255",
		delayBetweenCommands: 75,
		commandRepeat: 2
	}),
	zone = 1;

light.sendCommands(commands.rgbw.on(zone), commands.rgbw.whiteMode(zone), commands.rgbw.brightness(100));
light.pause(1000);

light.sendCommands(commands.rgbw.off(zone));
light.pause(1000);

// Setting Hue
light.sendCommands(commands.rgbw.on(zone));
for (var x = 0; x < 256; x += 5) {
	light.sendCommands(commands.rgbw.hue(x));
	if (x === 0) {
		commands.rgbw.brightness(100)
	}
	light.pause(100);
}
light.pause(1000);

light.sendCommands(commands.rgbw.off(zone));
light.pause(1000);

// Back to white mode
light.sendCommands(commands.rgbw.on(zone), commands.rgbw.whiteMode(zone));
light.pause(1000);

// Setting Brightness
light.sendCommands(commands.rgbw.on(zone));
for (var x = 100; x >= 0; x -= 5) {
	light.sendCommands(commands.rgbw.brightness(x));
	light.pause(100);
}
light.pause(1000);

light.sendCommands(commands.rgbw.off(zone));
light.pause(1000);

light.close().then(function () {
	console.log("All command have been executed - closing Milight");
});
console.log("Invocation of asynchronous Milight commands done");

and this is working :) - hurray (the led's changing colors)
So how can i include this instead ???

Please help a newbie :)

thanks in advise

Missing brightness function for CCT (WhiteCommand)

Hi,

Just curious where the brightness function is for the WhiteCommand object, it's not there.
I did notice that CCT bulbs in the milight app only do have a brightness up/down (not a slider) and that up/down is in WhiteCommand. Does this mean there simply is no brightness command with a given percentage for those bulbs?

Can somebody help turn zone 5 on/off?

Can somebody give me an example on how I turn on zone 5 using this package?

I know this is not "just" a command line, but is there a "simple" way to just do on/off functions?

I am trying to include 8-zone support in Node-Red but that seems like it's impossible, as only 4 zones are supported with all available packages in the "Palette/Install" section.

node-milight-promise not controlling bridge

@mwittig Hi Marcus, I have spent a few nights trying to isolate a problem I am experiencing setting up control between the node-milight-promise module and a v6 iBox2 Milight Lamp/Bridge. The discovery script returns the correct information re. the v6 version and its ip but other than that nothing seems to be working - Ive tried each example command.

Can you confirm if there needs to be anything specific in the iBox2 configuration itself. The firmware of the iBox2 bridge is 1.008 web 1.012. Its configured to operate in STA mode and I have tried both UDP and TCP-Server and TCP-Client (?) configurations (neither work). The port listed in the web config for the bridge is 8899.

when i run any of the example scripts I get a response

"Invocation of asynchronous Milight commands done
All command have been executed - closing Milight"

So its nice getting those messages - but it would be even nicer if something else happened but nothing is :)

I am running the latest version of node-milight-promise.

I'm stuck! What next?

Thx Pauleec

Dual White v6 commands not working

I have a Milight 6W DUAL WHITE LED Lamp E27 linked to a v6 bridge, but when using the white commands (for example the example-dual-white-v6.js script) the bulb does not react, when using the new mobile app (specifically the 10th remote in the remote selector), it does work. Could it be that the commands are not correct? Anyone else having issues with the dual white bulbs? RGBW is working fine by the way!

Inconsistency in rgbw and full-color

Hey there. First off, awesome library - gamechanger for me.

I've got a v6 bridge (this one), and I have one RGBW/WW/CW Full Color and one RGBW Color bulb attached to it. When I run the same rgb commands for each, I get different results.

var light = new Milight({
    ip: "10.0.0.20",
    type: 'v6'
  }),
  zone = 1;

// this turns the bulb blue - seems incorrect?
light.sendCommands(commands.fullColor.on(zone), commands.fullColor.whiteMode(zone), commands.fullColor.brightness(zone, 100));
light.pause(1000);
light.sendCommands(commands.fullColor.rgb(zone, 200, 100, 100));

// this turns the light red - seems correct
light.sendCommands(commands.rgbw.on(zone), commands.rgbw.whiteMode(zone), commands.rgbw.brightness(zone, 100));
light.pause(1000);
light.sendCommands(commands.rgbw.rgb(zone, 200, 100, 100));

It's possible I'm missing something here, but I thought I'd ask. Any ideas?

Seeking help

Hi, I was wondering if I could seek some help with the node-milight-promise.

I have followed the guide (https://community.smartthings.com/t/milights-limitless-led-v6-habridge-node-google-home/95490/6) and managed to install NodeJS & HA-Bridge but encountered problem with node-milight-promise. Followings are the steps I took;

  1. Setting up rasberry pie 3B, installed NodeJS & HA-Bridge.
    "node -v" returns v9.4.0.
    can access HA-Bridge Web Interface.

  2. Installed node-milight-promise within "habridge" folder using "npm install node-milight-promise", which created "/habridge/node_modules/node-milight-promise".

  3. Copied Yuriy's script (http://codecorner.galanter.net/2017/02/24/full-control-of-your-limitless-ledmilight-v6-bulbs-from-amazon-echo/) under "/habridge/led.js" for testing purposes.
    only changing ip to my Wifi Bridge ip address.

  4. Testing "nodejs led.js 1 off" within "habridge" folder; Zone 1 off.

  5. Received msg;
    "Invocation of asynchronous Milight commands done"
    "All command have been executed - closing Milight"

  6. No response from LEDs.

*** I can control LEDs via app. I can scan WiFi Bridge via LimitlessLED admin tool for windows.
*** LimitlessLED Wifi Bridge, model no. iBox2 (the one w/ black strip, I am guessing this is V6?)
*** This is best I can provide in my knowledge and skills, please let me know if there is a log I could access & provide?

The Question is what am I doing wrong, and is there any way I can test if Wifi Bridge itself or node-milight-promise is working properly? I am not sure where it went wrong.

Is node-milihgt-promise sending commands properly?
Did I make mistake invoking commands?
Did I make mistake installing node-milight-promise?

Any help would be greatly appreciated~!

RGBWW Saturation Control / New v6 Bridge

Looking at the LimitlessLED strip controllers page, there's a new one (as of 2016) that says it'll run both the RGB chips and the white chips at the same time, giving us saturation control.

Do you think the LimitlessLED WiFi Bridge v5.0 can handle RGB + white at the same time? And if so, would this library handle it? Otherwise we're waiting for the WiFi Bridge v6.0 I assume.

4 COLOR CHANNELS WRGB, 4 Colour RGBW LED Strip controller (with Saturation control – new FOR 2016!) – max.288W (72W per channel x4) (max. 6.0 Amps @ 12V per channel) this new WRGB controller is same as the 4 color controller above except this controller forces the remote to use its 4 zone buttons instead as 4 individual brightness controls to set the brightness of each white/red/green/blue independently, giving some awesome white saturation control. The way you link this new WRGB controller is using the master ON button on both the RGBW remote and the iOS App for the wifi bridge – the 4 zones on the remote control each of the colors and brightness individually.

Buffer() is deprecated

LTS prompts the following deprecation warning

(node:17832) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

new milight v3 / limitless v6 hubs...

any progress updating for the new hubs? I found the api for the new hubs on limitlessled wesite if it helps..

Section 1. Manual Web Browser Wifi Bridge v6 Setup.
Connect Phone to Milight AccessPoint
Use Phone Web Browser to http://10.10.100.254
Username: admin
Password: admin
Work Mode: change to STA mode, press Save
STA Setting: Scan for your Home Wifi Router
Encryption Method: WPA2PSK
Encryption Algorithm: AES
Password: enter your home wifi router password here.
Obtain an IP address automatically: Enable
Restart: Click Ok
Now put your phone back on your home wifi network, and open the app, it should see the wifi bridge, assuming you entered your wifi password correctly a few steps back. :)
Section 2. Searching for LimitlessLED v6 Bridge/s on the LAN.
We have a Windows App for this called LimitlessLED Admin tool v5/v6
If you are building your own Program, use the following (If you want more exact C# code for this, email us)
UDP.IP = “255.255.255.255″; // IP.Broadcast
UDP.PORT = 48899;
UDP.SendBytes(UTF8.GetBytes(“HF-A11ASSISTHREAD”)); // v6 Bridge (for v5 use “Link_Wi-Fi”)
receiveBytes = UDP.Receive();
response = UTF8.GetString(receiveBytes);
//returns IP address of the wifi bridge, the unique MAC address, and the name(which is always the same)
// 10.1.1.27,ACCF23F57AD4,HF-LPB100
// 10.1.1.31,ACCF23F57D80,HF-LPB100
Section 3. Wifi Bridge v6 Protocol
UDP.IP = “255.255.255.255″; (or direct Wifi Bridge IP Address)
UDP.PORT = 5987;
UDP.SEND (hex bytes, see below)
SN = Sequential Hex Number (Sequence Number) 0×01 -> 0xFF
WB = Wifi Bridge ID 0×01 -> 0xFF
RGBW/WW/CW Commands
UDP Hex Send Format: 80 00 00 00 11 {WifiBridgeID} 00 00 {SequenceNumber} 00 {COMMAND} {ZONE NUMBER} 00 {Checksum}
UDP Hex Response: 88 00 00 00 03 00 {SequenceNumber} 00
List of {COMMAND}s:
31 00 00 08 04 01 00 00 00 = Light ON
31 00 00 08 04 02 00 00 00 = Light OFF
31 00 00 08 04 05 00 00 00 = Night Light ON
31 00 00 08 05 64 00 00 00 = Dual White Light ON (Color RGB OFF)
31 00 00 08 01 BA BA BA BA = Set Color to Blue (BA) (FF = Red, D9 = Lavender, BA = Blue, 85 = Aqua, 7A = Green, 54 = Lime, 3B = Yellow, 1E = Orange)
31 00 00 08 02 SS 00 00 00 = Saturation (SS hex values 0×00 to 0×64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
31 00 00 08 03 BN 00 00 00 = BrightNess (BN hex values 0×00 to 0×64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
31 00 00 08 05 KV 00 00 00 = Kelvin (KV hex values 0×00 to 0×64 : examples: 00 = 2700K (Warm White), 19 = 3650K, 32 = 4600K, 4B, = 5550K, 64 = 6500K (Cool White))
31 00 00 08 06 MO 00 00 00 = Mode Number (MO hex values 0×01 to 0×09 : examples: 01 = Mode1, 02 = Mode2, 03 = Mode3 .. 09 = Mode9)
31 00 00 08 04 04 00 00 00 = Mode Speed Decrease–
31 00 00 08 04 03 00 00 00 = Mode Speed Increase++
3D 00 00 08 00 00 00 00 00 = Link (Sync Bulb within 3 seconds of lightbulb socket power on)
3E 00 00 08 00 00 00 00 00 = UnLink (Clear Bulb within 3 seconds of lightbulb socket power on)
Wifi Bridge iBox LED Lamp {COMMAND}s (Zone Number = 0×01)
31 00 00 00 03 03 00 00 00 = Wifi Bridge Lamp ON
31 00 00 00 03 04 00 00 00 = Wifi Bridge Lamp OFF
31 00 00 00 04 MO 00 00 00 = Mode Number (MO hex values 0×01 to 0×09 : examples: 01 = Mode1, 02 = Mode2, 03 = Mode3 .. 09 = Mode9)
31 00 00 00 03 01 00 00 00 = Mode Speed Decrease–
31 00 00 00 03 02 00 00 00 = Mode Speed Increase++
31 00 00 00 01 BA BA BA BA = Set Color to Blue (BA) (FF = Red, D9 = Lavender, BA = Blue, 85 = Aqua, 7A = Green, 54 = Lime, 3B = Yellow, 1E = Orange)
31 00 00 00 03 04 00 00 00 = Set Color to White (is ignored when Lamp is OFF, it does NOT turn the Lamp ON)
31 00 00 00 02 BN 00 00 00 = BrightNess (BN hex values 0×00 to 0×64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
Valid List for {ZONE NUMBER}
0×00 All
0×01 Zone1
0×02 Zone2
0×03 Zone3
0×04 Zone4
Checksum:
RGBW/WW/CW Checksum Byte Calculation is the sum of the last 11 bytes before end of the UDP packet. The checksum is then added to the end of the UDP message.
e.g. SUM((31 00 00 08 04 01 00 00 00)(command) 01(zone) 00) = 3F(chksum)
EXAMPLES
LimitlessLED Wifi Bridge Light ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 00 03 03 00 00 00)(cmd) 01(zone) 00 38(chksum) UDP response: (88 00 00 00 03 00 SN 00)
LimitlessLED Wifi Bridge Light OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 00 03 04 00 00 00)(cmd) 01(zone) 00 39(chksum) UDP response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 1 ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 01(zone) 00 3F(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone1 OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 01(zone) 00 40(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 2 ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 02(zone) 00 40(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone2 OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 02(zone) 00 41(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 3 ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 03(zone) 00 41(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone3 OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 03(zone) 00 42(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 4 ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 04(zone) 00 42(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone4 OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 04(zone) 00 43(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW ZoneALL ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 00(zone) 00 3E(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW ZoneALLOFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 00(zone) 00 3F(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 1 Link 80 00 00 00 11 WB 00 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 01(zone) 00 46(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 2 Link 80 00 00 00 11 WB 00 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 02(zone) 00 47(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 3 Link 80 00 00 00 11 WB 00 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 03(zone) 00 48(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 4 Link 80 00 00 00 11 WB 00 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 04(zone) 00 49(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 1 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 01(zone) 00 47(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 2 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 02(zone) 00 48(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 3 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 03(zone) 00 49(chksum) response: (88 00 00 00 03 00 SN 00)
RGBW/WW/CW Zone 4 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 04(zone) 00 4A(chksum) response: (88 00 00 00 03 00 SN 00)
Keep Alive Messages
KEEP ALIVES (Every 5 seconds) Wifi Bridge 1: D0 00 00 00 02 (WB) 00 (response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
KEEP ALIVES (Every 5 seconds) Wifi Bridge 1: D0 00 00 00 02 1D 00 (response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
KEEP ALIVES (Every 5 seconds) Wifi Bridge 2: D0 00 00 00 02 7C 00 (response: D8 00 00 00 07 (AC CF 23 F5 7D 80) 01)
Click Search for Devices:
UDP.Send (255.255.255.255:5987) Bytes: 10 00 00 00 24 02 ee 3e 02 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64
GET ALL WIFI BRIDGE CLOUD KEYS on LAN using UDP
UDP.IP = “255.255.255.255″
UDP.port = 5987
UDP.SEND hex bytes: 10 00 00 00 0A 02 D3 E6 01 (AC CF 23 F5 7A D4)(MAC address)
UDP.Response: 18 00 00 00 40 02 (AC CF 23 F5 7A D4)(mac) 00 20 (985b157bf6fc43368a63467ea3b19d0d)(ASCII Tokenkey) 01 00 01 17 63 00 00 05 00 09 (xlink_dev)(ASCII) 07 5B CD 15
UDP.SEND hex bytes: 20 00 00 00 16 02 62 3A D5 ED A301 AE 08 2D 46 61 41 A7 F6 DC AF D3 E6 00 00 1E
UDP.Response: 28 00 00 00 11 00 02 (AC CF 23 F5 7A D4)(mac) 69 F0 3C 23 00 01 05 00 00
UDP.SEND hex bytes: D0 00 00 00 02 05(WB) 00 (response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
example2: 10 00 00 00 0A 02 FE E7 01 (AC CF 23 F5 7A D4)(MAC address)
example3: 10 00 00 00 0A 02 FE 51 01 (AC CF 23 F5 7D 80)(MAC address)
Section 4. Smart Link Setup Services
** Warning only have one wifi bridge powered up at a time when setup using smart link (In case you have more than one in your home) **
Smart-link is all about getting your brand new wifi bridge onto your home wifi router network.
SmartLink saves the user time during the setup phase, from having to switch to the bridge in the wifi settings to set it up. Instead it is done using a sync button underneath the Wifi Bridge v6 and an app.
If you want to build smart-link into your own app.
SMART LINK UDP port 49999 Default Password “8888″
UDP.IP = “10.1.1.255″
UDP.PORT = 49999
UDP.Send Whilst Waiting: 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
Section 5. Cloud Remote Internet access Services
If you want to build an app that controls the lights over the internet, more information will be made available here.
http://www.xlink.cn/
So that enterprises have the power of things. Cloud-to-cloud platform, easily and securely connected devices, rapid development of Internet of things applications,
In the Internet of Things data extraction value.
Default Cloud Server: Amazon Web Services Cloud ec2-52-63-118-215.ap-southeast-2.compute.amazonaws.com [52.63.118.215] cm2.xlink.cn
Default Cloud Port: 23778
Cloud Server Login TCP.Send: 10 00 00 00 1A 02 4B 4B 59 DB 00 10 32 32 30 66 61 32 61 66 66 65 36 63 61 32 30 30 00 00 3C
Cloud TCP.Read Login Response: 18 00 00 00 02 00 00
Cloud Keep Alive: TCP.Send: D0 00 00 00 00
Cloud Keep Alive: TCP.Read: D8 00 00 00 00
Cloud TCP sent: A0 00 00 00 07 69 F0 3D F3 00 0B 00
Cloud response: A8 00 00 00 13 69 F0 3D F3 00 0B 00 07 00 09 x l i n k _ d e v
Cloud TCP sent:
Cloud response: 6{“device_id”:1777352179,”type”:”offline”,”operator”:0}

Enhancement: Support from v6 Bridge led

The v6 bridge also provides a RGB led which can be controlled from the app. Any plans to include support for this bridge? Basically, this led always lights up when the bridge is powered up. I would like to switch it off in such cases w/o the need to open the app. Bridge led control is described in http://www.limitlessled.com/dev/ - thanks a lot for your efforts.

How to change bulb temp?

Is it possible to change the bulb tempature, I tried whiteTempature but that doesn't seem to work.

Changing light status works, but slowly starts to respond less till i restart the app

Hi,

I think i need to clarify this a little.
I'm making a MiLight hub proxy so that it can be used with Samsung SmartThings.

The code i have right now:
note: heavily work in progress! I'm just hacking it together at the moment to get things working.

'use strict'

const milightmodule = require('node-milight-promise');
const Milight = milightmodule.MilightController;
const commands = milightmodule.commandsV6;
const discover = milightmodule.discoverBridges;
const express = require('express')
const app = express()
const bodyParser = require('body-parser')

let light = new Milight({
  ip: '10.0.3.101',
  type: 'v6'
});

/*
light.close().then(function () {
  console.log("All command have been executed - closing Milight");
});
console.log("Invocation of asynchronous Milight commands done");
*/

app.use(bodyParser.json());

function getCommandsObjectByType(type) {
  if (type == 'rgbw') {
    return commands.fullColor;
  } else if (type == 'cct') {
    return commands.white;
  }

  return commands.rgbw;
}

function handleSwitch(res, data, params, com) {
  if (data.status == 'on') {
    light.sendCommands(com.on(params.group));
  } else {
    light.sendCommands(com.off(params.group));
  }
  res.status(200).json({})
}

function handleBrightness(res, data, params, com) {
  
  console.log('Handle brightness')

  let level = parseInt(data.level);
  light.sendCommands(com.brightness(params.group, level))
  res.status(200).json({})
}

app.post('/gateways/:addr/:type/:group', (req, res) => {
  let com = getCommandsObjectByType(req.params.type);

  console.log('specific post')
  console.log(req.body)
 
  if (typeof req.body.status !== 'undefined') {
    handleSwitch(res, req.body, req.params, com);
  } else if (typeof req.body.level !== 'undefined') {
    handleBrightness(res, req.body, req.params, com);
  } else {
    console.log('  ' + typeof req.body.status)
  }

});

app.post('*', (req, res) => {
  console.log('fallback post')
  console.log(req.body)
  res.status(400).json()
});

app.listen(3000, () => {
  console.log('MiLight proxy hub is listening.')
})

That is the whole app at the moment. It's going to be on github in this repository sometime soon: https://github.com/markg85/MiLightNodeProxy
It allows me to set the light status and brightness, so far so good. And, the most awesome part, it really works on smartthings (which i import in Google Home to control the bulbs, that really works)!

I have 2 issues though.

  1. After some time the commands just start are not working anymore. This seems to point at a session timeout. Here is the output of the commands while it isn't working.
specific post
{ status: 'on' }
2017-12-15T15:48:29.195Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x6E,0x00,0x00,0x25,0x00,0x31,0x00,0x00,0x01,0x01,0x07,0x00,0x00,0x00,0x01,0x00,0x3B]
2017-12-15T15:48:29.218Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x25,0x01], remote=10.0.3.101
2017-12-15T15:48:29.318Z Milight: ready for next command
specific post
{ status: 'on' }
2017-12-15T15:48:29.496Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x6E,0x00,0x00,0x26,0x00,0x31,0x00,0x00,0x08,0x04,0x01,0x00,0x00,0x00,0x01,0x00,0x3F]
2017-12-15T15:48:29.525Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x26,0x01], remote=10.0.3.101
2017-12-15T15:48:29.625Z Milight: ready for next command
specific post
{ status: 'on' }
2017-12-15T15:48:29.784Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x6E,0x00,0x00,0x27,0x00,0x31,0x00,0x00,0x08,0x04,0x01,0x00,0x00,0x00,0x02,0x00,0x40]
2017-12-15T15:48:29.802Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x27,0x01], remote=10.0.3.101
2017-12-15T15:48:29.903Z Milight: ready for next command

And right after it reconnects, the lights work again:

2017-12-15T15:49:12.870Z Milight: bytesSent=27, buffer=[0x20,0x00,0x00,0x00,0x16,0x02,0x62,0x3A,0xD5,0xED,0xA3,0x01,0xAE,0x08,0x2D,0x46,0x61,0x41,0xA7,0xF6,0xDC,0xAF,0xD3,0xE6,0x00,0x00,0x1E]
2017-12-15T15:49:12.984Z Milight: bytesReceived=22, buffer=[0x28,0x00,0x00,0x00,0x11,0x00,0x02,0xF0,0xFE,0x6B,0x26,0x15,0x6A,0x5F,0xB8,0x80,0x30,0x00,0x01,0x9B,0x00,0x00], remote=10.0.3.101
2017-12-15T15:49:13.084Z Milight: ready for next command
2017-12-15T15:49:13.084Z Milight: Session Id: 0x9B,0x00
specific post
{ status: 'off' }
2017-12-15T15:49:38.578Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x9B,0x00,0x00,0x29,0x00,0x31,0x00,0x00,0x08,0x04,0x02,0x00,0x00,0x00,0x01,0x00,0x40]
2017-12-15T15:49:38.688Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x29,0x00], remote=10.0.3.101
2017-12-15T15:49:38.788Z Milight: ready for next command
specific post
{ status: 'off' }
2017-12-15T15:49:38.878Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x9B,0x00,0x00,0x2A,0x00,0x31,0x00,0x00,0x01,0x01,0x08,0x00,0x00,0x00,0x01,0x00,0x3C]
2017-12-15T15:49:38.905Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x2A,0x00], remote=10.0.3.101
2017-12-15T15:49:39.004Z Milight: ready for next command
specific post
{ status: 'off' }
2017-12-15T15:49:39.159Z Milight: bytesSent=22, buffer=[0x80,0x00,0x00,0x00,0x11,0x9B,0x00,0x00,0x2B,0x00,0x31,0x00,0x00,0x08,0x04,0x02,0x00,0x00,0x00,0x02,0x00,0x41]
2017-12-15T15:49:39.197Z Milight: bytesReceived=8, buffer=[0x88,0x00,0x00,0x00,0x03,0x00,0x2B,0x00], remote=10.0.3.101
2017-12-15T15:49:39.298Z Milight: ready for next command

Perhaps the keep-alive packet would fix this?

  1. I have a couple RGBW lights (not WW apparently) and a couple CW/WW. All are exposed with the above code and can be set on/off individually! However, if i turn on all the lights then the ones that are in the CW/WW group will turn on, but the ones with corresponding numbers in the RGBW group won't turn on.
    So:
    CW/WW, group 1: on - goes on
    RGBW, group 1: on - stays off

I'm not adding any delays here so that might be a potential fix, do you know something else that might be causing this?

Bert regards,
Mark

Raspberry pi

Really wanted to run this on the pi.

Getting the error below, guessing its because the pi node version is so old (and cant be updated).

Any work around / fix?

Unhandled rejection TypeError: Object function Array() { [native code] } has no method 'from'
at /home/promise/node_modules/node-milight-promise/src/milight-v6-mixin.js:134:42

How to control RGB+CCT color temperature in white mode?

Hi, thanks for this great library. At last I can integrate some functionality also to my home automation system (Domoticz)! 😄

Unfortunately I couldn't figure out if there is a way to control the color temperature of white mode (warm / cold) with "FullColor" bulbs? Seems that when "whitemode" is set, the temp goes to coldest. Is there a way to set a warmer color temp for white?

Once again, thanks a lot for your great work!

On/Off does not work with RGBW One Zone Dimmer

I've got a version of the milight RGBW dimmers that let's me control RGB and W on the LED strips at the same time. This dimmer and remote combination does only support one zone as also depicted in the milight app.

I got it to work in the ioBroker.milight adapter with most of the functionality, except On/Off which would be quite handy for obvious reasons. I tried to figure out the necessary command sequence changes myself, but I cannot find the specific ones for these devices.

My settings:
milight box version/port: v6, port 5987
Lamp Zone 1: RGBW (RGBWW does not work at all)
I did not try other zones.

Delay 100, Repeat 1

Screenshots of the hardware:
20181127_221522

screenshot_20181127-221259_mi-light

The question is: Can you help me figure out the correct command sequence for this particular RGBW dimmer?

Best Regards,
Patrick

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

RGBW NightMode is a valid FullColor command

Hi,

Loving this - works a charm for me (using v6 bulbs). I have a mixture of RGBW and FullColor in my house - both support the nightmode feature.

Just an option - you could include this in the commandsv6 so it can be run via: light.sendCommands(commands.fullcolor.nightMode(zone));

Alternatively, for others you can simply run it as below (same outcome).
light.sendCommands(commands.rgbw.nightMode(zone));

just an FYI and thanks again for creating this.

Controlling all zones simultaneously

Is there a possibility to control all zones simultaneously (for example switch all zones to "red" or to the same effect)?
Or is it planned to implement this feature?

Script hangs?

Sorry for probably really stupid question, I tried to create basic script based on your example, but it hangs on object creation. If I leave this part in the code (192.168.1.24 is IP of my bridge):

var light = new Milight({
        ip: "192.168.1.24",
        delayBetweenCommands: 75,
        commandRepeat: 2
 });

it simple hangs, no errors, but it doesn't proceed any further. I am probably missing something basic, but any idea what it can be?

New integration for ha-bridge

Hi,

you asked to create an issue to send you links for new usecases. I have one ;)
I've been using your code for over a year now using ha-bridge and the example scripts that you linked. I've started to dockerize all of my stuff and created this new solution (v6 RGBW only, but easily extendable):

https://github.com/maltezacharias/milight-controller

Basically it uses docker-compose to combine a ha-bridge docker container with another node container that provides a HTTP API for your code, so that calling

http://milight-bridge:3000/v6/white/<bridge-ip>/<zone>/<brightness>

from the ha-bridge container will send a command to the v6 bridge. It only supports on, off, nightlight and white for now, as that's all I really use. But it makes for a clean docker-only install. (There is no authentication there, so it really should only run in an isolated docker network)

Edit: Thanks for providing the code ;) I had already spent a lot of time analyzing the protocol and writing my own, when I found this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.