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

Traces window shows incorrect step details for wait_for_trigger when numeric_state trigger is used #23804

Open
4 tasks done
mekaneck opened this issue Jan 19, 2025 · 0 comments

Comments

@mekaneck
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

Ran into this issue helping a user on Discord. The traces window shows incorrect (or, perhaps more accurately, irrelevant) information in the "Step Details" tab when the wait_for_trigger step is selected.

Normally, for a wait_for_trigger step, the step details will show details about the wait:

wait:
  remaining: 6.2874247008003294
  completed: true
  trigger:
    id: '0'
<...truncated...>

However, if one or more of the triggers is a numeric_state trigger, the wait section in the text is not displayed, and instead the step details will show what the lastnumeric_state trigger evaluated at the start of the wait_for_trigger section.

For example, the following is the entirety of the step details for a script with 3 different triggers in the wait_for_trigger block, and the one that triggered was a state trigger:

result: false
state: 0
wanted_state_above: 2

When I take that exact automation, delete the numeric state trigger (which wasn't involved anyway) and then re-run the script and trigger it again by changing the the state trigger, I get the following correct detail:

wait:
  remaining: 6.982151980046183
  completed: true
  trigger:
    id: '0'
    idx: '0'
    alias: null
    platform: state
    entity_id: input_number.test
    from_state:
<...truncated...>

Describe the behavior you expected

The step details for the wait_for_trigger always displays the wait block.

The presence of an uninvolved numeric_state trigger should not impact what is shown in the step detail.

Steps to reproduce the issue

  1. Create an input number helper with an entity ID of input_number.test and a step size of 1. Once created, set its value to zero.
  2. Create the following script:
alias: Step Detail Issue with Numeric State
sequence:
  - wait_for_trigger:
      - trigger: state
        entity_id:
          - input_number.test
        to: "1.0"
      - trigger: numeric_state
        entity_id:
          - input_number.test
        above: 2
    timeout:
      hours: 0
      minutes: 0
      seconds: 30
    continue_on_timeout: true
mode: single
  1. Execute the script, and within the next 30 seconds, change the input number to 1.0. Then change it back to zero.
  2. Review the trace, and look at the step detail. If you are not sure what is normally expected in this window, perform the following additional steps to generate additional traces for comparison:
  3. Execute the script, and within the next 30 seconds, change the input number to 5.0. Then change it back to zero.
  4. Execute the script, and let it run for 30 seconds without doing anything.
  5. Edit the script, and delete the numeric_state trigger from within the wait_for_trigger section.
  6. Execute the script, and within the next 30 seconds, change the input number to 1.0. Then change it back to zero.
  7. Execute the script, and let it run for 30 seconds without doing anything.
  8. The first 3 traces will have incorrect/irrelevant detail in the step details since the automation contained a numeric_state trigger in the wait_for_trigger section. The next 2 traces will show the correct step details since the numeric_state trigger was deleted.

What version of Home Assistant Core has the issue?

2025.1.2

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Google Chrome Version 131.0.6778.265 (Official Build) (64-bit)

Which operating system are you using to run this browser?

Windows 10

State of relevant entities

Problem-relevant frontend configuration

Javascript errors shown in your browser console/inspector

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