---
related_nodes: [relay_status, relay_request]
---

# Hue Action

Lists and controls Philips Hue lights, rooms, zones, and scenes through a Verdalia Relay
connection whose relay has a paired bridge.

The listing operations exist so a workflow never has to hard-code a bridge id: run
`list_lights`, `list_groups`, or `list_scenes` and feed an id forward, or select by name and
let the node resolve it.

## Configuration

**connection** — Verdalia Relay connection: pick one, or write a template such as
`{{ input.connection_id }}` that resolves to a connection id from `input` on each run. The node
fails, naming the template and what it resolved to, when the input has no value for it, the value
is not a connection id, no Verdalia Relay connection has that id, or that relay is offline. The
bridge is paired on the relay host with `verdalia-relay hue pair`; this node does not pair.

**operation** — `op`-tagged union:

- `list_lights` — every light with `id`, `name`, `on`, `brightness`, `reachable`, `color`.
- `get_light` — one light's current state. Fields: `light`.
- `set_light` — switch, dim, or colour one light. Fields: `light`, `power`, `brightness`,
  `brightness_delta`, `color`, `transition`.
- `list_groups` — every room and zone with the light ids it contains.
- `get_group` — what a room or zone currently reports. Fields: `group`.
- `set_group` — apply one state to every light in a room or zone. Fields: `group`, `power`,
  `brightness`, `brightness_delta`, `color`, `transition`.
- `list_scenes` — every scene, with which one the bridge is showing.
- `get_scene` — one scene's content: the state it gives each light, and its palette.
  Fields: `scene`.
- `activate_scene` — recall a scene and report its content afterwards. Fields: `scene`,
  `recall`, `brightness`, `transition`.
- `get_bridge` — whether a bridge is paired and whether it answers.

### Selectors

`light`, `group`, and `scene` are `by`-tagged unions, both forms interpolatable:

- `{"by": "id", "light_id": "..."}` — the bridge's own id.
- `{"by": "name", "name": "Desk Lamp"}` — matched case-insensitively against the bridge's
  listing. A name nothing answers to fails with the available names; a name two resources
  share fails rather than picking one.

`group` and `scene` use `group_id` / `scene_id` for the id form.

### power

`power`-tagged union. For a light: `on`, `off`, `toggle`, `unchanged` (default `on`).
Only `toggle` reads the light first; `unchanged` leaves the switch out of the write, so
changing brightness or colour never switches a light by accident.

For a room or zone: `on`, `off`, or `unchanged`. A group has no readable switch, so it
cannot be toggled.

### color

`mode`-tagged union, default `unchanged`:

- `unchanged` — leave the colour alone.
- `hsb` — `hue` and `saturation`, both 0.0–1.0.
- `rgb` — `red`, `green`, `blue`, each 0–255.
- `temperature` — `kelvin`, 2000–6500.

### recall

`mode`-tagged union, default `active`. How the bridge plays the scene back:

- `active` — apply the scene's stored state, starting its palette if it has one.
- `dynamic_palette` — play the scene's palette as a cycle.
- `static` — hold the stored state, whatever palette the scene carries.

**brightness** — 0.0–1.0, optional. On `set_light` and `set_group`, empty keeps the current
brightness. On `activate_scene` it recalls the scene at that level, and empty keeps the
scene's own levels.

**brightness_delta** — -1.0 to 1.0, optional, on `set_light` and `set_group`. Changes the
brightness by that much from whatever it is now: `-0.1` dims a room by a tenth without
switching it. Never zero, and never set alongside `brightness` — the bridge takes a level
or a step, not both.

**transition** — fade in seconds, optional and never negative.

### Values from the workflow

`brightness`, `brightness_delta`, `transition`, and every field of `color` take a value or
a template, so a level, a fade, or a colour can come from an earlier node:
`{{ input.level }}`. The ranges above still hold; a value typed outside one is reported
before the workflow runs. A template that renders as something no number reads from, or as
nothing where the operation needs a value, fails the run and names the field.

## Inputs

**input** — JSON value used as the interpolation context for selector and value fields.

## Output

**output** — one object per operation.

`list_lights`:

```json
{
  "lights": [
    {
      "id": "0a1b",
      "name": "Desk Lamp",
      "on": true,
      "brightness": 0.8,
      "reachable": true,
      "color": { "hue": 0.1, "saturation": 0.4 }
    }
  ],
  "count": 1
}
```

`get_light` and `set_light`:

```json
{ "id": "0a1b", "on": true, "brightness": 0.4, "color": { "kelvin": 2700 } }
```

`list_groups` gives `{ "groups": [{ "id", "name", "lights" }], "count" }`.

`get_group` and `set_group` give the room or zone as the bridge aggregates it — `on` is
true when any light in it is on, and `brightness` is the average over the lit ones:

```json
{ "id": "3c7e", "on": true, "brightness": 0.34 }
```

`list_scenes` gives `{ "scenes": [...], "count" }`, each scene carrying `id`, `name`,
`group_id`, `active` (`inactive`, `static`, `dynamic_palette`, or `unknown` for a state
this build does not know), `last_recall`, `speed`, and `auto_dynamic`. `active` is the
bridge's own reading and drops back to `inactive` as soon as a light in the room is
changed by hand, while `last_recall` keeps the time.

`get_scene` and `activate_scene` give that same scene, plus its content:

```json
{
  "id": "546b",
  "name": "Fall harvest",
  "group_id": "3c7e",
  "active": "static",
  "last_recall": "2026-09-14T19:22:01Z",
  "speed": 0.5,
  "auto_dynamic": false,
  "actions": [
    { "light_id": "0a1b", "on": true, "brightness": 0.62, "color": { "kelvin": 2700 } }
  ],
  "palette": [{ "color": { "hue": 0.08, "saturation": 0.73 }, "brightness": 0.62 }]
}
```

`get_bridge` gives
`{ "configured", "connected", "ip_address", "bridge_id", "bridge_name", "error" }`.

Relay and bridge errors fail the node. An unreachable bridge fails every operation except
`get_bridge`, which reports it.
