Support Lifx effects when added by Homekit Controller discovery

I really want to use the Homekit Controller discovered version of my Lifx lights to cut down on network traffic due to it supporting local push rather than the local polled Lifx integration. With 50 lights this adds up.

However the Homekit controller Lifx device does not have any support for effects. Not even the usual default light integration “flash” effect.

Supporting the Lifx pulse effect would be great, failing that the “flash” effect would be adequate. Maybe.

The lifx.set_state service is also not supported. I can work around this but it would be great if it too could be supported.

My only advice is to use both integrations, but to hide the LIFX ones and expose this stuff via automation/scripts. The bulbs don’t expose any of that stuff to HomeKit, so it’s not possible to add via that connection method.

The advantage of using only the Homekit Connect integration is network efficiency (push vs polled). Having both integrations active negates that. So I might as well stick with the network inefficient Lifx integration that has the most utility for me.

Though maybe not…

I tried to replace the Lifx integration tonight. I managed to easily replace all the occurrences of the lifx.set_state service I had used but for the lifx.effect_... services I’m going to need to write some scripts I can pass variables to (colour, cycles, etc). Which should be easy enough when I get time. However, there is no way I can find to set the infra-red intensity of my security lights using the Homekit Connect integration. That may be a deal breaker. Or I may just keep those 3 spotlights as Lifx integration lights. 3 polled lights instead of 50 should still be an improvement.

You make an excellent point. On that note, creating a mini-integration that doesn’t actually maintain a connection to the bulbs, but can send it commands (like IR, HEV, firmware effects, state, transform, reboot) would be pretty easy. It’s late here now, but I’ll noodle on this tomorrow/weekend.

1 Like

That would be amazing. Thanks Avi.

Quick sanity check: what actual functionality do you need to retain from the LIFX integration? I’m trying to avoid creating an actual Light entity (which would require regular checks to keep in sync) so I’ll need to implement stuff via services. Obviously I’ll have set_state support, but I just wanted to check what else you need/want.

I’ve thrown in some of the goodies that are waiting for core merge as well, like the identify and reboot buttons, and HEV sensors. Also, instead of the Light entity, I’ll have sensors for HSBK, Power and Zones but they won’t update very often (I’m thinking once a minute max).

Hi Avi, I make use of the following services:

lifx.set_state currently only for IR brigtness e.g.

    service: lifx.set_state
    entity_id: light.lifx_front_porch
      infrared: "{{ states('input_number.lifx_porch_ir')|int(0) }}"

I’ve removed a lot of the lifx.set_state services that I used to set the brightness of lights before turning them on. This has led to some sub-par performance (lights coming on bright then dimming). So having the set_state service for brightness while using only Homekit Connect would be awesome.

Other services I use for light notifications (doorbell, sunset, etc…)



The lifx.effect_colorloop service is a bit of a gimmick and I don’t use it.

Pretty sure that is all there are.

I am a bit curious, why do you all say that the LIFX integration is network inefficient? It is polling, true, but the packets are tiny and rare. I cannot believe that they are overloading any network.

(It’s unreliable indeed but that is a different matter)

Well it’s less efficient than a light that uses local push. And when you have 50 lights the polling packets do add up. While doing a bit of network sniffing recently to track down an unrelated issue I did notice a large number of Lifx packets.

I do not however suffer from latency or network issues with any (of the 50) the lights (or other network devices) but it would just be nice to use the more efficient connection method that has been made available.

On average, the LIFX integration uses about 20 bytes per second for polling a bulb. Even if one had a few hundred bulbs it would still be far less traffic than a single audio stream.

That is to say, I am not sure that I see the need for a separate integration to do away with such a tiny overhead.

Ok I see your point.

I’ve probably already reduced my network traffic considerably by replacing the lifx.set_state services that were triggered on every change of outside light brightness with a light.turn_on service including a brightness data value when the lights are first tuned on (and then continually adjusted while on).

Avi, don’t worry about the custom integration. I’ll stick with the Lifx integration. But thanks for offering to do it. Much appreciated.

No worries.

I have 60 bulbs myself and it’s not the bulb traffic that bugs me, it’s all the discovery broadcasts that slow wifi down to 1Mbps each time that’s the problem. I’ve got a proof-of-concept clone of the core integration that just has discovery disabled and I’m going to take that for a spin to see if there is a noticable difference either in performance or stability.

1 Like

Ok, keep me updated then.

Also the broadcast traffic is minimal. It was 1 tiny packet each minute (total, not per bulb). I didn’t upgrade Home Assistant yet but I understand that it is now 1 packet every 15 minutes. Disabling that is not going to change anything.

For stability and latency, I agree: a TCP push protocol is likely to perform better.

True. Consider it an intellectual exercise then.

1 Like

Personally, I would like more effects (not as many as WLED) to be in HA for LIFX bulbs, I have kids and they love the “party lights” (their name for color cycle or visualizer from the LIFX app). I can mimic color cycle with HA through the LIFX integration but can’t tweak it’s speed or variance like in app.

I only just upgraded to 2022.8 and saw the homekit discovery. I really want a cloud free house but I bought these bulbs before HA came into my life. Any strides to get me closer would be appreciated!


@tom_l @Djelibeybi

So, at this point in time, what is the best method to bring LIFX lights into HA and HomeKit?

a) Independently via HA LIFX integration and HomeKit direct to a non-HA HomeKit hub (e.g. Apple TV)
b) HA HomeKit Device integration which then passes the entity onto HomeKit through the HA HomeKit Bridge integration

I’ve noticed method (a) lately seems to result in some of my LIFX lights being unavailable in HomeKit, so if (b) is more reliable, I may need to reconfigure.

If the same LIFX bulbs are not going offline in Home Assistant when they’re unavailable in HomeKit, try option B on a couple of the more troublesome bulbs to see if it solves your problem.

I just realised I’m still using your custom component. Has that been merged?

Yeah, that would be the next step. I’m also asking more generally (imagine I wasn’t having reliability issues) as well. Which method would you both recommend to new users?