Open JokeRsevilla opened 1 month ago
Can confirm that behavior. For if-then or choose, options with an ID as condition are also fired by a trigger without defined ID.
Update: Only happening, if the first trigger gets the ID "1" and the second ID is not defined.
A trigger without a user defined id gets the index number as id (trigger.idx) which is 1 for the second trigger
No, I discovered it in a complex automation, something like this (trigger 2 was executed):
trigger 1 (without ID) trigger 2 (without ID) trigger 3 (without ID) trigger 4 (without ID) trigger 5 (without ID) trigger 6 (without ID) trigger 7 (without ID) trigger 8 (ID 1) trigger 9 (ID 1) trigger 10 (ID 1) trigger 11 (ID 2)
The condition: if trigger ID 1 = true
I investigated the traces and tried to reproduce it with a simple, invented automation and had the same error.
When I changed the order of the triggers in the invented automation, the error no longer occurred. I don't know why...
Try it with non-numerical IDs. That should work.
Yes! If the trigger doesn't have a numeric ID, there's no error. But I still think it's a bug, why not use a numeric ID?
Because if you don't give an id to a trigger, it will get the index (as string) of the trigger assigned as id. Which is already a number. But counting starts at 0.
So if you give the first trigger the id "1"
and you give no id to the second trigger, they will both have "1"
as id.
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (automation
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
automation documentation automation source (message by IssueLinks)
The problem
sorry for my english, example error in this automation, the trigger is input_button.pulsador_lavadero no id trigger, but result condition is 'true'. If change order of triggers It works well. Solution id: "0" for rest of triggers.
alias: new automation description: "" trigger:
I think it's a bug
What version of Home Assistant Core has the issue?
core-2024.7.3
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
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response