---
type: Attested Computation
title: hue-set
identifier: home-automation/hue-set
description: Set a Philips Hue light (or all lights) via the bridge's local v1 API -- on/off/toggle, brightness percent, white temperature (kelvin or mired), color by hue degrees + saturation percent or by hex (e.g. hex=#ff8000). Light by numeric id or by name (exact then substring match, like home-automation/roku-launch.py); id=all drives group 0. Pairs with home-automation/hue-lights.py for discovery.
pack: home-automation
tags:
- internet
runtime: fragletc
image: ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522
network: required
stdin: none
execution_class: environmental
procedure_hash: sha256:bbc1abfc22c04f36d4b6eae98cd08a66e0fcf6f93ede43777fe911f48dd4b3f8
parameters:
- name: ip
  type: string
  required: true
  description: LAN IP address of the Hue bridge, e.g. 192.168.0.245
- name: id
  type: string
  required: true
  description: Numeric light id, light name (e.g. "kitchen"), or "all" for every light
- name: 'on'
  type: string
  required: false
  description: on, off, or toggle (toggle reads current state first; for "all", any-on means all-off)
- name: bri
  type: string
  required: false
  description: Brightness 0-100 percent (0 turns the light off)
- name: temp
  type: string
  required: false
  description: White point in kelvin, e.g. 2700 warm / 4000 neutral / 6500 daylight (mutually exclusive with ct)
- name: ct
  type: string
  required: false
  description: White point in mired, 153-500 (Hue-native; mutually exclusive with temp)
- name: hue
  type: string
  required: false
  description: Color hue in degrees 0-360 (needs a color-capable bulb)
- name: sat
  type: string
  required: false
  description: Color saturation 0-100 percent (pairs with hue)
- name: hex
  type: string
  required: false
  description: 'Hex color like #ff8000 or ff8000 (3 or 6 digits, # optional); shorthand for hue+sat, mutually exclusive with them'
- name: transition
  type: string
  required: false
  description: Fade time in seconds (Hue transitiontime is deciseconds; default bridge 0.4s)
- name: name
  type: string
  required: false
  description: New name for the light on the bridge (e.g. name="Living room"; id=all refused)
- name: delete
  type: string
  required: false
  description: Set true to DELETE this light from the bridge (numeric id only -- names and all refused; irreversible)
computation: https://tools.ofthemachine.com/home-automation/hue-set.py
executor:
  resource: https://github.com/ofthemachine/fraglet
  receipt:
  - schema
  - fragletc
  - procedure
  - procedure_hash
  - image
  - image_digest
  - network
  - stdin_mode
  - params
  - inputs
  - argv
  - env
  - memo_key
  - started
  - finished
  - exit_code
  - stdout
  - outputs
  format: fraglet-receipt/2 (fragletc --receipt <path>, or FRAGLETC_RECEIPT_DIR)
attester:
  resource: https://tools.ofthemachine.com/receipt/attest.py
  method: 'deterministic, no re-execution: procedure_hash equals sha256 of computation; memo_key recomputes from the receipt''s own fields; claimed params and any artifact hash match the receipt'
generated:
  by: process:tools/catalog/compile.py
  at: '2026-11-13T18:27:40Z'
secrets:
- HUE_USER
---

# hue-set

Set a Philips Hue light (or all lights) via the bridge's local v1 API -- on/off/toggle, brightness percent, white temperature (kelvin or mired), color by hue degrees + saturation percent or by hex (e.g. hex=#ff8000). Light by numeric id or by name (exact then substring match, like home-automation/roku-launch.py); id=all drives group 0. Pairs with home-automation/hue-lights.py for discovery.

Use when the user asks to turn a light on or off, dim/brighten, or change its color or warmth -- e.g. "turn off the kitchen", "dim living room to 30", "warm the bedroom".

# Schema

## Parameters
- `ip` (string, required) — LAN IP address of the Hue bridge, e.g. 192.168.0.245
- `id` (string, required) — Numeric light id, light name (e.g. "kitchen"), or "all" for every light
- `on` (string, optional) — on, off, or toggle (toggle reads current state first; for "all", any-on means all-off)
- `bri` (string, optional) — Brightness 0-100 percent (0 turns the light off)
- `temp` (string, optional) — White point in kelvin, e.g. 2700 warm / 4000 neutral / 6500 daylight (mutually exclusive with ct)
- `ct` (string, optional) — White point in mired, 153-500 (Hue-native; mutually exclusive with temp)
- `hue` (string, optional) — Color hue in degrees 0-360 (needs a color-capable bulb)
- `sat` (string, optional) — Color saturation 0-100 percent (pairs with hue)
- `hex` (string, optional) — Hex color like #ff8000 or ff8000 (3 or 6 digits, # optional); shorthand for hue+sat, mutually exclusive with them
- `transition` (string, optional) — Fade time in seconds (Hue transitiontime is deciseconds; default bridge 0.4s)
- `name` (string, optional) — New name for the light on the bridge (e.g. name="Living room"; id=all refused)
- `delete` (string, optional) — Set true to DELETE this light from the bridge (numeric id only -- names and all refused; irreversible)
- `HUE_USER` (secret, required) — read from the caller's environment, never passed with `-p`; Hue API username from link-button pairing (export HUE_USER on the agent host; delivered as a file, never a param, so it stays out of chat and the ledger)

## Outputs
- stdout (the anonymous result)

# Execution

The computation is [`home-automation/hue-set.py`](https://tools.ofthemachine.com/home-automation/hue-set.py) (frontmatter `computation`; in `tools.tar.gz` the same file sits at `home-automation/hue-set.py` beside this bundle), run by `fragletc` in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522` with network `required`. Its identity is `procedure_hash` = sha256 of that file, shebang included — the same value every receipt records. Parameters are passed as `-p name=value`; `--receipt run.json` (or `FRAGLETC_RECEIPT_DIR`) writes the receipt, a `fraglet-receipt/2` JSON document with the fields listed under `executor.receipt`.

# Attestation

A run's receipt is attested with [`receipt/attest.py`](https://tools.ofthemachine.com/receipt/attest.py): the computation that ran is this script (`procedure_hash`), the receipt is internally consistent (`memo_key` recomputes from its own fields), the claimed parameters are the ones that ran, and an artifact claimed as an output hashes to what the receipt recorded. No re-execution: attestation is provenance fidelity, not reproduction.

Environmental: the tool reaches the network, so outputs depend on state outside its inputs; the receipt records exactly what ran and what came out and makes no reproduction claim.

Skill: [SKILL.md](https://tools.ofthemachine.com/home-automation/SKILL.md)
