← Documentation: Menu Order Push Notifications + Home Assistant TTS + BAC
Home Assistant turns the workflow's message field into speech. First test the speaker and TTS engine in Home Assistant, then connect n8n.
Confirm Google Cast lists your speaker under Settings → Devices & Services. Find its media_player entity and an available tts entity in Developer Tools.
In Developer Tools → Actions, test tts.speak with the TTS entity, speaker and a short message. Resolve device reachability, volume or TTS integration issues here before testing n8n.
Create a script and edit its YAML. Replace both entity placeholders with your actual entities:
alias: announce_order
sequence:
- action: tts.speak
target:
entity_id: tts.YOUR_TTS_ENTITY
data:
media_player_entity_id: media_player.YOUR_SPEAKER
message: "{{ message }}"
language: en
mode: single
Confirm the saved entity is script.announce_order, or update the n8n service name to match. Test the script action directly with message in its data.
The script uses single mode; review that behavior if several orders can arrive together.
Create a Home Assistant long-lived token from your profile and save it in an n8n Home Assistant credential with a host reachable from n8n, such as http://homeassistant.local:8123.
In Announce Order with Home Assistant, select the credential, resource Service, operation Call, domain script and service announce_order.
The supplied message attribute announces the customer and first item. To announce all items, use:
={{
$('When Order Received').item.json.body.name +
' has ordered ' +
$('When Order Received').item.json.body.items
.map(i => i.quantity + ' ' + i.name)
.join(', ')
}}
Submit a test order from the menu and listen for the announcement. For 401, check the saved token. For 404, compare the script entity with the service name. If the script runs silently, inspect volume, speaker entity and the direct TTS test.
Adjust language or add a volume action in the script after the first test works. See Home Assistant TTS and script calls for supported action settings.
Continue with 03 - Setup the n8n Workflow.