Getting Assist to answer "Which doors are open?"

I have several Aqara door/window sensors that report if doors are open or closed. I have set their binary sensors to the Door type, they are exposed to Assist, and they update appropriately (when I open the door, the sensor displays the Open state in HA).

If I ask Assist “Is the bedroom door open?”, it will respond “Yes.” However, when I then ask “Which doors are open?”, it reports “Not any.” I would expect it to respond with something like “The bedroom door is open.”

Does this intent exist in default Home Assistant, or am I misunderstanding the default intents? If it does not exist, does anyone have examples of configuration for such an intent?

Hi there, I have exactly the same sensors / setup. I also wanted to query which doors / windows were open, but found that it’s not a standard intent, so I created my own with help from @tetele on discord. I’ll send over what I have when I get on my laptop again, but it works great, as I can get assist to list the doors or windows that are open, if any are :slight_smile:

1 Like

Here are the custom intents I use for this use case. Creating groups/binary sensors that collect all of the sensors (e.g. exterior_doors or exterior_windows) makes the check a bit easier.

getWindowState:
speech:
text: >
{% if is_state(“binary_sensor.exterior_windows”, “off”) %}
{{ [
“All windows known to me appear to be closed”,
“All windows reporting closed”,
“Sensors report no open windows”
] | random }}
{% else %}
"the following windows are open . . "
{% for entity_id in states.binary_sensor.exterior_windows.attributes.entity_id %}
{% if is_state(entity_id, “on”) %} {{ state_attr(entity_id, “friendly_name”) }} " . . " {% endif %}
{% endfor %}
{% endif %}

getInteriorTemperature:
speech:
text: >
“Temperature reported as {{ states(tempareas, ‘state’) }} degrees”

getGarageDoorState:
speech:
text: >
{% if is_state(“binary_sensor.garage_doors”, “off”) %}
{{ [
“Garage doors confirmed closed”,
“All garage doors are closed”
] | random }}
{% else %}
"the . "
{% for entity_id in states.binary_sensor.garage_doors.attributes.entity_id %}
{% if is_state(entity_id, “on”) %} {{ state_attr(entity_id, “friendly_name”) }} " . . " {% endif %}
{% endfor %}
“is currently open”
{% endif %}