fibaro_turn_on_device
Activate a specific device (e.g., lights, switches) connected to Fibaro Home Center 3 by providing its unique device ID for immediate control.
Instructions
Turn on a device (like lights, switches)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID to turn on |
Implementation Reference
- src/index.ts:419-433 (handler)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}`, }, ], }; }
- src/index.ts:165-177 (registration)Tool registration in ListTools response, including name, description, and input schema specifying required 'id' parameter.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/fibaro-client.ts:114-122 (helper)FibaroClient helper method that performs the actual HTTP POST request to turn on the device via Fibaro HC3 API.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}`); } }