set_color_temperature
Adjust a light's color temperature in Domoticz by specifying a kelvin value from 0 (warm) to 100 (cold).
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:989-1005 (handler)The 'set_color_temperature' tool handler function. It is decorated with @mcp.tool(), takes 'kelvin' (0-100), 'idx', and 'name' parameters, resolves the device by idx/name, and calls the Domoticz API 'setkelvinlevel' endpoint.
@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:989-997 (schema)Input schema/definition embedded in the function signature and docstring: kelvin (int, 0-100), idx (optional int), name (optional str). Also referenced in agent_guidance prompt at line 533.
@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. """ - src/domoticz_mcp/server.py:989-989 (registration)Tool registration via the @mcp.tool() decorator on the async function 'set_color_temperature'. The FastMCP instance 'mcp' is created at line 70.
@mcp.tool()