wyze_set_light_sun_match
Adjust Wyze light color temperature automatically based on time of day to match natural sunlight patterns for improved comfort and energy efficiency.
Instructions
Enable or disable sun matching for a Wyze light (adjusts color temperature based on time of day)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_mac | Yes | ||
| enabled | No |
Implementation Reference
- src/mcp_wyze_server/server.py:507-530 (handler)The main handler function for the wyze_set_light_sun_match tool. It uses the Wyze SDK to enable or disable sun matching (automatic color temperature adjustment based on time of day) for a specified light device by MAC address. The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool() def wyze_set_light_sun_match(device_mac: str, enabled: bool = True) -> Dict[str, str]: """Enable or disable sun matching for a Wyze light (adjusts color temperature based on time of day)""" try: 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_sun_match( device_mac=device_mac, device_model=getattr(device, 'product_model', 'Unknown'), sun_match=enabled ) status = "enabled" if enabled else "disabled" return {"status": "success", "message": f"Sun matching {status} for {device.nickname}"} 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)}"}