Looking for Blueprint for vacation mode

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 just made a shitty script in panic. So i will scrap that when im back home again. Can u help me make a mode anyways?

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

Is that approximately what you had in mind?

Seems perfectly correct. I can send u my script tho, if u need it too see the lights.
Or can i send u a list off all the lights instead?

Please post the script.

alias: Ferie Modus
sequence:

  • condition: time
    after: ‘18:00:00’
    before: ‘08:00:00’
  • delay: ‘00:20:00’
  • type: turn_on
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
    brightness_pct: 100
  • delay: ‘01:20:00’
  • type: turn_on
    device_id: 953ec05c9dcfb028680417b11008ef98
    entity_id: light.stalampe_1
    domain: light
    brightness_pct: 100
  • delay: ‘00:20:00’
  • type: turn_off
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
  • delay: ‘00:45:00’
  • type: turn_on
    device_id: b65dee28df339596fbf699c6c9a6ed0a
    entity_id: light.stalampe_2
    domain: light
    brightness_pct: 100
  • delay: ‘00:30:00’
  • type: turn_off
    device_id: 953ec05c9dcfb028680417b11008ef98
    entity_id: light.stalampe_1
    domain: light
  • type: turn_off
    device_id: b65dee28df339596fbf699c6c9a6ed0a
    entity_id: light.stalampe_2
    domain: light
  • delay: ‘00:37:00’
  • type: turn_on
    device_id: 3e38a47305ac1a5c2d683986396dd5c9
    entity_id: light.taklampe_hoy
    domain: light
    brightness_pct: 100
  • delay: ‘01:30’
  • type: turn_on
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
    brightness_pct: 100
  • delay: ‘00:35:00’
  • type: turn_off
    device_id: 3e38a47305ac1a5c2d683986396dd5c9
    entity_id: light.taklampe_hoy
    domain: light
  • delay: ‘01:15:00’
  • type: turn_off
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
  • delay: ‘00:45:00’
  • type: turn_on
    device_id: 777f65080502963a3d698307758f6146
    entity_id: light.taklampe_lav
    domain: light
    brightness_pct: 100
  • delay: ‘01:00:00’
  • type: turn_on
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
    brightness_pct: 100
  • delay: ‘00:25:00’
  • type: turn_off
    device_id: 777f65080502963a3d698307758f6146
    entity_id: light.taklampe_lav
    domain: light
  • delay: ‘00:50:00’
  • type: turn_off
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
  • delay: ‘00:37:00’
  • type: turn_on
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
    brightness_pct: 100
  • delay: ‘00:45:00’
  • type: turn_on
    device_id: b65dee28df339596fbf699c6c9a6ed0a
    entity_id: light.stalampe_2
    domain: light
    brightness_pct: 100
  • delay: ‘00:28:00’
  • type: turn_off
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
  • delay: ‘00:15:00’
  • type: turn_on
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
    brightness_pct: 100
  • delay: ‘01:00:00’
  • type: turn_off
    device_id: b65dee28df339596fbf699c6c9a6ed0a
    entity_id: light.stalampe_2
    domain: light
  • delay: ‘00:23:00’
  • type: turn_off
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
    mode: single
    icon: ‘mdi:beach’

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.

Thanks, will do! So i will have to change all the delay times i have with the template u used then? ofc set in preferred range…

Change whichever ones you want to have random values.

alias: Vacation Mode
sequence:

  • type: turn_on
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
    brightness_pct: 100
  • delay: ‘00:{{ range(20,70) | random | int }}:00’
  • type: turn_off
    device_id: f5c6ca24752379a054a054dd274fa1b2
    entity_id: light.lampe_tv
    domain: light
  • delay: ‘00:{{ range(10,40) | random | int }}:00’
  • type: turn_on
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
    brightness_pct: 100
  • delay: ‘00:{{ range(15,38) | random | int }}:00’
  • type: turn_off
    device_id: 6d434b99a58d3b1571646b427b4d3252
    entity_id: light.kjellerstue_tak
    domain: light
  • delay: ‘00:{{ range(18,42) | random | int }}:00’
  • type: turn_on
    device_id: 7efea32bc25b45e3ad64eebf15b5070d
    entity_id: light.soverom_tak
    domain: light
    brightness_pct: 100
  • delay: ‘00:{{ range(12,64) | random | int }}:00’
  • type: turn_off
    device_id: 7efea32bc25b45e3ad64eebf15b5070d
    entity_id: light.soverom_tak
    domain: light
  • delay: ‘00:{{ range(30,80) | random | int }}:00’
  • type: turn_on
    device_id: 3e38a47305ac1a5c2d683986396dd5c9
    entity_id: light.taklampe_hoy
    domain: light
    brightness_pct: 100
  • delay: ‘00:{{ range(25,45) | random | int }}:00’
  • type: turn_off
    device_id: 3e38a47305ac1a5c2d683986396dd5c9
    entity_id: light.taklampe_hoy
    domain: light
  • repeat:
    until:
    - condition: sun
    before: sunrise
    after: sunset
    sequence: []
    mode: single
    icon: ‘mdi:beach’

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.

I know it’s an old thread, but why don’t you trigger your button by you / your phone being not_home?