Hey, looking for a blueprint for vacation mode that will randomly turn on and off lights in the home. I have a script made for it now, but i have to turn it on every evening when i want it to start.
The idea would be that i can have a button for turning on vacation mode when going for vacation, then the lights will trigger on and off and random times so it looks like someone is home.
If you want, we can help you adapt your script to achieve your goal of having a ‘vacation mode’. If you’re interested, post your script and at what time you want it to run.
Basically, it’ll be a simple automation that activates your script every evening but only if an input_boolean it on (the ‘vacation mode’ indicator).
I can help you but without even supplying a script, I have no idea what lights you want to turn on randomly.
The basic idea here is that an input_boolean will serve as the vacation indicator. When you turn it on, it means ‘vacation mode’.
Every evening at a specific time, an automation triggers and checks if the input_boolean is on. If it is, it proceeds to turn on some lights randomly. I imagine you want the lights to be turned off at some time as well. If the input_boolean is off, no lights are turned on that evening
I have now used delay between different lights, thats why it wont be random lights at random times as my idea is. And also for time ut could run between sunset and sunrise.
OK, so what you posted turns on a set of lights in a non-changing sequence with a delay between the one light and the next.
A -> B -> C -> D
What you envision is making the delay (between turning on one light and the next) a random amount of time instead a fixed value. Is that correct?
In order words, you aren’t interested in changing the order of the lights every evening, just the amount of time between them. If you are interested in randomizing the order, that’s also possible but I don’t want to spend time showing how to do it if it’s not one of your requirements.
That is correct. But as u mention, the lights can also be random, doesnt be in that sequence. So basically random lights, at random times between sunset and sunrise. And this mode is activated by a button i push when i go away for a while.
What is the desired range, in minutes, for the random delay between lights? For example, 15 to 90 minutes?
Remember, you have 20 lights and the random delay can be above 60 minutes for all of them. In other words, the 20th light would be turned on many hours later than the first one. In fact, it may never be turned on at all because it can be sunrise before it gets its turn.
Those 20 lights does repeat several times in the script, i have 15 in total at home. Anyways do they all have to be the same? Maybe range from 15-40 minutes then
I tell you what, you can compose the script and set the lights in whatever sequence of turning on/off that you prefer with whatever delay ranges you would like between each light.
This is an example of the template for computing a random delay value:
- delay:
minutes: "{{ range(10, 40) | random }}"
It reports a value between 10 and 39 (always one less than the upper bound).
Once you are satisfied with the script’s operation, we can proceed to creating the input_boolean and automation.
what i dont understand are if im doing this right:
I have a random time for turn on, and a random time for turn off for each light.
If i push the “button” for example on a monday, i want it to run continuesly between sunset and sunrise everyday until im back home and push the “button” off again.