Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When an intent requires a name and an area, we do not search for the name in the area, we search the name globally. #109868

Closed
jlpouffier opened this issue Feb 7, 2024 · 5 comments

Comments

@jlpouffier
Copy link

The problem

Context

Some users have different devices with the same name, or same aliases in different areas.
A very common example would be an "Overhead light".
Because they are in different areas, we can target them by voice by specifying the area, if the intent supports it, and if the sentence exists.

A few translations to understand the examples below for non-french speakers.

"Overhead light" is called "Suspension" in French.

All my examples will be related to turning on overhead lights in different areas

  • The office, called "Bureau"
  • The bedroom, called "Chambre"
  • The entryway called "Entrée"

Previous behavior

Note: I just restored core-2024.1.6 to validate it was working before.
Before this beta, if a user had multiple entities sharing the same alias (or name) located in different areas, it was possible to target the correct one by voice by specifying the area (if the intent supports it, and if the sentence exists)

As shown here:
CleanShot 2024-02-07 at 11 44 00

Here is what the assist dev tool shows when targeting different overhead lights in different rooms, the target is correct, it's the correct light in the correct area.

turn on the overhead light in the office

intent:
  name: HassTurnOn
slots:
  name: Suspension
  area: bureau
details:
  name:
    name: name
    value: Suspension
    text: suspension
  area:
    name: area
    value: bureau
    text: bureau
targets:
  light.bureau_suspension:
    matched: true

turn on the overhead light in the entryway

intent:
  name: HassTurnOn
slots:
  name: Suspension
  area: 36be0a2612474c6c8baa7cbd0a2d91d7
details:
  name:
    name: name
    value: Suspension
    text: suspension
  area:
    name: area
    value: 36be0a2612474c6c8baa7cbd0a2d91d7
    text: entrée
targets:
  light.entree_suspension:
    matched: true

turn on the overhead light in the bedroom

intent:
  name: HassTurnOn
slots:
  name: Suspension
  area: chambre
details:
  name:
    name: name
    value: Suspension
    text: suspension
  area:
    name: area
    value: chambre
    text: chambre
targets:
  light.chambre_suspension:
    matched: true

Current behavior.

It looks like the name matching is now done before the area filtering.

This leads to an unwanted behavior:
If a user had multiple entities sharing the same alias (or name) located in different areas, then regardless of the area in the input of the sentence, the same entity will be targeted.

  • If the entity happens to be in the correct area, the intent will work (One case out of N)
  • if the entity is not in the correct area (N-1 case out of N) it will not.

For example, the "first" overhead light in my system found is in the entryway - So only the sentence targeting the entryway works, as shown here:

CleanShot 2024-02-07 at 11 55 25
(Note: The first response is Sorry, I did not understand that)

Here is what the assist dev tool shows when targeting different overhead lights in different rooms.

  • Notice how the input data is now the same overhead light on all sentences, the entryway one.
  • Notice how the only sentence with an actual target is the one on the entryway. This is because (By chance) the light is on the correct area.

turn on the overhead light in the office

intent:
  name: HassTurnOn
slots:
  name: suspension
  area: bureau
details:
  name:
    name: name
    value: light.entree_suspension
    text: suspension
  area:
    name: area
    value: bureau
    text: bureau
targets: {}
match: true
sentence_template: <allume> [<le>]{name} <dans> [<le>]{area}
unmatched_slots: {}
source: builtin

turn on the overhead light in the entryway

intent:
  name: HassTurnOn
slots:
  name: suspension
  area: entrée
details:
  name:
    name: name
    value: light.entree_suspension
    text: suspension
  area:
    name: area
    value: entree
    text: entrée
targets:
  light.entree_suspension:
    matched: true
match: true
sentence_template: <allume> [<le>]{name} <dans> [<le>]{area}
unmatched_slots: {}
source: builtin

turn on the overhead light in the bedroom

intent:
  name: HassTurnOn
slots:
  name: suspension
  area: chambre
details:
  name:
    name: name
    value: light.entree_suspension
    text: suspension
  area:
    name: area
    value: chambre
    text: chambre
targets: {}
match: true
sentence_template: <allume> [<le>]{name} <dans> [<le>]{area}
unmatched_slots: {}
source: builtin

What version of Home Assistant Core has the issue?

core-2024.2.0b9

What was the last working version of Home Assistant Core?

core-2024.1.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

assist_pipeline

Link to integration documentation on our website

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

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
Copy link

home-assistant bot commented Feb 7, 2024

Hey there @balloob, @synesthesiam, mind taking a look at this issue as it has been labeled with an integration (assist_pipeline) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of assist_pipeline 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 assist_pipeline 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)


assist_pipeline documentation
assist_pipeline source
(message by IssueLinks)

@home-assistant
Copy link

home-assistant bot commented Feb 7, 2024

Hey there @home-assistant/core, 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)

@tetele
Copy link
Contributor

tetele commented Feb 7, 2024

Possibly related to #109792

@tetele
Copy link
Contributor

tetele commented Feb 7, 2024

Possibly related to #109808 too

@synesthesiam
Copy link
Contributor

I've figured out what's happening: I changed the building of slot lists for hassil to pass in entity id as well as entity name. This had an unfortunate consequence of possibly picking the wrong entity when they were named the same because hassil only gets the first matching candidate from a list.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants