# LIFX

> Turn LIFX lights on and off, set their color and brightness, run effects and activate scenes.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/lifx

## Actions

### Activate a scene

Set the lights in a saved scene to the way the scene has them.

**Inputs**

- Scene (`scene_id`, text, required): The scene to activate. Pick from the list or use a scene ID from an earlier step.
- Duration (`duration`, number): How many seconds the lights take to change. LIFX uses 1 if left blank. From 0 to 3155760000.
- Ignore (`ignore`, list): Parts of the scene to leave as the lights have them now. One or more of: `power`, `infrared`, `duration`, `intensity`, `hue`, `saturation`, `brightness`, `kelvin`.
- Fast (`fast`, true/false): Send the change without checking the lights first or waiting for them to answer. Quicker, but the step can't say which lights changed.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```

### Breathe lights

Fade the lights slowly to a color and back.

**Inputs**

- Lights (`selector`, text, required): Which lights to breathe: pick from the list, or type a LIFX selector such as all, id:d073d5000000, group_id:..., location_id:... or label:Desk lamp. Separate up to 25 with commas.
- Color (`color`, text, required): The color to fade to, such as red, #ff0000, kelvin:2700 or hue:120 saturation:1.
- From color (`from_color`, text): The color to start from. Leave blank to start from the light's current color.
- Period (`period`, number): How many seconds one cycle takes. LIFX uses 1 if left blank. At least 0.
- Cycles (`cycles`, number): How many times to repeat. LIFX uses 1 if left blank. At least 0.
- Persist (`persist`, true/false): Leave the lights on the effect's last color. Off by default, which puts them back as they were.
- Power on (`power_on`, true/false): Turn on lights that are off for the effect. On by default.
- Peak (`peak`, number): Where in each cycle the color is strongest, from 0 to 1. LIFX uses 0.5 if left blank. From 0 to 1.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```

### Check a color

Check that LIFX understands a color, and see the hue, saturation, brightness and kelvin it means.

**Inputs**

- Color (`color`, text, required): The color to check, such as red, #ff0000, kelvin:2700 or hue:120 saturation:1 brightness:0.5.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "brightness": 1,
    "hue": 1,
    "kelvin": 1,
    "saturation": 1
  }
}
```

### List lights

List the lights on the LIFX account, with whether each is on, its color and brightness, and the selector to control it by.

**Inputs**

- Lights (`selector`, text, required): Which lights to list: pick from the list, or type a LIFX selector. Use all for every light on the account.

**Outputs**

- `data` (list): The response from LIFX.

**Example output**

```json
{
  "data": [
    {
      "brightness": 1,
      "color": {
        "hue": 1,
        "kelvin": 1,
        "saturation": 1
      },
      "connected": true,
      "effect": "example",
      "group": {
        "id": "example",
        "name": "example"
      },
      "id": "example",
      "label": "example",
      "last_seen": "example",
      "location": {
        "id": "example",
        "name": "example"
      },
      "power": "example",
      "product": {
        "capabilities": {},
        "company": "example",
        "identifier": "example",
        "name": "example"
      },
      "seconds_since_seen": 1,
      "selector": "example",
      "uuid": "example"
    }
  ]
}
```

### List scenes

List the scenes saved on the LIFX account.

**Inputs**: None.

**Outputs**

- `data` (list): The response from LIFX.

**Example output**

```json
{
  "data": [
    {
      "account": {
        "uuid": "example"
      },
      "created_at": 1,
      "name": "example",
      "states": [
        {}
      ],
      "updated_at": 1,
      "uuid": "example"
    }
  ]
}
```

### Pulse lights

Flash the lights quickly to a color and back.

**Inputs**

- Lights (`selector`, text, required): Which lights to pulse: pick from the list, or type a LIFX selector such as all, id:d073d5000000, group_id:..., location_id:... or label:Desk lamp. Separate up to 25 with commas.
- Color (`color`, text, required): The color to flash to, such as red, #ff0000, kelvin:2700 or hue:120 saturation:1.
- From color (`from_color`, text): The color to start from. Leave blank to start from the light's current color.
- Period (`period`, number): How many seconds one cycle takes. LIFX uses 1 if left blank. At least 0.
- Cycles (`cycles`, number): How many times to repeat. LIFX uses 1 if left blank. At least 0.
- Persist (`persist`, true/false): Leave the lights on the effect's last color. Off by default, which puts them back as they were.
- Power on (`power_on`, true/false): Turn on lights that are off for the effect. On by default.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```

### Set lights

Turn lights on or off, or change their color or brightness. Anything left blank stays as it is.

**Inputs**

- Lights (`selector`, text, required): Which lights to change: pick from the list, or type a LIFX selector such as all, id:d073d5000000, group_id:..., location_id:... or label:Desk lamp. Separate up to 25 with commas.
- Power (`power`, text): Turn the lights on or off. One of: `on`, `off`.
- Color (`color`, text): The color, such as red, #ff0000, kelvin:2700 (warm white) or hue:120 saturation:1.
- Brightness (`brightness`, number): Brightness from 0 to 1, such as 0.5 for half. Overrides any brightness in the color. From 0 to 1.
- Duration (`duration`, number): How many seconds the change takes. LIFX uses 1 if left blank. From 0 to 3155760000.
- Infrared (`infrared`, number): Night vision brightness from 0 to 1, for LIFX lights with infrared. From 0 to 1.
- Fast (`fast`, true/false): Send the change without checking the lights first or waiting for them to answer. Quicker, but the step can't say which lights changed.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```

### Stop effects

Stop any breathe, pulse or firmware effect running on the lights.

**Inputs**

- Lights (`selector`, text, required): Which lights to stop effects on: pick from the list, or type a LIFX selector such as all, id:d073d5000000, group_id:..., location_id:... or label:Desk lamp. Separate up to 25 with commas.
- Power off (`power_off`, true/false): Also turn the lights off.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```

### Toggle lights on or off

Turn the lights off if any of them are on, or on if they are all off.

**Inputs**

- Lights (`selector`, text, required): Which lights to toggle: pick from the list, or type a LIFX selector such as all, id:d073d5000000, group_id:..., location_id:... or label:Desk lamp. Separate up to 25 with commas.
- Duration (`duration`, number): How many seconds the change takes. LIFX uses 1 if left blank. From 0 to 3155760000.

**Outputs**

- `data` (object): The response from LIFX.

**Example output**

```json
{
  "data": {
    "not_ok_count": 1,
    "ok_count": 1,
    "results": [
      {
        "id": "example",
        "label": "example",
        "status": "example"
      }
    ],
    "summary": "example"
  }
}
```
