A custom Home Assistant integration that bridges WAHA (a self-hosted WhatsApp HTTP API) with Home Assistant.
- Outbound: send WhatsApp messages via the
waha.send_messageservice. - Inbound: every incoming WhatsApp message fires a
waha_message_receivedevent you can use as an automation trigger. Optionally, the message body can be forwarded to a Home Assistant conversation agent (Assist) so plain-language commands work without writing per-message automations.
Early/alpha. v0.1.0 — single integration entry, text messages only.
- Home Assistant 2024.12.0 or later.
- A reachable WAHA server (Docker is the typical deployment).
- A started WAHA session (e.g.,
default) authenticated with your WhatsApp account.
- HACS → 3-dot menu → Custom repositories → add this repo URL, type "Integration".
- Install "WAHA (WhatsApp HTTP API)".
- Restart Home Assistant.
Copy custom_components/waha/ into your Home Assistant config/custom_components/ directory and restart.
- Settings → Devices & Services → Add Integration → "WAHA (WhatsApp HTTP API)".
- Enter:
- WAHA base URL (e.g.,
http://localhost:3000) - API key (the value of
WHATSAPP_API_KEYon the WAHA server, if set) - Session name (must match a session you've started in WAHA, e.g.,
default)
- WAHA base URL (e.g.,
- After saving, the integration registers a webhook. Find the URL via:
Settings → Devices & Services → WAHA → entry overview (the webhook ID is stored in the entry).
The URL pattern is
https://<your-ha>/api/webhook/<webhook_id>. - In WAHA, configure the session's webhooks to POST
messageevents to that URL.
Every received message (excluding ones sent by your own account) fires:
event_type: waha_message_received
event_data:
session: default
from: "1234567890@c.us"
body: "Turn on the kitchen light"
raw: { ... full WAHA payload ... }
entry_id: <internal>Use it as an automation trigger:
trigger:
- platform: event
event_type: waha_message_received
event_data:
from: "1234567890@c.us"
condition:
- condition: template
value_template: "{{ trigger.event.data.body | lower == 'lights off' }}"
action:
- service: light.turn_off
target:
area_id: living_roomIn the integration's Configure (options) screen:
- Forward incoming messages to a conversation agent — when on, the message body is sent to a conversation agent.
- Conversation agent ID — leave blank to use HA's default Assist pipeline, or specify an explicit agent (e.g.,
conversation.openai). - Reply with agent's response — when on, the agent's spoken response is sent back to the original WhatsApp sender.
- Allowed senders — comma-separated list of chat IDs (e.g.,
1234567890@c.us). When blank, all senders are allowed. Recommended to set this so random WhatsApp messages can't drive your home.
service: waha.send_message
data:
chat_id: "1234567890@c.us"
text: "Front door opened"For groups, use the group chat ID (...@g.us).
- The webhook ID is the secret that gates inbound messages. Don't share it.
- Setting Allowed senders is strongly recommended if conversation forwarding is enabled — otherwise anyone who learns your WhatsApp number can potentially issue commands.
- Run HA over HTTPS so the webhook URL is not transmitted in clear text.
MIT