home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.21k stars 31.16k forks source link

`HassVacuumStart` does not fail gracefully when no vacuum are present #131825

Open jlpouffier opened 6 days ago

jlpouffier commented 6 days ago

The problem

We recently released a new sentence to clean a floor. It basically starts all vacuums located in areas of said floor.

image

If you have no vacuum on a particular floor or in your home, the intent recognition fails image

Here are the logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1067, in recognize_intent
    conversation_result = await conversation.async_converse(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/conversation/agent_manager.py", line 110, in async_converse
    result = await method(conversation_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/conversation/entity.py", line 47, in internal_async_process
    return await self.async_process(user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 368, in async_process
    return await self._async_process_intent_result(intent_result, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 441, in _async_process_intent_result
    intent_response = await intent.async_handle(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<10 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 121, in async_handle
    raise UnknownIntent(f"Unknown intent {intent_type}")
homeassistant.helpers.intent.UnknownIntent: Unknown intent HassVacuumStart

I think in my home, since I have no vacuum, HassVacuumStart is not even loaded.

What version of Home Assistant Core has the issue?

2024.12.0b0

What was the last working version of Home Assistant Core?

Not applicable, new sentence

What type of installation are you running?

Home Assistant OS

Integration causing the issue

conversation

Link to integration documentation on our website

https://www.home-assistant.io/integrations/conversation/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 days ago

Hey there @home-assistant/core, @synesthesiam, mind taking a look at this issue as it has been labeled with an integration (conversation) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `conversation` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign conversation` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


conversation documentation conversation source (message by IssueLinks)

jlpouffier commented 6 days ago

OK. @synesthesiam I confirm my hint at the end of the description.

THe intent recognition fails at home because I have 0 vacuum.

Now... We have another issue.

This is @piitaya trying to clean a floor without vacuums on it: image

intent:
  name: HassVacuumStart
slots:
  floor: first floor
details:
  floor:
    name: floor
    value: Étage
    text: first floor
targets: {}
match: true
sentence_template: <clean> <floor>
unmatched_slots: {}
source: builtin

We are missing some error handling for that one.

joostlek commented 6 days ago

I think this might be because none of your integrations is setting up the vacuum platform. I have the same when I try to execute a service from the valve entity platform. None of my integrations has ever setup a valve, so it doesn't register its services.

image
jlpouffier commented 6 days ago

Yeah but what I "don't like" is that we have specific errors in the intent repo for that.

Such as "I am not aware of any domain in the area"

Or even a simple "sorry I did not understand that"

But that intent failure seems like a unhandled error.