set_color_temperature
Adjusts a light's color temperature using a 0-100 scale where 0 is warmest and 100 is coldest. Specify the device by its index or name.
Instructions
Set color temperature for a light.
Args: kelvin: Color temperature level (0-100). Note: 0 is warmest, 100 is coldest (standard Domoticz range). idx: Device index. name: Device name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kelvin | Yes | ||
| idx | No | ||
| name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:941-957 (handler)The `set_color_temperature` tool function. It is decorated with @mcp.tool(), takes 'kelvin' (0-100), 'idx', and 'name' parameters, resolves the device idx, and calls the Domoticz API with 'setkelvinlevel'.
@mcp.tool() async def set_color_temperature(kelvin: int, idx: int | None = None, name: str | None = None) -> str: """Set color temperature for a light. Args: kelvin: Color temperature level (0-100). Note: 0 is warmest, 100 is coldest (standard Domoticz range). idx: Device index. name: Device name. """ if idx is None and name is None: return '{"status": "error", "message": "Must provide either idx or name"}' async with create_client() as client: resolved_idx = await _resolve_device_idx(client, idx, name) if resolved_idx is None: return '{"status": "error", "message": "Device not found"}' response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=setkelvinlevel&idx={resolved_idx}&kelvin={kelvin}") return response.text - src/domoticz_mcp/server.py:941-941 (registration)The tool is registered via the @mcp.tool() decorator on line 941.
@mcp.tool() - src/domoticz_mcp/server.py:529-535 (helper)The agent_guidance prompt notes that color temperature uses a 0-100 range (0=warmest, 100=coldest), providing context for the tool's usage.
- Dimmers and Dimmer levels: Always 0 to 100. (0=Off, 100=Full). - Color Temperature (Kelvin): 0 to 100 (Where 0 is warmest/coldest depending on hardware, usually 0=Warm, 100=Cold). 5. TROUBLESHOOTING: - If a device is "Timed Out" or "Unresponsive", use `get_system_health` and check `domoticz://logs/error`. - To find which automation controls a device, use `search_scripts` with the device's name or idx. 6. USER VARIABLES: Use `get_user_variables` to read state that isn't attached to a physical device. """