Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

fibaro_turn_off_device

Turn off a Fibaro HC3 smart home device by specifying its ID. Use this tool to control lights, switches, and other connected devices through the MCP server.

Instructions

Turn off a device (like lights, switches)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDevice ID to turn off

Implementation Reference

  • Core handler logic: sends POST request to Fibaro HC3 API /api/devices/{id}/action/turnOff to turn off the device.
    async turnOffDevice(id: number): Promise<void> {
      try {
        await this.client.post(`/api/devices/${id}/action/turnOff`, {
          args: []
        });
      } catch (error) {
        throw new Error(`Failed to turn off device ${id}: ${error}`);
      }
    }
  • MCP CallTool handler for 'fibaro_turn_off_device': validates connection, extracts device ID, calls FibaroClient.turnOffDevice, returns success response.
    case 'fibaro_turn_off_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.turnOffDevice(deviceId);
      return {
        content: [
          {
            type: 'text',
            text: `Successfully turned off device ${deviceId}`,
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input schema requiring 'id' as number.
    {
      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'],
      },
    },

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