Step names and aliasses in trace view of automations and scripts

Conditions can become a complex set of and’s and or’s, see for example reply 3. Maybe it’s just me but it’s not always easy to find (for example) condition: conditions/3/conditions/3/conditions/6/entity_id/0.

So how about adding the alias or generated name to the output in the Step Details of an automation trace. For example:

Alias: Motion sensor xyz off for n seconds
Executed: August 19, 2024 at 11:20:26
Result:
result: false
state: 'on'
wanted_state: 'off'

It will make it a lot easier to find the specific condition in the Step config and in the automation editor. My suggestion would be to add the Alias or Step name (in case of a generated and not manually entered name) to all steps of the Step Details.

Vote if you’d like to see this feature added too.

Edit: Clarified the request by mentioning the parts of the trace screen and added the suggestion to add the generated step-names too.

Hi Recte,

I believe the step_config which is right there for each trace shows the code for that step, including the alias.

Hi SG,
In a small automation or script that will indeed do. It’s easy to relate the single ‘Step Detail’ to the ‘Step Config’. It becomes more challenging when your conditions grow. Take this (random) example from my environment:


The steps details only show step 6, the one before the choose.
It would be great if the alias for each condition was shown alongside the result so one can easily and reliable correlate. Of course, all the info is available:

  • conditions/1/ (in the gui condition 2)
    • /conditions/2/ (in the gui condition 3)
      • conditions/0/ (in the gui condition 1)
        • entity_id/0 (the first entity id)

If you’d ask me, it would however be of great value to have the alias shown in the ‘Step Details’ and even better if the ‘automatically generated’ step “names” would be included too. In the last condition, see the code below, you can see those generated names are not mentioned in the ‘Step config’ either.

      - alias: Door closed or open long open
        condition: or
        conditions:
          - condition: state
            entity_id: binary_sensor.openclose_20
            state: 'off'
            for:
              hours: 0
              minutes: 0
              seconds: 20
          - condition: state
            entity_id: binary_sensor.openclose_20
            state: 'on'
            for:
              hours: 0
              minutes: 1
              seconds: 30

Did you by the way noticed in the ‘Step Datails’ that it’s an OR condition?

Let me be clear, the introduction of the trace was a great improvement in tracking your automation. This request is just a small improvement with a big positive impact.

1 Like

Totally agree and still missing.

In the examples above, where the steps are outlined it’s even easier than in a nested precondition.

Yeah, debugging complex automations is a nightmare with current state of traces.
For example the condition is only included when it is evaluated as false, if it is evaluated as true, the condition is not even included, so you are totally clueless which of the dozens of conditions it might be.

Adding at least aliases or better all the names would be really a huge help.

1 Like