I’m attempting to use Intents for the first time with the following goal:
If “Turn On Apple TV” is stated within a specific room through an ESP32 voice assistant – I would like Home Assistant to identify which zone the voice assistant is coming from and respectively power on the tv/projector/device + switch the receiver zone output for the respective device + turn on the Apple TV in the server rack.
I have the following under custom_sentences/en
→
language: "en"
intents:
AppleTVTurnOn:
data:
- sentences:
- "turn on [the] Apple TV"
slots:
name: "Apple TV"
lists:
tv_media_player:
values:
- in: "living room"
out: "media_player.living_room_tv"
- in: "master bedroom"
out: "media_player.master_bedroom_lg_tv"
media_player_zone:
values:
- in: "living room"
out: "media_player.marantz_sr6012_2"
- in: "master bedroom"
out: "media_player.marantz_sr6012_2"
And the intent script to handle the incoming data is within my configuration.yaml
:
intent_script:
AppleTVTurnOn:
action:
service: "script.turn_on_apple_tv"
data:
tv_media_player: "{{ tv_media_player }}"
media_player_zone: "{{ media_player_zone }}"
speech:
text: "Turned on the Apple TV, {{ tv_media_player }} and set to zone {{ media_player_zone }}"
The following script is contained within my Scripts:
alias: Turn On Apple TV
sequence:
- service: media_player.turn_on
target:
entity_id: "{{tv_media_player}}"
data: {}
- service: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: "{{media_player_zone}}"
mode: parallel
fields:
tv_media_player:
selector:
entity:
multiple: false
name: TV Media Player
required: true
media_player_zone:
selector:
entity: {}
name: Media Player Zone
required: true
max: 10
Atm, when stating the phrase “Hey Jarvis, … Turn on The Apple TV” with the ESP32 zoned for the Master Bedroom Area, the response is something along the lines of “I don’t know of any device…”.
Clearly I’m doing something wrong to register the Intent, and the documentation around this stuff is extraordinarily piece mailed and fragmented.
Would someone be able to help me get this going?