Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

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
NameRequiredDescriptionDefault
idYesDevice ID
brightnessYesBrightness level (0-100)

Implementation Reference

  • 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}%`,
          },
        ],
      };
    }
  • 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'],
      },
    },
  • 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}`);
      }
    }

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