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

[FR] Remove useless get sentences #2602

Merged
merged 9 commits into from
Dec 4, 2024
Merged

Conversation

jlpouffier
Copy link
Contributor

@jlpouffier jlpouffier commented Nov 21, 2024

Complete Overall of the Get Sentences.

Generic sentences

The generic sentences to get anything are kept.
They are on homeassistant_HassGetState.yaml

Device Class x Sensor sentences

I completely removed all sentences targeting a specific device class on the sensor domain. Currently located on sensor_HassGetState.yaml.

Reasoning
Each sentence on this file expects the user to name their entity the same way as their device.
What's the battery of the tesla? is a perfectly valid sentence.
However, out of the box, the working sentence would be more What's the battery of the Tesla battery?
It's a lot of sentences, targeting lots of obscure device classes such as Moisture, Irradiation, Precipitation intensity, Volatile organic compounds ...
Most of these things will never be queried by voice.
However, being in the repo, it slows down a lot the intent matching and sometimes leads to incorrect matching If the sentences are not specific enough.

The generic sentences should be enough for now.
If a user wants to query their tesla battery by voice, they simply have to expose it, and say What's the tesla battery.
The generic sentence will match.

I think these sentences will have their place in the repo once we are able to target actual devices instead of entities.

Device Class X Binary Sensor sentences

I removed most of the device class and kept what makes sense to target by voice

  • Windows
  • Doors
  • Garage Doors
  • Presence

I extended the scope of these sentences to cover more use cases that are valid.
(Basically focusing on depth instead of breadth)

Here they are

  • Doors / Windows / Garage Doors
    • Ability to ask if a specific element is open or closed
      • By name (Is the garage door open?)
      • By name + Area (Is the living room window closed?)
      • By name + Floor (Is the first floor Velux closed?)
    • Ability to know if all elements are open or closed
      • By area (Are the living room windows closed?)
      • By floor (Ar the first-floor windows closed?)
      • For the whole house (are the windows closed?)
    • Ability to know if one or more elements are open or close
      • By area (Is there any window open in the living room?)
      • By floor (Is there any window open on the first floor?)
      • For the whole house (Is there any window open ?)
    • Ability to know which elements are open or closed
      • By area (Which windows are open in the living room?)
      • By floor (Which windows are open on the first floor?)
      • For the whole house (Which windows are open ?)
  • Occupancy
    • Ability to know if all occupancy sensors are OFF
      • By area (Is the living room empty?)
      • By floor (Is the first floor empty?)
      • For the whole house (Is the house empty?)
    • Ability to know if any occupancy sensor is ON
      • By area (Is there someone in the living room?)
      • By floor (Is there someone on the first floor?)

For the occupancy, we did not specify the following sentences

  • Any Yes/no on a specific element (Is the Aqara FP2 presence sensor detected.)
  • Any which question (Which presence sensor is detected)
  • All question targeting the ON state (are all the presence sensor in the house detected)
  • Any question targeting the OFF state (is there any presence sensor in the living room that is NOT detecting presence)
  • We also decided not to specify the any sentence for the whole house (Is there someone home) because we were afraid it would collide with the zone or person domain.

None of them are making a ton of sense compared to what is specified

@jlpouffier jlpouffier changed the title Remove most get sentences [FR] Remove useless get sentences Nov 22, 2024
Copy link

Counting previous sentences for language: fr: 1367291763
Counting NEW sentences for language: fr: 277659307

New count: -1089632456

@jlpouffier jlpouffier marked this pull request as ready for review November 26, 2024 08:44
@jlpouffier jlpouffier requested a review from piitaya as a code owner November 26, 2024 08:44
sentences/fr/_common.yaml Outdated Show resolved Hide resolved
area: "cuisine"
state: "off"
response: "Non, pas téléphone"
response: "Non, fermée"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
response: "Non, fermée"
response: "Non"

What about removing the state from the response?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@jlpouffier
Copy link
Contributor Author

@synesthesiam I'd like a small review on that one as it was a pain to do it.
The description says it all!

Thx a lot!

@jlpouffier jlpouffier merged commit cdba46c into main Dec 4, 2024
2 checks passed
@jlpouffier jlpouffier deleted the remove-most-get-sentences branch December 4, 2024 14:20
Rrp13 pushed a commit to Rrp13/intents that referenced this pull request Dec 11, 2024
* First removal of Sensor and Binary sensor useless fluff

* Doors, Windows

* Garage Door

* Occupancy

* Fix colission wiht locks

* Responses

* Update sentences/fr/_common.yaml

Co-authored-by: Paul Bottein <[email protected]>

* Simplify more the one_yesno response

---------

Co-authored-by: Paul Bottein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants