fibaro_set_brightness
Adjust lighting brightness or dimmer levels for smart home devices by specifying a percentage value from 0 to 100. Use this tool to control light intensity in your Fibaro Home Center 3 system.
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 |
|---|---|---|---|
| id | Yes | Device ID | |
| brightness | Yes | Brightness level (0-100) |
Implementation Reference
- src/index.ts:469-484 (handler)MCP tool handler for fibaro_set_brightness: checks Fibaro connection, extracts device ID and brightness arguments, delegates to FibaroClient.setBrightness method, and returns formatted success response.case '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:217-232 (schema)Input schema defining parameters for fibaro_set_brightness tool: device ID (number) and brightness (number between 0-100), both required.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:214-233 (registration)Registration of fibaro_set_brightness tool in the ListTools response, including name, description, and input schema.{ 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'], }, },
- src/fibaro-client.ts:144-152 (helper)FibaroClient.setBrightness helper method: performs HTTP POST request to Fibaro HC3 API endpoint /api/devices/{id}/action/setValue with brightness value as argument.async 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}`); } }