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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID to turn off |
Implementation Reference
- src/fibaro-client.ts:124-132 (handler)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}`); } }
- src/index.ts:435-449 (handler)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}`, }, ], }; }
- src/index.ts:178-191 (schema)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'], }, },