fibaro_set_brightness
Adjust brightness or dimmer levels for smart lights and dimmable devices within the Fibaro Home Center 3 ecosystem. Specify device ID and brightness percentage (0-100%) for precise control.
Instructions
Set brightness or dimmer level for lights and dimmable devices. Use this when user mentions brightness, dimming, intensity, or percentage levels (0-100%). Keywords: bright, dim, brightness, level, percent, %.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brightness | Yes | Brightness level (0-100) | |
| id | Yes | Device ID |
Implementation Reference
- src/index.ts:469-484 (handler)MCP tool handler for fibaro_set_brightness: extracts parameters and calls FibaroClient.setBrightnesscase 'fibaro_set_brightness': { 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 brightness = args?.brightness as number; await this.fibaroClient.setBrightness(deviceId, brightness); return { content: [ { type: 'text', text: `Successfully set brightness for device ${deviceId} to ${brightness}%`, }, ], }; }
- src/index.ts:215-233 (schema)Input schema and metadata for the fibaro_set_brightness toolname: 'fibaro_set_brightness', description: 'Set brightness or dimmer level for lights and dimmable devices. Use this when user mentions brightness, dimming, intensity, or percentage levels (0-100%). Keywords: bright, dim, brightness, level, percent, %.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, brightness: { type: 'number', description: 'Brightness level (0-100)', minimum: 0, maximum: 100, }, }, required: ['id', 'brightness'], }, },
- src/index.ts:109-331 (registration)Tool registration in the ListToolsRequestSchema handler, includes fibaro_set_brightness in the tools listthis.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'fibaro_get_devices', description: 'Get all devices from Fibaro HC3', inputSchema: { type: 'object', properties: {}, }, }, { name: 'fibaro_get_device', description: 'Get specific device by ID from Fibaro HC3', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, }, required: ['id'], }, }, { name: 'fibaro_get_scenes', description: 'Get all scenes from Fibaro HC3', inputSchema: { type: 'object', properties: {}, }, }, { name: 'fibaro_get_scene', description: 'Get specific scene by ID from Fibaro HC3', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Scene ID', }, }, required: ['id'], }, }, { name: 'fibaro_get_rooms', description: 'Get all rooms from Fibaro HC3', inputSchema: { type: 'object', properties: {}, }, }, { name: 'fibaro_turn_on_device', description: 'Turn on a device (like lights, switches)', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID to turn on', }, }, required: ['id'], }, }, { name: 'fibaro_turn_off_device', description: 'Turn off a device (like lights, switches)', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID to turn off', }, }, required: ['id'], }, }, { name: 'fibaro_set_device_value', description: 'Set a specific property value for a device. Use this ONLY for advanced properties like temperature setpoints, modes, or custom device properties. Do NOT use for brightness (use fibaro_set_brightness) or colors (use fibaro_set_color).', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, property: { type: 'string', description: 'Property name to set (e.g., "targetTemperature", "mode", "state")', }, value: { type: ['string', 'number', 'boolean'], description: 'Value to set', }, }, required: ['id', 'property', 'value'], }, }, { name: 'fibaro_set_brightness', description: 'Set brightness or dimmer level for lights and dimmable devices. Use this when user mentions brightness, dimming, intensity, or percentage levels (0-100%). Keywords: bright, dim, brightness, level, percent, %.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, brightness: { type: 'number', description: 'Brightness level (0-100)', minimum: 0, maximum: 100, }, }, required: ['id', 'brightness'], }, }, { 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'], }, }, { name: 'fibaro_control_rgb_light', description: 'Complete control for RGB lights: turn on/off, set color, and brightness in one command. Use this when user wants to control multiple aspects of an RGB light at once (e.g., "turn on light 5 red color at 50% brightness").', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, action: { type: 'string', enum: ['on', 'off'], description: 'Turn light on or off', }, color_name: { type: 'string', description: 'Color name (e.g., "red", "green", "blue", "xanh lá", "tím")', }, brightness: { type: 'number', description: 'Brightness level (0-100), optional', minimum: 0, maximum: 100, }, }, required: ['id', 'action'], }, }, { name: 'fibaro_run_scene', description: 'Run/start a scene', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Scene ID to run', }, }, required: ['id'], }, }, { name: 'fibaro_stop_scene', description: 'Stop a running scene', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Scene ID to stop', }, }, required: ['id'], }, }, ], }; });
- src/fibaro-client.ts:144-152 (helper)FibaroClient helper method that performs the actual HTTP POST to set device brightness via Fibaro APIasync setBrightness(id: number, brightness: number): Promise<void> { try { await this.client.post(`/api/devices/${id}/action/setValue`, { args: [brightness] }); } catch (error) { throw new Error(`Failed to set brightness for device ${id} to ${brightness}: ${error}`); } }