LIFX Local Control

Hi,
I am seeing some strange behavior, wondering if its just me. This is tested using both Lifx Day/dusk bulbs and the color downlights.

I have a button (lets call it button1). On press it toggles a light on to level 25 and color temperature to 3500k.
The bulb turns on, but it first spikes up to level 100 (in turns of brightness, it looks like level 100, but on my dashboard i noticed on power on, the level goes to 0 at the time when the bulb flashes to 100, and then the level goes to 25 as the bul dims) before fading down to 25 over half a second or so.

I use this setup in my bedroom, so it results in a blinding flash of 100% output, 3500k light for a split second, before dimming to level 25 and the color changing, when i get up at 3am...

Is there no way to set the level, and or color before powering on the light?

If the light is in an off state (Hubitat shows the old level value, 100), then maybe the level should be reduced to zero (or 1) when a power off command is sent. This would solve the level change on startup. And I suspect this is what LIFX are doing in their app (as this behavior mentioned above is not seen when using the lifx app, with scenes).

Possibly there is something in the code that on power on, it first sends a 100 level, light on command, then quickly behind it another packet for actually setting the parameters provided?

Reason i post this in this thread is i have some Ikea zigbee bulbs connected via hue hub.
So i tried the same rules on these bulbs.
The Ikea bulbs do not show the same issue.

Possibly the issue here is delay when talking to the LIFX bulbs? Maybe the Ikea bulbs are working the same way, but commands are much quicker, so its barely/not perceptible.
So I only see this with my LIFX bulbs.
Ping wise, I see 0-4ms to the bulb.

I can think of a workaround:
Replace all my rules. Remove "Toggle" commands, instead use faders to turn lights off (possibly on as well). So fade level to 1 (cant fade to zero, thats considered a power off, so Hubitat keeps the light level at what it was previously, IE 100), then power off. That way any further turn on commands will start at minimum power level. Probably need to use a conditional action set for this. Will make all rules much more intensive to process i guess.

Open to other suggestions as well.

-edit-
When i turn the bulbs on via dashboard link, the bulbs do not "blink" to 100 level, they work as expected.
When i use "Toggle dimmer level" in rule machine, the light works as expected, no blink to level 100 before dimming to 25.
When I use "Toggle color temperature and level" it blinks to 100 before fading. To be even more obvious, if you use "Set color temperature and level", turn it on once, then press it again, the light flashes to 100% for every press.
When I setup a scene ( Master Bedsides: on, level 25, color temperature 1500), the lights blink to 100 during startup.
When the bulbs were previously on, and no changes are made to color temperature or level, turning the bulbs on/off works fine. But as soon as you change either level, or color temperature, the next time you hit the button, the bulb flashes to 100 then down to 25.

Cheers.

@whzzz28 can you share the rules you are running? I suspect your problem comes in a set of commands that sends multiple packets, rather than a single packet setting all of your desired attributes. I'll take a review through the code as well to see if we are doing extra unnecessary steps.

This is the scene I am using:
Master Bedsides: on, level 25, color temperature 1500

And here are two rules. First one activates the scene. Second one is basically the same, but not using scenes. Both result in the same blink to 100 on turn on.

hub1 hub2

I don't know what caused the improvement, but things are now running smoothly and swiftly. Maybe it was a Hubitat performance upgrade, maybe a LIFX firmware upgrade.. don't know. Popcorning is not an issue any more. What could previously take ten or more seconds for multi-light scenes now happens in about 1.5 seconds. The speed makes the difference of having to explain to guests why it looks odd when the lights turn on and guests just thinking it looks cool. Big thanks to the developers, @rob and @dkilgore90.

1 Like

Only thing im finding is the lifx app itself scenes Is not stable it seems to uncheck the lights that the scene is meant to apply to very strange. I want to take the time to migrate that feature to habitat as well. I'm pretty sure I can do it with the recent updates to multi colour zone strips eccetera

Can someone please enumerate the ports, protocols, and direction of discovery and control communications between Hubitat and LIFX bulbs?

My bulbs and Hubitat are not on the same subnet and I need to implement firewall/NAT rules.

Thx

I had already setup my bulbs prior to moving some of them to another subnet. I haven't yet finished this project, and given all the variables involved YMMV. Here's what I did, based on

  1. Enabled UDP/TCP 56700 bidirectionally
  2. Configured a UDP relay to permit discovery traffic to reach the bulb subnet
  3. I had already discovered my bulbs, so I had device entries for each in Hubitat. Due to implementation details in my environment (changing SSID for the bulbs) I reset them, re-adopted them in the LIFX app, and then in the hubitat settings changed the DNI to the new IP address once it had been configured.

I believe that bulb discovery should work from the hubitat on net-new bulbs, but I cannot recall if I have actually tested that particular scenario. It should be as easy as specifying the subnet to scan in the LIFX Master app settings.

1 Like

Rob said he has been busy, but I wanted to note for anyone not seeing the github that I've submitted a PR to implement HPM support. I did as much of the plumbing as I could but there is a text file that Rob will need to publish somewhere before it will show up in the HPM catalog.

2 Likes

Thanks for the guidance. I created a rule to forward TCP & UDP on port 56700 to my single LIFX bulb at its static IP address. Thereafter, discovery succeeded and I'm able to control my bulb.

Great, I'll try to take a look at that this weekend, not sure why I don't seem to be getting any emails from github to let me know that there's an outstanding PR.

1 Like

Hi Folks - I just fired up this code to discover some LIFX bulbs in the house - I created them static DHCP leases and all is good! I can control them from Hubitat now.

The next challenge is for hubitat to see a state change when, for example, my daughter turns them off with Alexa. The lights go off (Direct Alexa->LIFX integration), but I never see a state change in Hubitat. I suspect this is by design - but just wanted to validate.

Matt

The driver should be polling your lights once a minute to retrieve their current state -- so updates would not be immediate, but should happen without intervention.

Are you seeing a lot of UDP timeouts in your logs? This could indicate that packets from HE aren't getting to your bulbs (or their responses aren't getting back)

I get the very occasional UDP timeout - but not consistently... you are right - the state does change after the poll - but than answers my question - it's working as designed!

Thanks,

Matt

1 Like

I have a LIFX white, and it discovered fine. However, it said no device handler, and I cant figure out how to make it work.

Maybe you are missing this step.

Individual device handlers

On the Devices Code page, press the New Driver button

Paste the code for LIFXColor.groovy and save

Repeat this process for each of the device handlers you want to install. It's probably best to add all of them even if you don't have a corresponding device at the moment, I've found that buying LIFX devices is a bit addictive.

@Navat604 I installed the LIFX white, the LIFX color, and the LIFX white mono. I still get this error (my device's name is 5io)

5io (No driver installed for null)

How about go into your 5io device page and select the driver manually?

@Navat604 I don't have a device page. It looks like this.

The device discovery page looks like this.Screen Shot 2020-10-14 at 3.52.08 PM

Sorry, can't help you there other than try adding all the bulb drivers to see if that will help. Is this a special new bulb or such?
@rob

it is the 2700k bulb which is dimmable only. Under settings of the app, I saw this.Screen Shot 2020-10-14 at 4.01.19 PM