Skip to main content
Glama

fibaro_set_color

Change RGB or color-changing light colors on Fibaro HC3 devices. Specify device ID and RGB values (0-255) to set custom colors, including optional white for enhanced lighting control.

Instructions

Set RGB color for RGB lights and color-changing devices. Use this when user mentions colors, color names, or wants to change light color. Keywords: color, red, green, blue, yellow, purple, pink, orange, cyan, magenta, white, RGB, màu.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blueYesBlue color value (0-255)
greenYesGreen color value (0-255)
idYesDevice ID
redYesRed color value (0-255)
whiteNoWhite color value (0-255), optional

Implementation Reference

  • MCP tool handler for 'fibaro_set_color' that validates connection, extracts RGBW parameters from arguments, calls FibaroClient.setColor, and returns success message.
    case 'fibaro_set_color': { if (!this.fibaroClient) { throw new Error('Not connected to Fibaro HC3. Please check your configuration and restart the MCP server.'); } const deviceId = args?.id as number; const red = args?.red as number; const green = args?.green as number; const blue = args?.blue as number; const white = args?.white as number || 0; await this.fibaroClient.setColor(deviceId, red, green, blue, white); return { content: [ { type: 'text', text: `Successfully set color for device ${deviceId} to RGB(${red},${green},${blue},${white})`, }, ], }; }
  • FibaroClient method implementing the core logic: sends POST request to Fibaro HC3 API endpoint /api/devices/{id}/action/setColor with RGBW values in args.
    async setColor(id: number, red: number, green: number, blue: number, white: number = 0): Promise<void> { try { await this.client.post(`/api/devices/${id}/action/setColor`, { args: [red, green, blue, white] }); } catch (error) { throw new Error(`Failed to set color for device ${id} to RGB(${red},${green},${blue},${white}): ${error}`); } }
  • src/index.ts:234-271 (registration)
    Tool registration in ListTools response, including name, description, and detailed input schema with validation for device ID and RGBW color components.
    { name: 'fibaro_set_color', description: 'Set RGB color for RGB lights and color-changing devices. Use this when user mentions colors, color names, or wants to change light color. Keywords: color, red, green, blue, yellow, purple, pink, orange, cyan, magenta, white, RGB, màu.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, red: { type: 'number', description: 'Red color value (0-255)', minimum: 0, maximum: 255, }, green: { type: 'number', description: 'Green color value (0-255)', minimum: 0, maximum: 255, }, blue: { type: 'number', description: 'Blue color value (0-255)', minimum: 0, maximum: 255, }, white: { type: 'number', description: 'White color value (0-255), optional', minimum: 0, maximum: 255, }, }, required: ['id', 'red', 'green', 'blue'], }, },

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/kaeljune/fibaro-mcp-server'

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