🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Telegram to Home Assistant, control your smart home by chat

Lisa Granqvist Partner Workflow Automation Expert

Opening Home Assistant, finding the right dashboard, tapping the right toggle, then doing it again for the next thing gets old fast. And when you’re carrying groceries or half-asleep, it’s honestly worse.

Smart home tinkerers feel this daily. Property managers and small office owners run into it too, because “just turn off the lights” becomes a mini project. This Telegram Home Assistant automation lets you run your home with one chat thread, including voice notes.

You’ll see what the workflow does end-to-end, what you need to connect, and where the real time savings show up once it’s running.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Telegram to Home Assistant, control your smart home by chat

The Problem: Smart Home Control Still Friction-Filled

Smart homes are supposed to remove little annoyances. In practice, you end up app-switching: Telegram for family messages, Home Assistant for devices, maybe another app for a speaker, then back again. The friction isn’t just time. It’s mental overhead, especially when commands are simple but frequent (“lights,” “thermostat,” “goodnight,” “who left the garage open?”). Miss one step, pick the wrong entity, or get stuck in the wrong dashboard, and suddenly you’re troubleshooting instead of living in the house.

The friction compounds. Here’s where it breaks down.

  • You end up repeating the same actions across multiple rooms, which turns a 10-second idea into a 2-minute detour.
  • Voice assistants can be unreliable, and when they fail you still need the app as a backup.
  • Guests or team members don’t know your dashboards, so they ask you to do it anyway.
  • There’s no clean “confirmation trail,” so you’re never fully sure what actually happened.

The Solution: Telegram Chat Commands That Run Home Assistant

This n8n workflow creates a conversational bridge between Telegram (and n8n’s built-in chat) and Home Assistant. You send a text command like “turn on living room lights,” or you drop a voice note like “goodnight mode,” and the workflow does the busywork: it figures out intent, converts speech to text when needed, and triggers the right Home Assistant action through an MCP tool connector. It also keeps short-term context, so you can follow up naturally (“make it warmer” after asking for the bedroom temperature). Finally, it routes a clean confirmation back to the right place, with Telegram formatting that’s actually readable.

The workflow starts with an incoming message from Telegram or the n8n chat UI. If it’s a voice note, it downloads the audio and transcribes it with OpenAI Whisper. Then a Gemini-powered agent interprets what you want and calls Home Assistant to execute the action, before sending a confirmation back to the same channel you used.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you trigger smart home actions about 10 times a day (lights, thermostat, a scene, and a quick status check). Manually, that’s often about 30 seconds to unlock, open Home Assistant, and find the right control, so you lose roughly 5 minutes daily. With this workflow, you send a Telegram message in about 10 seconds, and voice notes take maybe another minute for transcription and processing while you do something else. Over a week, that’s around 30 minutes back, plus fewer mistakes.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Telegram Bot for receiving and replying to messages
  • Home Assistant to execute device actions and queries
  • OpenAI API key (get it from your OpenAI API dashboard)

Skill level: Intermediate. You’ll paste API keys, connect Telegram, and map a few fields, but you won’t be writing an application.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A message arrives in Telegram (or n8n chat). The workflow triggers on a new Telegram message or a message in n8n’s chat UI. It immediately sends a “typing…” action in Telegram so it feels responsive.

Voice notes get turned into text. If the incoming message is audio, n8n fetches the voice file from Telegram, transcribes it with OpenAI Whisper, then maps that transcript into the same input field used by normal text messages.

The assistant interprets intent and keeps context. Incoming text is normalized into a consistent structure (who sent it, where it came from, session ID). A Gemini chat model powers the “Smart Home Agent,” and short memory buffers keep the conversation coherent for follow-ups.

Home Assistant executes the action, then you get a confirmation. The agent calls the Home Assistant MCP tool to do the real work (turn on/off, adjust lights, broadcast a message, fetch a sensor value). A routing check sends the final response back to Telegram (beautified formatting) or back to the n8n chat webhook reply.

You can easily modify the recognized commands and response style to match your home setup and tone. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Telegram Trigger

This workflow starts by listening for incoming Telegram messages, then immediately branches to typing feedback and message normalization.

  1. Add and open Telegram Inbound Trigger.
  2. Set Updates to message.
  3. Credential Required: Connect your telegramApi credentials.
  4. Confirm that Telegram Inbound Trigger outputs to both Normalize Voice Or Text and Telegram Typing Action in parallel.
Parallel branches are important here: the typing indicator triggers immediately while message normalization runs in the background.

Step 2: Configure the Chat UI Message Trigger

This trigger enables direct web chat input to the assistant, feeding the same normalization path as Telegram.

  1. Add and open Chat UI Message Trigger.
  2. Set Public to true.
  3. In Options, set Load Previous Session to memory.
  4. Ensure Chat UI Message Trigger connects to Normalize Incoming Messages.

Step 3: Set Up Voice/Text Normalization and Transcription

This section handles voice input detection, voice file retrieval, transcription, and mapping transcript into the unified input field.

  1. In Normalize Voice Or Text, set text to {{ $json?.message?.text || "" }}.
  2. In Text Presence Check, set the condition to check if leftValue {{ $json.message.text }} is empty.
  3. In Fetch Voice File, set Resource to file and File ID to {{ $json.message.voice.file_id }}.
  4. Credential Required: Connect your telegramApi credentials in Fetch Voice File.
  5. In Transcribe Audio, set Resource to audio and Operation to transcribe.
  6. Credential Required: Connect your openAiApi credentials in Transcribe Audio.
  7. In Map Transcript to Input, set chatInput to {{ $json.text }}.
  8. Ensure Map Transcript to Input connects to Normalize Incoming Messages.

Step 4: Set Up AI Processing and Home Assistant Integration

Normalized inputs are passed into the smart agent, which uses Gemini and a Home Assistant MCP tool with memory buffers.

  1. In Normalize Incoming Messages, keep the provided JavaScript to produce inputText, source, and sessionId.
  2. In Smart Home Agent, set Text to {{ $json.inputText }} and Prompt Type to define.
  3. Open Gemini Chat Model and connect it to Smart Home Agent as the language model.
  4. Credential Required: Connect your googlePalmApi credentials in Gemini Chat Model.
  5. In Home Assistant MCP Tool, set Endpoint URL to http://0.0.0.0:8123/mcp_server/sse and Authentication to bearerAuth.
  6. Credential Required: Connect your httpBearerAuth credentials in Home Assistant MCP Tool.
  7. Keep Short Memory Buffer connected as the ai_memory source for Smart Home Agent.
  8. Keep Short Memory Buffer A connected as the ai_memory source for Chat UI Message Trigger.
⚠️ Common Pitfall: Memory buffers and MCP tools are connected to the parent AI nodes. Configure credentials and model settings on the parent nodes (e.g., Smart Home Agent, Gemini Chat Model), not the memory sub-nodes.

Step 5: Configure Output Routing and Responses

The workflow branches response formatting based on the message source and sends replies to Telegram or a webhook response.

  1. In Response Route Check, set the condition to check leftValue {{ $('Normalize Incoming Messages').item.json.source }} equals telegram.
  2. In Telegram Output Formatter, keep the JavaScript formatting and chunking logic as provided to format HTML output.
  3. In Telegram Reply Sender, set Text to {{ $json.text }} and Chat ID to {{ $('Telegram Inbound Trigger').item.json.message.chat.id }}.
  4. In Telegram Reply Sender, confirm Parse Mode is set to HTML.
  5. Credential Required: Connect your telegramApi credentials in Telegram Reply Sender.
  6. In Webhook Reply Output, set Respond With to text and Response Body to {{ $json.output }}.
  7. In Telegram Typing Action, set Operation to sendChatAction and Chat ID to {{ $('Telegram Inbound Trigger').item.json.message.chat.id }}.
  8. Credential Required: Connect your telegramApi credentials in Telegram Typing Action.

Final Step: Test and Activate Your Workflow

Verify both Telegram and Chat UI inputs, then activate the workflow for production use.

  1. Click Execute Workflow to run a manual test.
  2. Send a Telegram text and a Telegram voice message to ensure both the text path and transcription path reach Normalize Incoming Messages.
  3. Send a message via the Chat UI and confirm it routes through Normalize Incoming Messages and Smart Home Agent.
  4. Check that Telegram replies are formatted and delivered through Telegram Reply Sender, and non-Telegram responses go through Webhook Reply Output.
  5. When satisfied, toggle the workflow to Active to enable production execution.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Telegram bot permissions can be the silent blocker. If replies stop working, check the bot token in n8n and confirm the chat ID is correct for the conversation you’re testing.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this Telegram Home Assistant automation?

About 30 minutes if your Telegram bot and Home Assistant are already working.

Do I need coding skills to automate Telegram smart home control?

No. You’ll mostly connect accounts, paste API keys, and adjust a few message-mapping fields in n8n.

Is n8n free to use for this Telegram Home Assistant workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI Whisper costs (usually a few cents for short voice notes) and any Gemini usage on your Google AI plan.

Where can I host n8n to run this Telegram Home Assistant automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Telegram Home Assistant workflow for multiple rooms and “scenes”?

Yes, and you should. You can expand the Smart Home Agent’s instructions to include your room names and scene names, then let the Home Assistant MCP tool handle the actual calls. Common customizations include adding a “goodnight” routine, limiting control to a whitelist of entities, and changing the Telegram message beautifier so confirmations match your preferred format.

Why is my Telegram connection failing in this workflow?

Usually it’s an invalid or rotated bot token in n8n. Update the Telegram credentials, then confirm you’re messaging the correct bot and testing in the chat you expect. If voice notes are failing specifically, also check that the workflow can fetch the voice file from Telegram and that your OpenAI API key still has access to the transcription endpoint.

How many messages can this Telegram Home Assistant automation handle?

A lot for a typical home. On n8n Cloud Starter, you’re limited by monthly executions, while self-hosting mainly depends on your server. In practice, this workflow handles normal household traffic easily, and the only real bottleneck is how fast your AI transcription/model responses return.

Is this Telegram Home Assistant automation better than using Zapier or Make?

For conversational smart home control, usually yes. n8n handles branching, memory, and agent-style logic cleanly, and you can self-host for unlimited executions, which matters once you start using it daily. Zapier and Make are fine for simple “when X then Y,” but they get awkward when you want follow-up questions, voice transcription, and tool-calling in the same flow. Also, Home Assistant integrations tend to be more flexible when you can call what you need rather than hoping a prebuilt action exists. If you want a second opinion, Talk to an automation expert and we’ll help you pick the simplest option that still works.

Once this is set up, smart home control becomes a quick message, not a mini mission. The workflow handles the repetitive stuff. You handle the rest.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal