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.14k stars 31.12k forks source link

Sentence Trigger only works without automation conditions #132086

Open andreasbrett opened 2 hours ago

andreasbrett commented 2 hours ago

The problem

When a sentence triggered automation that has conditions is triggered but does not fire because of the conditions, there is neither LLM fallback (new 2024.12 feature) nor is the sentence processed by internal intents. Instead an empty Assist response is sent, which then results in it being overwritten with "Done" (see code).

What version of Home Assistant Core has the issue?

core-2024.12.0b2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

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

triggers:
  - trigger: conversation
    command:
      - "{sentence}"
conditions:
  - condition: and
    conditions:
      - condition: template
        value_template: "{{ floor_name(trigger.device_id) is not none }}"
      - condition: or
        conditions:
          - condition: state
            entity_id: input_boolean.guest_mode
            state: "on"
          - condition: state
            entity_id: alarm_control_panel.house
            state: armed_vacation
          - condition: state
            entity_id: alarm_control_panel.house
            state: armed_away
          - condition: state
            entity_id: alarm_control_panel.house
            state: triggered
    enabled: true
actions:
  - set_conversation_response: I'm not allowed to speak to you
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

Let me explain why I want to use a sentence trigger with conditions: I want to "disable" Assist for all inhouse satellites when we are away and the sitter is here. I still want to be able to use Assist on my mobile phone during these times though. Based on an approach by @jlpouffier I created a sentence trigger for "{sentence}" matching everything and respond with "I'm not allowed to speak to you". To only let this affect requests from the inhouse satellites, I added conditions regarding the triggering device's area and guest/alarm mode.

home-assistant[bot] commented 2 hours 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)