It would be highly beneficial for Home Assistant automations to include a next_trigger attribute that displays the next scheduled trigger time. This feature would be especially useful for time-based automations like daily alarms or recurring events. By exposing this attribute, users could leverage it in other automations, enhancing coordination and automation logic. Additionally, it would improve the user experience by providing a clearer and more dynamic overview of upcoming triggers, either in custom dashboards or through external integrations.
Correction: It could only possibly be usable for certain time-based automations.
This has been discussed multiple times.
Can you provide specific use cases that you would use such a feature in?
Thank you for your response. I understand that this feature might not apply to all time-based automations, but in my specific case, it would be extremely useful.
I have an automation that acts as a daily alarm, which not only wakes me up but also opens all the blinds, provides me with the weather forecast, and plays the morning news. Every night, before going to bed, I manually update the trigger time based on when I plan to wake up the next morning.
The idea is that after setting this time and after editing and saving the automation, another automation could send me a Telegram message calculating the remaining time until the alarm goes off, helping me quickly assess how many hours of sleep I’ll get.
Without a next_trigger
attribute, it’s challenging to extract this information directly from the automation, as Home Assistant doesn’t natively expose the next scheduled trigger time. This example highlights how such an attribute could improve planning and coordination for automations with custom schedules, particularly when combining multiple smart home actions.
Store the time in an Input Datetime helper. Your first automation’s Time Trigger can use it for the actions you described and your second automation can also use it to compute the duration and notify you.
FWIW, it can all be done with a single automation but the key point is that the time should be in an Input Datetime helper.
Thank you for your suggestion. I understand that using an Input Datetime helper could simplify the process. However, my current workflow involves manually updating the trigger time directly in the alarm automation every night. This is because I find it more intuitive to adjust the alarm time within the automation itself, rather than using a separate helper entity.
The challenge is that I want to avoid managing the alarm time in two different places. If there were a next_trigger
attribute for automations, I could keep my workflow simple while allowing other automations to access the scheduled time without the need for additional helpers.
Don’t you think a next_trigger
attribute would provide more flexibility, especially for users who prefer to manage triggers directly within automations?
I understand there is another way to do this, and I also realize that if you don’t wish to implement the next_trigger
attribute, I will have to settle for the other possibility. Thank you again for your response.
Your application is trivial to implement when an Input Datetime is used. However, you have intentionally chosen to avoid using it.
I suggest you reconsider your decision because it’s highly unlikely the feature you requested will ever be implemented.