Skip to main content
Glama
aldilaff
by aldilaff

wyze_set_color_temp

Adjust the color temperature of Wyze smart lights from warm (2700K) to cool (6500K) to match activities or preferences.

Instructions

Set color temperature for a Wyze light (2700K-6500K)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_macYes
color_tempYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the logic to set color temperature on a Wyze light device. Validates input range, finds device by MAC, calls Wyze API, and returns status.
    @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)}"}

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