If you have a situation where one automation calls another, is there any mechanism for the last automation that is called to trace back the original trigger event that set the chain off?
For example, if I have one automation that detects when motion sensors are tripped, and this automation then triggers three separate automations depending certain conditions. One manage how the lights react, one to manage how the CCTV reacts, and one to send to notifications to key holders.
I have the three different automations to carry out the actions, lights, notifications and CCTV as separate automations, because I call them in multiple ways from multiple places, and I want a single place to store the actions so I only need to change or update them once.
I’m using automations rather than scripts because it’s going to be easier for someone to come along later on and see what’s happening or to make changes (It’s frankly easier to document using screen shots than code annotations).
At the moment I’m using storing data on what is triggered using helpers, which the automations read in and act on. Is there any way that they can pick up the original trigger action directly?
For example, if a motion sensors is triggered I store the name of the motion sensors in a helper, and then trigger the notification automation. The notification automation then reads the contents of the helper and adds it to the notification to tell the recipient which motion sensor has been triggered.
I’d like the notification automation to be able to pick up the trigger ID set in the original automation, or to check which sensor has been tripped directly, without having to use a helper (I simply have too many of these and it’s getting messy).
Ideally I’d like to do it without having to search the Last Triggered events in every sensors to see which one was triggered most recently, as I’d like the automations to be unaware of the sensors, as not all of my devices are visible in the same way which is why I have one automation that gets inputs and another than manages outputs (I only need to change or update the inputs on one place)
Is this possibly\practical?
EDIT: Please remove the “Solved” tag. This hasn’t been solved because it turns out that scripts can’t do this either.