WTH isn't there an easier way to add randomized delays in actions

At the moment if I want to have an automation that happens at sunrise for example, but I also want to add some more variance in the form of a variable offset for the trigger, Iā€™m currently using a sensor template that updates daily that I then use in a delay statement in the action.

It would be really good if there could be a setting for delays in actions to be randomized within a range of durations rather than having to go through the whole templating process.

Not that it really matters but the sensor code you have can be placed directly in the automation too.

1 Like

not sure if this helps but have a set of random light and media player actions for if no one is at home for an extended period. They were set up using the UI then the delay edited in YAML:

minutes: ā€œ{{ range(1, 2) | random }}ā€
seconds: ā€œ{{ range(1, 59) | random }}ā€

2 Likes