Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Zone support? #10

Open
OttoWerse opened this issue Apr 25, 2021 · 4 comments
Open

Multi Zone support? #10

OttoWerse opened this issue Apr 25, 2021 · 4 comments

Comments

@OttoWerse
Copy link

From what I've read the underlying API is ablte to differentiate between different zones of al ight just like the "new" (read: incredibly limited) HTTP API. However I can't seem to find a way to adress these zones using these nodes. The HTTP API based nodes do so, by allowing hte light identifier to be expanded with syntax like lightname|zone_id. Could this functionality be added? I am trying to get adressable color changes to work without the insane latency and limitations of the HTTP API.

@ristomatti
Copy link
Owner

Yes the support is there. I've actually contributed the feature but I then never got an inspiration to use it for anything. Now I realize it never got documented on the README, oops! Unfortunately I'm currently too busy with work to find time time or motivation to fix things like that, so pull requests would be greatly appreaciated.

In theory adding supporrt should be mostly copy paste and slight modifications of the already existing functionalities. Here's the commit that added the support node-lifx/lifx-lan-client@3da39bc

The added functions have JSDoc comments on the usage:

/**
 * Requests the current color zone states from a light
 * @param {Number} startIndex start color zone index
 * @param {Number} [endIndex] end color zone index
 * @param {Function} callback a function to accept the data
 */
Light.prototype.getColorZones = function(startIndex, endIndex, callback) { ... }

/**
 * Changes a color zone range to the given HSBK value
 * @param {Number} startIndex start zone index from 0 - 255
 * @param {Number} endIndex start zone index from 0 - 255
 * @param {Number} hue color hue from 0 - 360 (in °)
 * @param {Number} saturation color saturation from 0 - 100 (in %)
 * @param {Number} brightness color brightness from 0 - 100 (in %)
 * @param {Number} [kelvin=3500] color kelvin between 2500 and 9000
 * @param {Number} [duration] transition time in milliseconds
 * @param {Boolean} [apply=true] apply changes immediately or leave pending for next apply
 * @param {Function} [callback] called when light did receive message
 */
Light.prototype.colorZones = function(startIndex, endIndex, hue, saturation, brightness, kelvin, duration, apply, callback) { ... }

It's pretty much just a wrapper around the LAN API.

@ristomatti
Copy link
Owner

Damn, I was going to suggest trying the commands out using my lifxsh command line tool into which I added support at the time but I see some later change has broken the colorZones support. 😳.

Anyhow if you're interested in checking it out for the basic functionalities, you can get the latest version I've yet to push to npm by npm install -g ristomatti/lifxsh#dev. It will install a lifxsh command that has online help. It's what I've used to control lights when I'm at the computer and need precise control. Screenshots and more info available here https://github.com/ristomatti/lifxsh/tree/dev.

Multizone command might also work but I noticed at least that it's very unforgiving (you'll need to provide all parameters). But then again that's how the library works also. I only have one of my LIFX Z strips installed at the moment and it's on the other end of the apartment so I can't quickly test 😄.

@JKoss2
Copy link

JKoss2 commented Feb 17, 2022

I see this is a little old, but was wondering if anyone was able to implement the multi-zone support? So far I haven't seen multi-zone support readily available for node red without writing new code.

@ristomatti
Copy link
Owner

Pull requests are welcome. I am unfortunately very time constrained at the moment and for the foreseeable future and personally don't have the need for this, so it is not planned either. There's also the unfortunate issue that only one out of thee of my LIFX Z-strips work any more*. It's installed in the bathroom and I don't dare to move it as I'm afraid it will also stop working.

*) Protip: do not try to install them in a place which requires you to bend them 90 degrees or if you do, be very very careful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants