Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 108783

Create random time between 8AM and 5PM?

$
0
0

I want to create a random time between 8AM and 5PM (so, for example, 13:39), that triggers the start of an automation. I’ve seen solutions where the waiting time is randomised (triggered at 8AM with a random waiting time), but I wondered if there’s a more elegant solution so that a timer isn’t necessarily running the whole day.

So:

alias: Automation Lorum Ipsum
description: ""
trigger:
  - platform: time
    at: "13:39:00"

But then something like

alias: Automation Lorum Ipsum
description: ""
trigger:
  - platform: time
    at: "(random hour between 8-17):(random minute between 0-59):00"

I can imagine there needs to be some sort of other automation filling in the time variable, that does trigger at 8AM, so the time is set correctly each day.

For context: I want a sound to play on our speakers whenever it’s this random time, at a set (low) volume, so we can start with exposure training with our dog.

How can this be managed?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 108783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>