intents icon indicating copy to clipboard operation
intents copied to clipboard

Person location response is missing state

Open danielholm opened this issue 1 year ago • 8 comments

When asked the question where a person is, the response is missing the state of the person.

Since I added support for persons in Swedish I thought it was a mistake at my end, but after setting up an English voice assistant, because I based the Swedish response on the English one, the same error occurs in English as well. Se attached pictures for both languages.

The response is state.state. this outh to be correct, and hence the issue my origin else, correct?

Using the Dev tools in HA and try the sentence, the correct person is found. Though no state.

intent:
  name: HassGetState
slots:
  name: Daniel
  domain: person
details:
  name:
    name: name
    value: Daniel
    text: Daniel
  domain:
    name: domain
    value: person
    text: ''
targets:
  person.daniel:
    matched: true
match: true
sentence_template: <var> <name>
unmatched_slots: {}
source: builtin

Screenshot_20250111_203312_Home Assistant Screenshot_20250111_203334_Home Assistant

danielholm avatar Jan 11 '25 19:01 danielholm

Same here. I just asked "Where is Elizabeth?" and it says "Elizabeth is at". She is at a known named zone so it should have said the zone at the end of the sentence, I would have thought.

stage: done
run:
  pipeline: 01jfsdd05p445yq93y95ws56sa
  language: en
  runner_data:
    stt_binary_handler_id: null
    timeout: 300
events:
  - type: run-start
    data:
      pipeline: 01jfsdd05p445yq93y95ws56sa
      language: en
      runner_data:
        stt_binary_handler_id: null
        timeout: 300
    timestamp: "2025-01-31T22:33:43.122698+00:00"
  - type: intent-start
    data:
      engine: conversation.home_assistant
      language: en
      intent_input: where is Elizabeth?
      conversation_id: null
      device_id: null
      prefer_local_intents: false
    timestamp: "2025-01-31T22:33:43.122721+00:00"
  - type: intent-end
    data:
      processed_locally: true
      intent_output:
        response:
          speech:
            plain:
              speech: Elizabeth is at
              extra_data: null
          card: {}
          language: en
          response_type: query_answer
          data:
            targets: []
            success: []
            failed: []
        conversation_id: null
    timestamp: "2025-01-31T22:33:43.131332+00:00"
  - type: run-end
    data: null
    timestamp: "2025-01-31T22:33:43.131358+00:00"
intent:
  engine: conversation.home_assistant
  language: en
  intent_input: where is Elizabeth?
  conversation_id: null
  device_id: null
  prefer_local_intents: false
  done: true
  processed_locally: true
  intent_output:
    response:
      speech:
        plain:
          speech: Elizabeth is at
          extra_data: null
      card: {}
      language: en
      response_type: query_answer
      data:
        targets: []
        success: []
        failed: []
    conversation_id: null

Ricket avatar Jan 31 '25 22:01 Ricket

Could it be an issue with LLM agent? What happens if you try to process the sentences locally?

jose1711 avatar Mar 21 '25 11:03 jose1711

It's not an LLM issue, I'm seeing the same issue with no LLM added using the Home Assistant conversation agent only. Running Home Assistant Core 2025.3.4 here.

kg333 avatar Apr 06 '25 04:04 kg333

Yep it still happened, ironically it happened earlier today. I totally forgot about this issue and the fact I posted to it, I was just saying a couple random things to my HA Voice device because I haven't used it in a while. And it did the " is at" thing again.

Any tips on debugging this, is there any more logs / info we can provide?

Ricket avatar Apr 06 '25 05:04 Ricket

Hi, adding my contribution to this topic. In my case I receive the answer but if the location is "home" or "not_home" ironically it is not translated.

If is another zone I receive the zone name in the response.

Image

jokerigno avatar Apr 11 '25 13:04 jokerigno

Still happening in 2025.7.1.

This log shows up:

homeassistant  | 2025-07-04 20:28:43.345 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'state' when rendering '{% if state == "not_home" %}
homeassistant  |   {{ slots.name | capitalize }} is away
homeassistant  | {% else %}
homeassistant  |   {{ slots.name | capitalize }} is at {{ state.state }}
homeassistant  | {% endif %}'

I'm doing a little debugging; I found that success_results list is empty here: https://github.com/home-assistant/core/blob/12b90f3c8ecbe6d2129fe495ac1543cf93f48cc1/homeassistant/components/intent/init.py#L391

Ricket avatar Jul 05 '25 01:07 Ricket

Logging the constraints, preferences, and then the result:

homeassistant  | 2025-07-04 20:53:06.594 WARNING (MainThread) [homeassistant.components.intent] Match constraints: {'name': 'Richard', 'area_name': None, 'floor_name': None, 'domains': {'person'}, 'device_classes': None, 'features': None, 'states': None, 'assistant': 'conversation', 'allow_duplicate_names': False, 'single_target': False}
homeassistant  | 2025-07-04 20:53:06.594 WARNING (MainThread) [homeassistant.components.intent] Match preferences: {'area_id': 'office', 'floor_id': None}
homeassistant  | 2025-07-04 20:53:06.594 WARNING (MainThread) [homeassistant.components.intent] Match result: {'is_match': False, 'no_match_reason': <MatchFailedReason.ASSISTANT: 8>, 'states': [], 'no_match_name': None, 'areas': [], 'floors': []}

There is a no match reason of MatchFailedReason.ASSISTANT which has the comment: "No entities matched exposed to assistant constraint."

Sure enough, the Person entity was not exposed to voice assistants.

Image

And when I enabled it, then I correctly got the response "Richard is at home."

So there's the fix for this issue, but IMO it still should be fixed to say an error in response, instead of giving that truncated " is at" response...

Ricket avatar Jul 05 '25 02:07 Ricket

This is a bug in the intent response, not in core. Fix here: https://github.com/OHF-Voice/intents/pull/3325

synesthesiam avatar Aug 11 '25 21:08 synesthesiam