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

Matching device class #1244

Open
spuljko opened this issue Mar 16, 2023 · 3 comments
Open

Matching device class #1244

spuljko opened this issue Mar 16, 2023 · 3 comments

Comments

@spuljko
Copy link
Contributor

spuljko commented Mar 16, 2023

When there is device class in sentence intent slot results are not as expected. For example (I know there is already this sentence in code, but this is just for testing purposes)

      - sentences:
          - "how many {cover_classes:device_class} (is|are) {cover_states:state} [in <area>]"
        response: how_many
        slots:
          domain: cover
          device_class:
            - curtain
            - blind

Test sentence:

  - sentences:
      - "how many curtains are closed?"
    intent:
      name: HassGetState
      slots:
        domain: cover
        device_class: curtain
        state: "closed"
    response: "2"

Expected result is 2, but assert fails with '0' in {'2'}

Similar thing happens if I try to query temperature sensor:

      - sentences:
          - "what is [the] {sensor_classes:device_class} [in <area>]"
        response: one
        slots:
          domain: sensor
          device_class:
            - temperature
            - humidity

Test sentences:

  - sentences:
      - "what is the temperature in the living room?"
    intent:
      name: HassGetState
      slots:
        domain: sensor
        device_class: temperature
    response: "20 °C"

  - sentences:
      - "what is the humidity in the living room?"
    intent:
      name: HassGetState
      slots:
        domain: sensor
        device_class: humidity
    response: "60 %"

query.matched is 0, although there are sensors in fixtures.

@OzGav
Copy link
Contributor

OzGav commented May 13, 2023

In you first example are you using binary sensors to detect open and closed status?

In your second example this is also reported here: #1351

@spuljko
Copy link
Contributor Author

spuljko commented May 22, 2023

In you first example are you using binary sensors to detect open and closed status?
No, if you take a look domain is cover.

In your second example this is also reported here: #1351
It might look similar, but this one is about device class, not an area.

@tetele
Copy link
Contributor

tetele commented May 23, 2023

@spuljko could you please also share your lists: and test fixtures? Or point to a branch/commit where they are set?

The first test ("how many covers are closed" -> "2") actually works in the current version.

For your (second) example to work, you need to have a sensor_classes list defined, with proper in/out values.

Also, I don't know how you expect the second example to work for various device classes with a singular response like "60%". If you have multiple humidity sensors in an area, what would you expect the response to be?

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

No branches or pull requests

3 participants