LIFX Local Control

It allows you to set a "wave" effect that oscillates between the current color, and a second color specified in the command. More details here: LIFX Waveform

1 Like

@rob Do you have any feedback on PRs #92 & #93?

#92: Support for Hubitat Package Manger (additional actions req'd on your end)
#93: Preliminary support (non-multizone) for LIFX Candle Color bulbs

1 Like

How do we add pulsing and breathing? I cannot for the life of me figure out how to use json in a trigger event? For example, when I have trigger for a door to open, I can have the LIFX light come on, but I want to make it be able to flash. How can I do that?

I know how to use json with Tasker, but not in Hubitat?

1 Like

The closest thing to a "flashing" for LIFX is the setWaveform command - which has several options for the wave shape - SAW, SINE, PULSE - to name a few. You would need to turn it on to a color/temp, then the wave oscillates to another color/temp. I don't think there is any JSON involved, but I believe as far as RM is concerned for command parameters, it's just a string that includes quotes.

Great, that would work. But how and where would I be putting that in? I can use the Rule Machine, if this happens, then that happens, can you provide some instructions on how to use that?

Here's an example rule I threw together:

The second Action is:

  • Run Custom Action
  • I used capability: switch -- to find the light
  • Custom command: setWaveform
  • Then you add the parameters, in order, for the command -- it may help to have the Device page open for reference.
    ** string -- wave type
    ** string -- HSBK map for the second wave color/temp (the first color is whatever it is already on -- perhaps set previously in the rule) -- ex [hue: 0, saturation: 100, brightness: 100, kelvin: 3500]
    ** string -- true/false, whether to revert to the original color/temp when the wave cycles are completed
    ** number -- period of wave, in seconds
    ** number -- number of wave cycles to run
    ** decimal -- skew_ratio of wave, between 0-1 (what percentage of the period it spends on the first vs second color)

See this page for more details/visuals on the various wave options: Waveforms ยท LIFX LAN Protocol

I've tried that, and something isn't working properly. This is what I have, I copied exactly what you have, just for now to test things. It will turn the light on, to the previous state but then stops before the pulse.

I have no problems making it flash using the tasker app, but not here in Hubitat yet.

Just curious - which bulb type/driver are you trying it against? I tested it on one of my z strips (multizone) and it worked for me.

Check your Past Logs, in case there is an error?

Yeah my past logs have the error:

2020-12-11 06:29:05.099 am errorgroovy.lang.MissingMethodException: No signature of method: user_driver_robheyes_LIFX_Color_384.setWaveform() is applicable for argument types: (java.lang.String) values: [PULSE, hue:0, saturation: 100, brightness: 100, kelvin: 3500, true, 1, 20, 0.5] Possible solutions: setWaveform(java.lang.String, java.lang.String), setWaveform(java.lang.String, java.lang.String, java.lang.String), setWaveform(java.lang.String, java.lang.String, java.lang.String, java.lang.Object), setWaveform(java.lang.String, java.lang.String, java.lang.String, java.lang.Object, java.lang.Object), setWaveform(java.lang.String, java.lang.String, java.lang.String, java.lang.Object, java.lang.Object, java.lang.Object) (setWaveform)

I do have LIFX Color in my drivers, and that's exactly the bulb have. But I do see capabilities seem to be missing the waveform (Bulb, ColorTemperature, Polling, ColorMode, ColorControl, ChangeLevel, Initialize, SwitchLevel, Switch)

What drivers do you have that supports it?

It's a custom command - not a capability - that is in all of the drivers (except maybe White mono), including Color. It seems like you provided all of the parameters as a single string -- it's hard to tell from the main Rule page.

If you go into the Rule, and Edit the setWaveform action, there is an Edit parameter drop-down - there should be 6 different lines to select. If they are all in one line, edit it to just be the first parameter -- PULSE. Then you'll need to click Add another parameter to add each of the 6 command params for setWaveform

I cannot get any logging working for my LIFX Lights.

Both Activity Logging and Debug logging seem to have a problem.
When I enable logging sometimes the setting does not change when I move the slider and save preferences.
Then sometimes the setting does not stick as If I refresh the light device page, after saving, or leave the light device page and go back into it the logging settings have changed.

Sometimes if I turn off Debug and leave on Activity they switch places.
Whether debugging is turned on or off seems to have no bearing to what the slider states.

One light seems worse than others but all have the problem.

Not sure if I explained this well.

Either way I get no logging information at all to the status of the the light or any changes.
Am I doing something wrong or is there a problem?

Same here (no logging)

Sorry, haven't got around to those yet, I'll try to do something about it this week.

I've also found it inconsistent, but not aggravating enough to run down a root cause :wink:

When I really need to troubleshoot something and the logs aren't cooperating, I simply find/replace logDebug with log.debug to override the setting.

1 Like

I am seeing a ton of error messages like the following from the light groups my LIFX bulbs belong to:
error java.lang.NumberFormatException: For input string: "42.83" on line 157 (indicatorHandler)

The error is easily reproducible by adding a bulb to a Groups and Scenes group and then changing the changing the brightness level of the LIFX device directly.

I asked about the error before and was told (Light group error messages) the problem is that the LIFX device should be using an integer for the level values. Is there a reason why the LIFX drivers are using floats instead of the expected integers?

As a result of this error my bulb groups are not staying in sync with the bulb state when the bulbs are changed directly (using schedules in the Lifx app).

It's probably just missing a cast to int, no reason other than that, but I'll have to check it out.

1 Like

Hi Rob, thanks. I thought that might be the problem.

I did a little testing and these changes to Lifx Master seem to fix the issue for me:

Lines 1349, 1354, 881: cast brightness to Integer
Line 1384: change cast from Long to Integer

I haven't done any device programming before, but the change doesn't seem to have broke anything yet.

My 'LIFX Color' device started throwing this error a could days ago. I don't recall making any changes to my network. Any ideas?

Could be that the bulb is on the fringe of your WiFi range.

Alternate theories are that your bulb doesn't have a static ip assignment, and a router reboot or other outage caused a different ip to be assigned?

Yeah i have quiet a few LIFX bulbs and i get those errors constantly.
Bulbs are statically assigned IPs and all have great network connectivity. Everything works fine so I never really put much thought or effort into it.