LIFX


The LIFX integration automatically discovers LIFX bulbs on your network and adds them to Home Assistant.

Configuration

Adding LIFX to your Home Assistant instance can be done via the user interface, by using this My button:

LIFX can be auto-discovered by Home Assistant. If an instance was found, it will be shown as “Discovered”, which you can select to set it up right away.

Manual configuration steps

Set state

The LIFX bulbs allow a change of color and brightness even when they are turned off. This way you can control the light during the day so its settings are correct when events for turning on are received, for example from motion detectors or external buttons.

The normal light.turn_on call cannot be used for this because it always turns the power on. Thus, LIFX has its own service call that allows color changes without affecting the current power state.

Service lifx.set_state

Change the light to a new state.

Service data attribute Description
entity_id String or list of strings that point at entity_ids of lights. Use entity_id: all to target all.
transition Duration (in seconds) for the light to fade to the new state.
zones List of integers for the zone numbers to affect (each LIFX Z strip has 8 zones, starting at 0).
infrared Automatic infrared level (0..255) when light brightness is low (for compatible bulbs).
power Turn the light on (True) or off (False). Leave out to keep the power as it is.
... Use color_name, brightness etc. from light.turn_on to specify the new state.

Light effects

The LIFX platform supports several light effects. You can start these effects with default options by using the effect attribute of the normal light.turn_on service, for example like this:

automation:
  - alias: "..."
    trigger:
      # ...
    action:
      - service: light.turn_on
        target:
          entity_id: light.office, light.kitchen
        data:
          effect: lifx_effect_pulse

However, if you want to fully control a light effect, you have to use its dedicated service call, like this:

script:
  colorloop_start:
    alias: "Start colorloop"
    sequence:
      - service: lifx.effect_colorloop
        target:
          entity_id: group.livingroom
        data:
          brightness: 255
          period: 10
          spread: 30
          change: 35

The available light effects and their options are listed below.

Service lifx.effect_pulse

Run a flash effect by changing to a color and then back.

Service data attribute Description
entity_id String or list of strings that point at entity_ids of lights. Use entity_id: all to target all.
color_name A color name such as red or green.
rgb_color A list containing three integers representing the RGB color you want the light to be.
brightness Integer between 0 and 255 for how bright the color should be.
period The duration of a single pulse (in seconds).
cycles The total number of pulses.
mode The way to change between colors. Valid modes: blink (default - direct transition to new color for ‘period’ time with original color between cycles), breathe (color fade transition to new color and back to original), ping (short pulse of new color), strobe (light turns off between color changes), solid(light does not return to original color between cycles).
power_on Set this to False to skip the effect on lights that are turned off (defaults to True).

Service lifx.effect_colorloop

Run an effect with colors looping around the color wheel. All participating lights will coordinate to keep similar (but not identical) colors.

Service data attribute Description
entity_id String or list of strings that point at entity_ids of lights. Use entity_id: all to target all.
brightness Number between 0 and 255 indicating brightness of the effect. Leave this out to maintain the current brightness of each participating light.
period Duration (in seconds) between starting a new color change.
transition Duration (in seconds) where lights are actively changing color.
change Hue movement per period, in degrees on a color wheel (ranges from 0 to 359).
spread Maximum color difference between participating lights, in degrees on a color wheel (ranges from 0 to 359).
power_on Set this to False to skip the effect on lights that are turned off (defaults to True).

Service lifx.effect_stop

Run an effect that does nothing, thereby stopping any other effect that might be running.

Service data attribute Description
entity_id String or list of strings that point at entity_ids of lights. Use entity_id: all to target all.

Buttons

The LIFX button platform creates two buttons for each LIFX device.

Identify Button

The Identify button will flash the bulb three times at maximum brightness then return the bulb to the state it was in prior. Successful identification requires the bulb to be powered on and already configured in Home Assistant.

Restart Button

The Restart button triggers the bulb to restart in exactly the same way as a physical power cycle, which makes it ideal for triggering a new DHCP request from the bulb.

HomeKit Accessory Protocol

Most LIFX devices support Apple HomeKit via the HomeKit Accessory Protocol (HAP). If a LIFX device has not already been added to HomeKit natively using an Apple iOS or macOS device, it can be paired with Home Assistant using via the HomeKit Controller integration which uses HAP.

This enables the use of LIFX devices in Home Assistant that are not supported by the LIFX integration. See below for specific details on controlling LIFX Switches.

The LIFX integration currently has to poll the device every few seconds, as opposed to using the HomeKit Controller integration, which offers push updates, encrypted communications, and significantly less network traffic.

Discoveries from control protocols that are not desired can be ignored in the UI. LIFX devices that support HAP will be discovered by both methods if they have not been added to native HomeKit using an Apple iOS or macOS device. It is possible to set up control of the device in Home Assistant using both protocols simultaneously by configuring both the LIFX integration and the HomeKit Controller integration for the same device.

LIFX Switch

The LIFX integration does not support the LIFX Switch. However, the HomeKit Controller integration can be used instead for LIFX Switch running firmware 3.90 or higher. Follow the LIFX documentation to obtain a HomeKit code prior to integrating the Switch with Home Assistant as it will be needed during the process.

When using the HomeKit Controller integration, each button on the LIFX Switch is discovered as a stateless switch and will not appear as an entity in Home Assistant. Relays that are configured as wired to non-LIFX devices will appear as normal switches in Home Assistant.

Troubleshooting Discovery

Lights

LIFX and HomeKit based discovery of LIFX bulbs relies on Home Assistant having a network interface connected to the same subnet as your LIFX bulbs. If you use a segregated IoT network to which Home Assistant is not directly connected, use the manual configuration method documented above to bypass discovery.

If you have multiple network interfaces, ensure that the interface connected to the same subnet as your LIFX bulbs is enabled in Home Assistant’s network configuration.

Switches

If your switch is not automatically discovered or you get a “Cannot add pairing as device can no longer be found” error during the config process, reboot your LIFX Switch as they only broadcast HomeKit compatibility for 15 minutes.