I try to understand automation a little bit more. Currently i setup a automation, which should me notify, when a device battery level go a below level. My previous implementation didn’t work that good. In this first attempt i use the battery level as a trigger. In that case, i can send a notification and use {{ trigger.to_state.name }} to send the device name in the notification, which triggered the warning.
But now i use a time trigger. This runs every 6h. Additionally i check with conditions, if the battery level is below a certain level. In this case {{ trigger.to_state.name }} doesn’t work.
Is there something like {{ condition.to_state.name }}?
All conditions always have to pass for it to trigger, so that doesn’t really make any sense.
The trigger variable can only collect data from a trigger. So if you are using a time trigger only the trigger.now is available. You can see what information is available for each trigger type in the Automation Templating docs.
@brooksben11 I’m pretty sure that triggers always happen and then it’s the conditions afterwards that either allow or disallow the remaining script to execute.
To add to what Ben said, the idea is use a choose statement on the timed check.
Check for your condition and if it passes that, you know your name and whatever else to pass to the next step because a certain condition has passed…