[RELEASE] Pixelblaze addressable LED Controller Driver v1.00

@zranger1

I have a rather specific question and curious if you can help. I am dividing my strip into segments...no issues there. I also made my own pattern that I have effectively added into the Mutlisegmentation pattern so I can call it no problem.

Here is the issue (and I know it's specific) .

The pattern I'm using is a combination of effects. It's chase ring, then after a set period of time, does a breathe animation, then it goes to a static color. That works perfectly fine, I use deltas to track the "modes."

I plan on using this via triggers, i.e., a switch goes on, that segment turns on and the pattern starts. It will end with a solid state of lights as stated above. The issue is, IF I turn the segment off, and then back on again, the pattern doesn't "run again" it seems as if it just resumes.

Does that make sense. I'm curious if I can get the pattern to start again from the beginning if the segment is turned off then back again.

I know, crazy use case and I can go into detail as to why I'm doing this but let me know if you have any thoughts. It just may be the pattern I made as i am VERY new to building them.

Thanks in advance.

Tony

Hey, @ffingers! Glad to see you back. Do give me an update on the countertops when you can. It sounds really cool! We're way overdue for a kitchen remodel here and my wife is thinking poured countertops as well. Are you embedding channel for the LEDs in the concrete forms? I'd love to see pictures.

The answer to your question is yes, you can do that. It's the blessing and curse of highly programmable devices: the answer is almost always yes, but there's always a little code involved in making it do exactly what you want.

If you're turning individual segments on and off, probably the easiest way is to add a lastState variable to the pattern that tracks the last state of the on/off switch for the segment you're interested in. Then at beforeRender() time, check the variable and if the switch is "on", and lastState was "off", do whatever effect initialization you need.

If you're turning the whole strip on and off from the main device (not the children), you'll probably want to add an exported variable like __restart to your pattern, initialize it to False (0) and again, check at beforeRender() time, and do your effect initialization if it is True. (Then set it to 0 again to be ready for the next cycle.)

To make this work you'll just need to add a SetVariables("__restart",1) command to the on() command handler in the main device driver.

In any case, you might want to download the latest "Multisegment for Automation" pattern again -- I fixed a bug that could potentially cause on/off switching problems this afternoon! :slight_smile:

@zranger1 - I'll definitely keep you updated on the countertops. Quick answer, yes, I'm making a channel in the forms that going to embed (I think) a metal channel with a diffuser in the channel then pour epoxy over it. I know it will make it pretty much permanent depending on how deep epoxy I pour, but I want a diffused look and I want it to be one smooth surface. The LEDs won't be stressed that much so I'm hoping it will work. If you want a good link to an AWESOME process for making them, hit me on PM.

As to your solution - I was thinking about doing that, but couldn't figure it out. The way you articulated it, just hit me how to do it so thanks a ton.

I have a cool pattern that does a green chase ring, a few breathes, then constant green. It will trigger every time the kids turn the xbox on :wink: sort of mimicing the old startup procedure for the xbox. I still have to tune the pattern and the code is AWFUL but it works.

1 Like

If Pixelblaze is intended for LED strips with individually addressable LED's, would it also be usable for orchestrating visualisations between various RGB bulbs?
I have about 8-10 RGBW bulbs in an outdoor courtyard, would be great if I could make them do funky stuff together that goes beyond just group on/off and colour change :smiley:

I realise this is still significantly different of course (the individual LED's on a strip are wired for starters which gives more direct control and they all reside on the one device/controller) so I'm not looking for something that has that level of precise steering. But it would be great if there could be automated random colour and brigthness changes between various RGBW bulbs...

If they're low voltage DC bulbs that are wired together and use either the standard 3-wire (WS28xx/NeoPixel) or 4-wire (APA102) protocol, then they'll most likely work with Pixelblaze.

If they're just regular color LED bulbs that go in lights sockets, then no. But if you want to do animation, some manufacturers, Philips for example, support an "entertainment mode" -- a fast way of setting colors in time to music or other events.

If you've got Hue bulbs, their regular app or any of the many Hue apps available on app stores support entertainment mode. If you're technically inclined, you can use diyHue to fool the Hue apps into supporting a large range of other brands of bulb too.

thx zranger1, I'm trying to stay away from Hue for as long as I can (until I'll run into issues on HE and need to separate out my lighting at least :smiley: ) but I've come across [Code Freeze] - Lighting Effects which is a neat randomiser. That'll do the trick for now :wink:

1 Like

@zranger1

Hey, long time. Wanted to say thanks for the driver it has been great. However been running into an issue where I need to initialize it before one of them will work. Is there a polling option or something I should be doing to make sure it is ready to go and don't need to initialize to make it work?

Thanks again, the driver has been great!

Tony

I am trying to set a variable for one of my effects. What is the syntax to send it through the hubitat interface. Example would be to modify the sharpness value

  • varList: {"vars":{"hue":0.573807,"saturation":0.063202,"value":0.522522,"sharpness":84.32465,"location":0.448792}}

The setVariables command can use the whole JSON substring after {"vars":

So, to set sharpness alone, you'd enter:
{"sharpness":84.32}

To set all those variables at once, enter:
{"hue":0.573807,"saturation":0.063202,"value":0.522522,"sharpness":84.32465,"location":0.448792}

It looks like the child devices / segments do not have all of the same effects as the parent. Is this correct or intended? Is there a way to include the same effects in the child devices / segments as are listed in the parent?

Yes, this is intended. Pixelblaze runs a single pattern at a time. The multisegment setup is just a normal pattern that happens to implement segmentation with its own set of per-segment effects.

If you look at the pattern code, you can view and edit the javascript source for all the effects and add your own if you like.

1 Like

This is an awesome integration and I was able to get it running and turn on and off a pixelblaze controller / light strip but I am having trouble figuring out how to call "Next Pattern" by using Button Controller or Rule Machine. Is there a way to do this or do I need to do some programming? For reference I am using a scene controller, Zooz ZEN32. I can use the basic functions fines and can use the devices page on the PIxelblaze to go to Next Pattern or Random Pattern, just wondering if I can easily do this with Button Controller or Rule Machine. Sorry if I'm missing something basic.

Thanks!

I don't think you missed anything. This is one of those things about RM that's a little on the non-obvious side. Here's how you make it work:

  • When you're setting up actions for your rule, select "Run Custom Action"
  • Choose "Actuator" in the "Select capability of action device" list, then choose your device.
  • You should then see a "Select custom command" drop down list, from which you can see all the things the driver can do. previousPattern/nextPattern etc, will be in there somewhere. Select the one you want, and click the "Done" button to move to the next RM page.

Thank you!!!

I played around in custom action but never made it that far. Thanks for the quick and detailed response!

First and foremost, this driver is awesome - I got my Pixelblaze and some strips all set up over the weekend and they're working great.

One thing I'm noticing is that I can't pick a static color if a pattern is active. I can't seem to force it to just a plain color unless I reboot the PB. Is there a command to say "Stop the pattern, switch to color X" and I'm missing the pattern stop part?

A quick explanation, just to make sure we're on the same page: The Pixelblaze is an extremely programmable device, which can be blessing or curse, depending on what you have in mind. It doesn't have a default single color mode, or really, any default mode at all. It's always running a user-configurable pattern of some sort.

The active pattern has total control of the lights, including what controls are available to external programs. The Hubitat driver can only control color if the pattern has support for doing that in the form of an RGB or HSV color picker. Not all the built-in patterns do.

So, to use your strip as a single color light, you need to switch to a pattern that allows you to do that. If you don't already have one, below is the code for a single color pattern that you can paste into the webUI editor and save. Then, when you switch to this pattern, you should be able to control your strips like a "normal" light bulb.

// Single color pattern for Pixelblaze
// Sets all connected LEDs to the selected color.

// default to sort of warm white
var hue = 0.06;
var sat = 0.4;
var bri = 0.75;


// color control UI
export function hsvPickerColor(h,s,v) {
  hue = h; 
  sat = s;
  bri = v;
}

// set all pixels to the selected color
export function render(index) {
  hsv(hue, sat, bri)
}

So, funny thing- I'm referring to this:
image

which works like 50% of the time. It seems like somehow it gets into a mode where a pattern isn't being used, and then that picker will let me choose a static color. I can't seem to figure out why it works sometimes but not others, and my running theory is it gets "out" of pattern mode somehow - but perhaps that's completely wrong

and as another example, I am able to set it in Room Lighting as a RGB light and pick a color there... it works sometimes but not every time.

What pattern does it say it's running on the devices page? It would be "activePattern" over in the "Current States" panel on the right.


image
image

...and it is in fact green in that room right now :slight_smile: