Did a quick test by just dropping the trigger.offset to a persistent message and and it returns the offset exactly as set. In my case a positive offset. I don’t have time to check if it’s a time value or a string, but that’s a matter of trial and error. Just make multiple choose steps in your automation and see which catches
Sorry, I should have clarified. I need a trigger’s offset by its ID, it’s not necessarily the trigger that triggered the automation (which has several). Thanks very much for your help!
You can’t do that. The trigger variable only contains information for the trigger that triggered the automation. If it was triggered by the first trigger (platform: homeassistant) then it doesn’t contain information for the other two triggers.
I see. Well my goal with automation was sunrise-sunset based automation with state-persistence, kind of like Awesome HA Blueprint’s on-off one. But, with offset support.
So, “twenty minutes before sunrise” turn off the light, “1 hour before sunset turn on the lights”, and when HA restarts, check if you should turn on or turn off the lights, taking the offsets in consideration.
I realized quickly I couldn’t make a nice blueprint out of it, because I can’t use variables in sun.triggeroffset, but now I guess even an automation will have to be written very inelegantly. I hope I’m missing something and will keep exploring…