How to expose Inovelli LZW45 (LED strip) pixel animations as a button?

I'm trying to create a simple, single-purpose button that turns on/off a pixel effect on my LZW45 strip, in order to add it to Homekit (eg. a "Rainbow Light Show" button). I've tried creating a virtual button, but those seem only to be able to control the light strip in general (on/off, dim, set color, etc), not this specific action.

So basically I just want a "first class citizen" button to do what I can do from the devices page. I'm very much a newbie here, but would the right thing be to have some sort of rule machine trigger?
image

Buttons (well, virtual ones, at least) don't control anything unless you tell them to, so what setup did you use for this? Creating a virtual button, then using the Button Controller app to run a custom command, pixelEffectStart(), on your lightstrip looks like it should work.

I can go into more detail, but it might be less work to know what you have so far.

Thanks for the reply. I had poked around earlier and seen similar advice as well. For some reason I think I got lost in the layers of Button Controller menus, but your advice kicked me in the rear and now I've got pixelEffectStart(11) on button 1 of the virtual button. Thank you!

Is there an easy way to make the button toggle-able within the Button Controller app, or is that something I'd need to start using Rule Machine for? Thanks again!

If you can find how to query the pixel state in a conditional, you should be able to toggle it using Button Controller or RM. Then your action for button is:

If pixel 11 =on, then turn off
If pixel 11=off, then turn on

I don't have that light strip so I don't know exactly how to query the strip's state.

You could also use 1 button and cycle thru effects.

If pixel = 11, then change to 12
If pixel = 12, then change to 13
If pixel = 13, then change to 11.

I do similar with all of the fan speeds of my fan controller and with colors for a couple of RGB bulbs.

All of my automations are in Node Red now but I previously used Button Controller to do this.

The button itself? No, buttons do not have states, or at least not meaningful states--their automations are really are driven by the events generated on pushes, real or virtual. If you want something that can show on/off (e.g., on a Dashboard or respond to these commands via voice control), what you want is a virtual switch instead.

But if you want your button automation to be able to toggle something (and don't care about the "state" of the button per se), the above might help. I don't use Inovelli's drivers for these so don't know what attributes they expose that might be usable for checking the current state--though if the button is the only way you do this, you'd basically know without needing the device to report anything.

Exactly where I started this journey, sadly enough :joy:. It doesn't appear that I can use a virtual switch as part of Button Controller, in which case... would you suggest I just have a dummy virtual button, and a rule machine rule that does pixelEffectStart() on an on press and pixelEffectStop() on an off press?

I really appreciate the help!

Should've just done it before typing that out. It looks like I can just use Basic Rules and have the Virtual Switch press Virtual Button's button 1 when it is turned on, and Virtual Button's button 2 when it is turned off. That way I can get all this done (I think) with just Button Controller and Basic Rules. Thanks again for your help!

Right, Button Controller is basically a version of Rule Machine where the rule actions are triggered by button events. So, to use a switch (or anything else) as a trigger directly, you'll need another app. I see you have a workaround above, but if you do want to use just a virtual switch for this, I'd consider Rule Machine (if you're new to it, don't be scared! You're already halfway there with Button Controller). You could do something like:

Trigger: Virtual switch *changed*

Actions to run:

IF (Virtual switch is on) THEN
  pixelEffectStart(11) on Inovelli Lightstrip
ELSE
  pixelEffectStop() on Inovelli Lightstrip
END-IF

...or really whatever you want, of course--just to give one possibility.

1 Like

Out of curiosity, how are you committing between Hubitat’s and HomeKit? Are you using tonesto’s homebridge stuff or the maker api?

I only ask because depending on how you’re setup you could (theoretically) eliminate the need for exposing virtual switches altogether and just write your HomeKit button presses to talk to hubitat/rule machine directly - via local commands behind the scenes.

It sounds like you have everything working now so you probably have little incentive to pop the “hood” again - if so no worries!

I just wanted to throw the idea out there just in case as it as it would be a little extra work to setup initially but “might” be cleaner/easier for you to add or maintain long term.

That would indeed be interesting. I am using tonesto's Homebridge v2 app to populate things in HomeKit. If I expose my Virtual Button to the tonesto plugin, would I be able to differentiate between button 1, button 2, etc? Definitely would make things more straightforward.

I am trying to do the exact same, but am so confused on how to do this. What did you end up doing to make a button to activate a scene? I have the button controller with all of the Inovelli buttons with several that activate a custom action of pixelEffectStart(xx) but how do I trigger them? I just keep going in circles and can't figure it out.

I'm not sure what you mean with "all of the Inovelli" buttons (maybe the button events the driver parses presses of the buttons on the controller itself into?) , but the idea with Button Controller is the same regardless of what device you use: you have to generate the specified event on the specified device to trigger the corresponding set of actions.

For example, this needs a "button 3 pushed" event (technically pushed with a value of 3) to happen in order to run the "position shades" action:

Button rule screenshot: 'Select actions for button 3 pushed...'

and that event must come from the device chosen at the top of the Button Controller instance:

Button rule screenshot: 'Select button device*'

So for me, that's "Downstairs Computer Pico." You will have to get the appropriate event to fire on whatever device you're using for this Button Controller instance.

I guess I'm just not getting how to access the Button controller in any other device.


So I have the pre-populated buttons from the device here. The buttons here do what I want, but I can't figure out how to trigger them. I don't have any physical devices, so I can make a virtual button, but again how do I link it to one of these? How would I expose it to voice/Alexa control?

Apps in Hubitat are, in general, thing that respond to events (device events, schedules, etc.) and do things (often sending a command to a device)--automations. Devices can't directly "talk" to other devices like your lightstrip, generally speaking (ignoring things like Z-Wave Association, Zigbee Touchlink, and whatnot); you need an app to do that.

So, you're halfway there. I can't see what you've done exactly, but it sounds like you created virtual button devices to command the lightstrip to do different things. Great! Now you just need to make those event happen to trigger your automations.

Virtual devices are, by definition, not real devices--they're basically "simulated," hub-only devices. One way to get a "button 1 pushed" command from your virtual device is to go to the device page for that virtual button, type "1" (no quotes) in the text box inside the "pushed" box towards the top of the page, then press that button to run the command. A more practical way to do the above (the admin UI is usable for this but isn't really intended to be your go-to for day-to-day device manipulation) might be to make a Hubitat Dashboard tile using the "Button" template that points towards this button and the specified button number/event, one for each one that you want.

If you want a real device or "real" event to trigger these automations, then you'll need a real button device. (If you have any of Inovelli's switches or dimmers, most drivers for them expose the taps/multi-taps as button events, and you could use those to "trigger" these Button Controller instances instead--just to name one example.) Or if you want non-button events, you can use a Rule Machine rule or other app to get the desired outcome (or, since you've already set this up, just use a small rule/app to virtually push/hold the appropriate button number on your virtual button).

You have arbitrarily many possibilities. :smiley: I'm not exactly sure how you want to handle this, but those are some options!

I got this working just fine in Hubitat, though the number of basic rules is a little insane :grimacing: .
Here are the relevant parts of my apps screen:

The "Jackson's Bed Lightshow Button" is a Virtual Button. All of the "Jackson's Room Effects - XYZ" are virtual switches. In my button controller, button 1 calls pixelEffectStop() and buttons 2-8 call a bunch of various pixelEffectStart(11) or whatever. This way I can expose all those virtual switches as buttons in the Homekit app.

One caveat is that when one of my virtual switches is pressed, in order to maintain the right state, I first automate turning off every other virtual switch, then I enable the effect. This way, there will only ever be one switch that is turned on at a given time. So just to take one of the button controller actions as an example:

I'm sure my way is extremely kludgy, but I don't know anything about Rule Machine so this was a simple way to brute force a solution.

Hey. Thanks for the advice.
Question: how do you add pixelEffectStart (x) to a rule?
I am not sure how to define that in a custom action

Custom command, then choose your device (but you'll have to choose a "Capability" first--any one that the device supports would work, like Switch, Dimmer, or even the catch-all for most devices that accept commands, Actuator). Then you should be able to choose this command and supply the necessary parameter.

When you say Custom command, do you mean Custom Action?

Sorry, yeah, that's what RM calls them. :slight_smile: (They are custom commands on the device, or just any command RM doesn't natively support with the "friendly" drop-down actions.)

This is so tough for me. I can manage RM only at the best of times.
Taking what the previous solution was:
IF (Virtual switch is on) THEN
pixelEffectStart(11) on Inovelli Lightstrip
ELSE
pixelEffectStop() on Inovelli Lightstrip
END-IF

I cannot figure out how to show that in the RM lingo