Skip to main content

Control SwitchBot devices via chat with OpenRouter AI

Workflow preview

Workflow preview
100%
Control SwitchBot devices via chat with OpenRouter AI preview
Open on n8n.io

1. Workflow Overview

Control SwitchBot Devices with AI via Chat What this workflow does: This workflow lets you control your SwitchBot smart home devices using natural language chat. Tell the AI what you want to do (e....

Best for

  • Personal Productivity automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.set, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Fujii Ryota.

Original n8n.io source

1.1 Workflow description

Title
Control SwitchBot devices via chat with OpenRouter AI
Workflow name
Control SwitchBot devices via chat with OpenRouter AI

Control SwitchBot Devices with AI via Chat

What this workflow does: This workflow lets you control your SwitchBot smart home devices using natural language chat. Tell the AI what you want to do (e.g. "turn off the living room light"), and it will look up your devices, generate the correct SwitchBot API command, and send it automatically.

Workflow steps:

  1. When chat message received — triggered by a user message in the n8n chat interface
  2. Set Credentials — stores your SwitchBot API token and secret
  3. Get Auth — generates a signed authentication header using HMAC-SHA256
  4. Get Device List — fetches all registered devices from the SwitchBot API
  5. Generate API Request with AI — the AI reads the device list and user request, then generates the correct API URL and body
  6. Send Device Command — sends the POST request to SwitchBot to execute the command

Requirements:

  • SwitchBot account with API token and secret
  • OpenRouter API credentials (or swap for any compatible LLM)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Get Auth

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 2 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 3 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 4 - Set Credentials

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Get Device List

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 6 - Generate API Request with AI

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 7 - Send Device Command

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 8 - Workflow Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Note: Set Credentials

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Note: Get Auth

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Note: AI Agent

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Control SwitchBot devices via chat with OpenRouter AI
Complexity intermediate
Nodes 11
Categories Personal Productivity, AI Chatbot
Author Fujii Ryota
Published 09 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15566/15566.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Control SwitchBot devices via chat with OpenRouter AI do?

Control SwitchBot Devices with AI via Chat What this workflow does: This workflow lets you control your SwitchBot smart home devices using natural language chat. Tell the AI what you want to do (e....

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Chatbot use case.