language: en
intents:
GetLocked:
data:
- sentences:
- is the door <state>
requires_context:
domain: binary_sensor
expansion_rules:
state: "{binary_state}"
- sentences:
- is the door <state>
requires_context:
domain: lock
expansion_rules:
state: "{lock_state}"
lists:
binary_state:
values:
- in: "locked"
out: "off"
- in: "unlocked"
out: "on"
lock_state:
values:
- "locked"
- "unlocked"
You can see that both of them require a specific context. But I can’t understand what happens here. My understanding is that:
step 1. People say “is the door locked?”
step 2. Then what??? How can HA deduce the current context just from that sentence and match the correct sentence?
The question is I don’t know which one will be matched, if people say “is the door locked”?
# first
- sentences:
- is the door <state>
requires_context:
domain: binary_sensor
expansion_rules:
state: "{binary_state}"
#second
- sentences:
- is the door <state>
requires_context:
domain: lock
expansion_rules:
state: "{lock_state}"
Another problem is these sentences only match “state”, then how can HA know which entity it should control? Both {lock_state} and {binary_state} are custom lists, I don’t think they have special meaning to HA.