wyze_set_color_temp
Adjust the color temperature of Wyze smart lights to personalize ambiance or functionality. Specify device MAC and desired temperature (2700K-6500K) for precise control.
Instructions
Set color temperature for a Wyze light (2700K-6500K)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color_temp | Yes | ||
| device_mac | Yes |
Implementation Reference
- src/mcp_wyze_server/server.py:412-438 (handler)The handler function decorated with @mcp.tool(), which registers and implements the wyze_set_color_temp tool. It sets the color temperature of a Wyze light bulb using the wyze-sdk client.@mcp.tool() def wyze_set_color_temp(device_mac: str, color_temp: int) -> Dict[str, str]: """Set color temperature for a Wyze light (2700K-6500K)""" try: if not 2700 <= color_temp <= 6500: return {"status": "error", "message": "Color temperature must be between 2700K and 6500K"} client = get_wyze_client() devices = client.devices_list() for device in devices: if device.mac == device_mac and getattr(device, 'product_type', 'Unknown') in ['Light', 'Bulb', 'MeshLight', 'LightStrip']: client.bulbs.set_color_temp( device_mac=device_mac, device_model=getattr(device, 'product_model', 'Unknown'), color_temp=color_temp ) return {"status": "success", "message": f"Set {device.nickname} color temperature to {color_temp}K"} return {"status": "error", "message": f"Light with MAC {device_mac} not found"} except WyzeClientConfigurationError as e: return {"status": "error", "message": f"Configuration error: {str(e)}"} except WyzeRequestError as e: return {"status": "error", "message": f"API error: {str(e)}"} except Exception as e: return {"status": "error", "message": f"Unexpected error: {str(e)}"}