I have an automation that should be triggered whenever either one of two entities changes value. By default the state change will fire whenever any attribute changes. My usual work around is to create a condfition:
There is only onetrigger variable and it contains information about whichever one of the two triggers have triggered the automation.
When you do this:
id: trigger1
you aren’t defining a new trigger variable (or any kind of variable); you are simply assigning a value to one of the trigger variable’s properties (id). That’s why this error message was generated:
Error: In ‘template’ condition: UndefinedError: ‘trigger1’ is undefined
If you want to reject triggers where the entity’s state value remains unchanged (meaning it was triggered by an attribute changing value), then simply do this:
The trigger variable is created when the automation is triggered. It’s an object with several properties, including an optional one called id. For more information, refer to Trigger ID.