Skip to main content
Glama
aldilaff
by aldilaff

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
NameRequiredDescriptionDefault
device_macYes
enabledNo

Implementation Reference

  • 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)}"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aldilaff/mcp-wyze-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server