Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

fibaro_turn_on_device

Activate smart home devices such as lights or switches in your Fibaro Home Center 3 system by specifying the device ID.

Instructions

Turn on a device (like lights, switches)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDevice ID to turn on

Implementation Reference

  • MCP tool handler for 'fibaro_turn_on_device': validates connection, extracts device ID from arguments, calls FibaroClient.turnOnDevice, and returns success message.
    case 'fibaro_turn_on_device': {
      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;
      await this.fibaroClient.turnOnDevice(deviceId);
      return {
        content: [
          {
            type: 'text',
            text: `Successfully turned on device ${deviceId}`,
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input schema requiring a numeric 'id'.
    {
      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'],
      },
    },
  • src/index.ts:109-331 (registration)
    Registration of all tools including 'fibaro_turn_on_device' in the ListToolsRequestSchema handler.
    this.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'],
            },
          },
        ],
      };
    });
  • FibaroClient helper method that sends HTTP POST to Fibaro API to turn on the specified device.
    async turnOnDevice(id: number): Promise<void> {
      try {
        await this.client.post(`/api/devices/${id}/action/turnOn`, {
          args: []
        });
      } catch (error) {
        throw new Error(`Failed to turn on device ${id}: ${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