Tasker → n8n → HA → AI
Master Training Curriculum

5-Tier Roadmap · 3 Build Labs · YouTube Index · Google Tasks Micro-Plan

Tasker 6.6 n8n Self-Hosted HA REST API Gemini / Ollama Local-First
Part 1

Operational Syllabus & Roadmap

ℹ️Foundation Rule: Each tier unlocks the next. Don't skip. Tiers 1–2 work entirely on your LAN — no cloud needed.
1
Tasker HTTP Foundations
Make the phone talk JSON to anything
🏆 Win Condition

Tasker POSTs JSON to a test endpoint, reads a response field, shows it in a notification. Error branch fires on bad response code.

  • Profile → Task → Variable architecture
  • HTTP Request action (GET / POST)
  • Headers: Content-Type:application/json
  • Body: raw JSON with Tasker vars
  • Native JSON: %http_data.fieldname
  • Read %http_response_code
  • Global vs local variables (case rule)
  • Continue After Error + branch logic
2
Home Assistant Direct Control
Tasker ↔ HA with no middleman
🏆 Win Condition

Tasker turns a light on/off via HA REST API. HA broadcasts an intent back. Tasker catches it and speaks the result.

  • Create HA Long-Lived Access Token
  • GET /api/ — health check
  • GET /api/states/light.x
  • POST /api/services/light/turn_on
  • HA Webhook trigger (local_only: true)
  • command_broadcast_intent → Tasker
  • Intent Received profile in Tasker
  • Intent extras as local variables
3
n8n as the Hub
Route, transform, orchestrate
🏆 Win Condition

Tasker hits n8n Production webhook → n8n calls HA → n8n returns structured JSON to Tasker. Round trip under 5 seconds.

⚠️Critical gotcha: Test URL only works while n8n editor is listening. Production URL only works when workflow is ACTIVE. Always use Production URL in Tasker.
  • n8n Docker self-host basics
  • Webhook node — Header Auth setup
  • Test vs Production URL (burn this in)
  • HTTP Request node → HA service call
  • Respond to Webhook node
  • Built-in HA node (Service / State ops)
  • Switch node — intent routing
  • Accessing {{$json.body.field}}
4
AI Integration
Gemini, Ollama, structured outputs
🏆 Win Condition

Natural language command on phone → AI parses intent → correct HA service fires → AI-written reply returns to Tasker.

  • Gemini API direct from Tasker HTTP Request
  • Store key in global %GEMINI_KEY
  • Ollama via n8n (Docker networking)
  • stream: false — always required
  • JSON Schema output from LLM
  • n8n AI Agent + HA node as tool
  • Entity allowlist (security)
  • /api/conversation/process shortcut
5
End-to-End Pipelines
Jarvis-grade loops with return paths
🏆 Win Condition

Full async loop: voice trigger → n8n agent → HA executes → AI reply returns as actionable notification with Yes/No buttons. Works on LAN and via Tailscale off-LAN.

  • command_broadcast_intent — async return
  • AutoNotification action buttons → webhook
  • Tasker HTTP server inbound (port 1821)
  • n8n → Tasker push over LAN
  • Tailscale for off-LAN access
  • Full error handling stack
  • ZeroClaw-style watchdog patterns
  • Capstone: voice → AI → HA → spoken reply

Part 2

Hands-On Lab Blueprints

Lab 1 · Tier 2
📍 Phone Check-In Reporter
Tasker → HA REST API. Phone sends battery + WiFi status to HA. HA broadcasts confirmation back to phone.

🎯 Objective

No AI. No n8n. Just Tasker ↔ HA REST. Proves the foundation before adding complexity.

Triggers, Variables & Actions

ItemValue
TriggerTime → Every 30 minutes
%HA_HOSThttp://192.168.x.x:8123
%HA_TOKENLong-Lived Access Token (global)
%BATTBuilt-in Tasker var — battery %
%WIFIIBuilt-in Tasker var — WiFi SSID
Action 1HTTP Request → POST to HA webhook
Action 2If %http_response_code = 200 → Flash "✅ Sent"
Action 3Else → Flash "❌ %http_response_code"

Tasker HTTP Request

Method: POST URL: %HA_HOST/api/webhook/tasker-checkin-abc123 Headers: Content-Type:application/json Body: { "device": "%DEVICEID", "battery": %BATT, "wifi": "%WIFII", "timestamp": "%DATE %TIME" } Timeout: 10 Continue After Error: ON ✓

HA automation.yaml — webhook → broadcast back

alias: Tasker Check-In Handler triggers: - trigger: webhook webhook_id: tasker-checkin-abc123 allowed_methods: [POST] local_only: true actions: - action: notify.mobile_app_YOUR_PHONE data: message: command_broadcast_intent data: intent_package_name: net.dinglisch.android.taskerm intent_action: com.example.HA_CHECKIN_ACK intent_extras: "battery:{{ trigger.json.battery }}:int"

Tasker Intent Received Profile

// Profile: Event → System → Intent Received Action Filter: com.example.HA_CHECKIN_ACK // Task: Flash: "HA confirmed. Battery: %battery"

✅ 3-Step Verification

1 Run Task manually → Tasker log → %http_response_code = 200
2 HA Developer Tools → Events → fire webhook manually → automation triggers
3 Phone Flash shows battery number echoed back from HA
Lab 2 · Tier 3 + 4
🗣️ AI Light Commander
Voice text → Tasker → n8n → Gemini → HA service call → AI reply spoken on phone. Synchronous round-trip.

🎯 Objective

Speak a command. Gemini parses intent. HA turns lights on/off. AI reply returns in same HTTP response.

📱 Tasker
→
n8n Webhook
→
Gemini API
→
HA Service
→
📱 Reply

Triggers, Variables & Actions

ItemValue
TriggerGet Voice action → store in %prompt
%N8N_URLhttp://n8n.local:5678/webhook/android-ai
%N8N_SECRETHeader Auth secret (global)
%promptVoice input text
%http_data.replyAI reply text from n8n response
%http_data.actionHA service that fired
Action 1Get Voice → %prompt
Action 2HTTP Request → POST to n8n
Action 3Say → %http_data.reply

Tasker HTTP Request — JSON Payload

Method: POST URL: %N8N_URL Headers: Content-Type:application/json X-Webhook-Secret:%N8N_SECRET Body: { "device": "%DEVICEID", "text": "%prompt", "battery": %BATT } Timeout: 30 Continue After Error: ON ✓

n8n Workflow — Key Node Configs

// 1. Webhook node httpMethod: POST path: android-ai authentication: headerAuth responseMode: responseNode ← use Respond to Webhook node // 2. HTTP Request → Gemini Method: POST URL: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent Header: x-goog-api-key = {{ $env.GEMINI_KEY }} Body: { "contents": [{ "parts": [{ "text": "={{ 'Parse this smart home command. Return ONLY JSON: {\"service\":\"light.turn_on or light.turn_off\",\"entity_id\":\"light.kitchen or light.living_room\",\"reply\":\"friendly 1-sentence reply\"}. Command: ' + $json.body.text }}" }] }] } // 3. Home Assistant node — call the service Operation: Call Service Domain: {{ $json.service.split('.')[0] }} Service: {{ $json.service.split('.')[1] }} Data: { "entity_id": "{{ $json.entity_id }}" } // 4. Respond to Webhook node respondWith: json body: { "ok": true, "reply": "={{ $('Gemini').item.json.reply }}", "action": "={{ $('Gemini').item.json.service }}" }

Tasker — Read Reply & Speak

If %http_response_code = 200 Say: %http_data.reply Else Flash: "Error: %http_response_code" Set Global: %LAST_ERROR = "%http_response_code %http_data" End If

✅ 3-Step Verification

1 n8n test: send POST with {"text":"turn off kitchen lights"} → Gemini returns valid JSON with service and entity_id
2 Activate workflow → Tasker voice test → HA Developer Tools → States → target light changed
3 Phone speaks the AI-generated reply field (not a template string)
Lab 3 · Tier 5
🚨 Smart Alert Processor
HA sensor triggers → n8n → AI writes summary → HA broadcasts to phone → Tasker shows notification with Acknowledge / Dismiss buttons.

🎯 Objective

HA detects something (door left open, temp threshold, low battery sensor). n8n fetches context, AI writes a human-friendly summary. Phone gets notification with action buttons. Button tap fires follow-up webhook.

HA Sensor
→
n8n Webhook
→
Ollama / Gemini
→
HA Notify
→
📱 Tasker Intent

Triggers, Variables & Actions

ItemValue
HA TriggerState change on binary_sensor.front_door → on for 5 min
HA Actionrest_command.n8n_alert → POST to n8n
n8n vars{{$json.body.entity_id}}, {{$json.body.state}}, {{$json.body.duration}}
LLM promptSystem: "Write 1-sentence smart home alert." + entity context
%summaryAI text received via intent extra
Intent actioncom.example.HA_ALERT_ACK

HA configuration.yaml — rest_command

rest_command: n8n_alert: url: http://n8n.local:5678/webhook/ha-alert method: POST headers: X-Webhook-Secret: YOUR_SECRET Content-Type: application/json payload: '{"entity_id":"{{ entity_id }}","state":"{{ state }}","duration":"{{ duration }}"}'

HA automation.yaml — detect & call n8n

alias: Door Alert → n8n triggers: - trigger: state entity_id: binary_sensor.front_door to: "on" for: "00:05:00" actions: - action: rest_command.n8n_alert data: entity_id: binary_sensor.front_door state: open duration: 5

n8n — Ollama AI Summary + Push to Phone

// Ollama node (or HTTP Request to Gemini) POST http://host.docker.internal:11434/api/chat { "model": "llama3.1", "stream": false, "messages": [ { "role": "system", "content": "Write ONE friendly smart home alert. Max 15 words." }, { "role": "user", "content": "={{ $json.body.entity_id + ' has been ' + $json.body.state + ' for ' + $json.body.duration + ' min.' }}" } ] } // HA node: notify.mobile_app → broadcast intent to Tasker message: command_broadcast_intent data: intent_package_name: net.dinglisch.android.taskerm intent_action: com.example.HA_ALERT_ACK intent_extras: "summary:{{ $('Ollama').item.json.message.content | urlencode }}:String.urlencoded,entity:{{ $json.body.entity_id }}"

Tasker — Intent Received → AutoNotification Buttons

// Profile: Event → System → Intent Received Action Filter: com.example.HA_ALERT_ACK // Task: AutoNotification with action buttons Title: "🏠 Home Alert" Text: %summary Button 1 Label: "Acknowledge" → Task: POST_ACK_WEBHOOK Button 2 Label: "Dismiss" → Task: DISMISS_ALERT // POST_ACK_WEBHOOK task: HTTP Request POST %N8N_URL Body: { "action": "acknowledged", "entity": "%entity" }

✅ 3-Step Verification

1 Manually trigger HA automation via Developer Tools → check n8n log shows Ollama response
2 Phone notification appears within 15 sec with AI-written summary (not a template string)
3 Tap "Acknowledge" → n8n receives follow-up POST → log shows {"action":"acknowledged"}

Part 3

Visual Reference & YouTube Learning Index

📺Watch order: one video per lab session. Build after every watch. Don't binge.
FocusChannel / CreatorBest ForSearch Keywords
Tasker Core João Dias (joaomgcd)
youtube.com/user/joaomgcd
Tasker developer. HTTP Request, variables, plugins, AI Generator, Shizuku, release walkthroughs. Tasker HTTP Request event
Tasker 6.6 features
Tasker native JSON read
HA REST Everything Smart Home
(Lewis Barclay) · 247K subs
REST API, automations, DIY integrations. Local-first focus. Home Assistant REST API tutorial
HA webhook trigger 2025
HA Automations Home Automation Guy
(Alan Byrne) · 113K subs
Practical automations, notify patterns, scripting Home Assistant notify android 2025
HA command_broadcast_intent Tasker
HA Weekly Smart Home Junkie
(Ed de Tollenaer) · 88K subs
youtube.com/c/smarthomejunkie
Weekly HA tutorials. HA Creator Network member. Home Assistant webhook local_only
HA companion app notifications
HA Official Home Assistant (official channel) Release streams, Assist / LLM conversation agent Home Assistant Assist AI 2025
HA conversation process API
n8n Core n8n (official, @n8n-io) Webhook nodes, AI Agent, HA integration, quick-start n8n webhook header auth 2025
n8n AI agent Home Assistant
n8n Docker NetworkChuck "Run n8n for free" — Docker / VPS self-hosting NetworkChuck n8n self-hosted
n8n Deep Dive CodingEntrepreneurs "Getting Started with Self Hosting n8n" — 3.5 hr comprehensive CodingEntrepreneurs n8n 2025
AI / Ollama AI Foundations AI agents for beginners; Ollama + n8n integration patterns Ollama n8n self-hosted 2025
n8n local LLM stream false
HA Hardware The Hook Up · 585K subs
digiblurDIY · 74.8K subs
Deep HA + device automation; ESP devices Home Assistant AI agent 2025
HA OpenAI conversation

🔍 High-Signal YouTube Search Queries

Tasker HTTP Request event inbound server
Home Assistant command_broadcast_intent Tasker
n8n webhook header auth production URL
n8n Ollama Docker host.docker.internal Linux
Home Assistant REST API long lived token
Tasker native JSON read %http_data
n8n Home Assistant node service call
Gemini API x-goog-api-key header Tasker

Part 4

Google Tasks Micro-Plan

⏱️Each task = 15–20 min max. Mark done before moving on. Copy this list to Google Tasks.
📦 Phase 1 — Tasker Foundations (Tier 1)
Open Tasker → Vars tab → find %BATT and %DEVICEID in the built-in list
⏱ 15 min · Goal: know where built-in vars live
Create Task → HTTP Request → GET https://httpbin.org/get → run it → check log for %http_response_code = 200
⏱ 15 min · Goal: first HTTP call confirmed
Change to POST → add header Content-Type:application/json → body {"test":"%BATT"} → POST to https://httpbin.org/post
⏱ 15 min · Goal: see battery value in response
Add Flash action showing %http_data.json.test → confirm it shows the battery number
⏱ 15 min · Goal: native JSON read working
Add If block: if %http_response_code != 200 → Flash "Error: %http_response_code" → test with a bad URL
⏱ 15 min · Goal: error branch fires correctly
🏠 Phase 2 — Home Assistant REST (Tier 2)
HA: Profile → Security → Create Long-Lived Access Token → store in Tasker global %HA_TOKEN
⏱ 10 min · Goal: token created and stored
Tasker: GET http://[HA-IP]:8123/api/ with Authorization:Bearer %HA_TOKEN → confirm {"message":"API running."}
⏱ 15 min · Goal: HA REST connection live
Tasker: GET /api/states/light.YOUR_LIGHT → Flash %http_data.state → shows "on" or "off"
⏱ 15 min · Goal: reading entity state
Tasker: POST /api/services/light/turn_on body {"entity_id":"light.YOUR_LIGHT"} → light turns on
⏱ 15 min · Goal: first real device control from phone
HA: Create webhook automation (local_only: true, ID: tasker-test-001) → POST from Tasker → automation fires
⏱ 20 min · Goal: HA webhook trigger confirmed
HA automation: add notify.mobile_app → command_broadcast_intent → Tasker Intent Received catches it → Flash fires
⏱ 20 min · Goal: HA → phone return path working
⚙️ Phase 3 — n8n Hub Setup (Tier 3)
n8n UI → new workflow → add Webhook node → copy Test URL → click "Listen for test event"
⏱ 15 min · Goal: n8n webhook visible and listening
Tasker POST to Test URL → confirm JSON appears in n8n panel → then read why Production URL is different
⏱ 15 min · Goal: test vs production URL difference locked in
Add Header Auth to webhook → set secret → update Tasker to send X-Webhook-Secret header → still works
⏱ 15 min · Goal: secured webhook
Add "Respond to Webhook" node → body {"ok":true,"reply":"hello from n8n"} → Tasker reads %http_data.reply → Flash shows it
⏱ 20 min · Goal: full synchronous round-trip confirmed
Add built-in HA node → configure credentials (host + token) → call light.turn_on from n8n → light responds
⏱ 20 min · Goal: n8n controlling HA confirmed
Activate workflow → change Tasker URL to Production URL → full end-to-end test → not test mode anymore
⏱ 15 min · Goal: production path live
🤖 Phase 4 — AI Integration (Tier 4)
Store Gemini API key in %GEMINI_KEY → Tasker POST to Gemini generateContent with prompt "Say hello" → read %http_data.text
⏱ 20 min · Goal: direct Gemini call from phone
n8n: add HTTP Request node → POST to http://host.docker.internal:11434/api/chat → stream:false → confirm Ollama response
⏱ 20 min · Goal: Ollama reachable from n8n Docker container
Build Lab 2 step by step (AI Light Commander) — follow Lab 2 blueprint above
⏱ 45 min total, split 2–3 sessions · Goal: voice → light control via AI
🔄 Phase 5 — Return Paths + Capstone (Tier 5)
Enable Tasker HTTP Request event on port 1821 → test with curl from PC → Tasker responds with HTTP Response action
⏱ 20 min · Goal: phone acts as local HTTP server
n8n: after job completes, HTTP Request POST to http://[phone-IP]:1821/ai-result → Tasker receives and Flash result
⏱ 20 min · Goal: async push from n8n to phone over LAN
Build Lab 3 step by step (Smart Alert Processor) — follow Lab 3 blueprint above
⏱ 60 min total, split 3 sessions · Goal: HA → n8n → AI → button notification
🎓 CAPSTONE: single voice command → n8n agent → HA action → AI reply spoken aloud → confirm-or-cancel notification with buttons
⏱ 90 min total · This is the Tier 5 win condition. All 5 tiers complete.
🔑 All secrets live in Tasker globals — never hardcode them: %HA_TOKEN · %N8N_SECRET · %GEMINI_KEY · %HA_HOST · %N8N_URL