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

Triggers in automations are not implemented correctly in combination with conditions #135880

Open
sknob001 opened this issue Jan 17, 2025 · 0 comments

Comments

@sknob001
Copy link

The problem

Example:

  • A trigger should activate when "value 1" is below -600 (numeric_state) for 2 minutes.
  • A condition requires that "value 2" is below 26.5 (also numeric_state).
  • If both are met, an action should be triggered.

Original Automation:

id: '1736708531129'
alias: Automation 1
description: ''
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.scb_grid_power
    for:
      hours: 0
      minutes: 2
      seconds: 0
    below: -600
    enabled: true
conditions:
  - condition: numeric_state
    entity_id: sensor.temperatur_bad
    below: 26.5
    enabled: true
actions:
  - type: turn_on
    device_id: 6a308a24d0fe9e3a72d14556660937a9
    entity_id: f62c699fdff755616f1cc70e530ad9ec
    domain: switch
    enabled: true
mode: single

Attempted Solution:

id: '1736708531129'
alias: Automation 1
description: ''
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.scb_grid_power
    for:
      hours: 0
      minutes: 2
      seconds: 0
    below: -600
    enabled: true
  - trigger: numeric_state
    entity_id:
      - sensor.temperatur_bad
    below: 26.5
    for:
      hours: 0
      minutes: 2
      seconds: 0
conditions:
  - condition: numeric_state
    entity_id: sensor.scb_grid_power
    below: -600
  - condition: numeric_state
    entity_id: sensor.temperatur_bad
    below: 26.5
    enabled: true
actions:
  - type: turn_on
    device_id: 6a308a24d0fe9e3a72d14556660937a9
    entity_id: f62c699fdff755616f1cc70e530ad9ec
    domain: switch
    enabled: true
mode: single

However, this is not identical to the original intent because conditions do not allow a "for" duration.

Possible Solutions:

The only workaround I can imagine is using helpers (input_booleans or template sensors), but this is neither an elegant nor a desirable solution.

What version of Home Assistant Core has the issue?

2025.1.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

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

1 participant