There should be easier way to random or at least documentation

How does one put a random minutes delay in yaml?

There’s 100x posts saying to do it all sorts of different ways but I can’t frt any of them to work.

I propose it should be easier for newbies to understand rather than trawling throwmugh forum posts for 5 years ago.


  action:
    - delay:
        minutes: "{{ range(0, 60)|random|int }}"

2 Likes

So what’s your proposal to make it easier?

Using the forum’s search function seems easy enough.
https://community.home-assistant.io/search?q=Random%20delay%20

Here’s one that was marked with the Solution tag.

The principle is largely the same for most examples: specify a range of acceptable values and then choose one value at random.

Post what you tried but failed to work.

1 Like