home-assistant / intents

Intents to be used with Home Assistant
https://developers.home-assistant.io/docs/voice/overview/
Creative Commons Attribution 4.0 International
426 stars 487 forks source link

[de] HassLightSet with satellite area #2237

Open joie96 opened 3 weeks ago

joie96 commented 3 weeks ago

To set the brightness in the area of the activated satellite does not work.

I think it should be something like this:

language: de
intents:
  HassLightSet:
    data:
      # Change brightness of all lights in the same area as a satellite device
      - sentences:
          - "<setzen>[ <artikel>] Helligkeit[ auf] <brightness>"
          - "[<artikel> ]Helligkeit[ auf] <brightness>[ <setzen>]"
          - "dimme[ <artikel> Helligkeit][ (auf|zu)] <brightness>"
          - "[Helligkeit][ (auf|zu)] <brightness> dimmen"
        response: "brightness"
        requires_context:
          area:
            slot: true

But even when I'm using this in custom_sentences to extend the build in HassLightSet, this is conflicting with the current - "[<setzen> ]<artikel> Helligkeit[ (<lichter>|<alle_lichter>)][ <area>][ auf] <brightness>[ ein]" (https://github.com/home-assistant/intents/blob/main/sentences/de/light_HassLightSet.yaml#L15)

I think the above sentence needs to be changed, because without all optional parts it reduces to - "Helligkeit <brightness>" which I think does not make sense without

        requires_context:
          area:
            slot: true
mitrokun commented 2 weeks ago

for custom sentence, you need to create your own intent and script.

This example works:

language: de
intents:
  BrightnessSet:
    data:
      - sentences:
          - "Helligkeit <brightness>"
        requires_context:
          area:
            slot: true

BrightnessSet:
  action:
    service: light.turn_on
    data:
      brightness_pct: "{{brightness}}"
    target:
      area_id: "{{ area_id(area) }}"
  speech:
    text: "Ok"

It will most likely work with built-in intent, but someone needs to create a PR with new sentence The function is quite specific, it can literally blind you if the device misunderstands you. I would leave it to the end user to choose whether to add it to himself or not.