Lights on/off randomly in different zones

Hi. I know there are many topics on lights on/off randomly, but I haven’t come across any that I can build off of to achieve what I would like and I would like your take on the task. Here’s what I want:

I want all lights in a zone to turn on within 45 min after sunset (a). One light should turn on within 5 min of the sunset (b), the rest may or may not turn on at the latest 45 min later (c). This means that different lights tun on at different times within 45 min after sunset. Some might not turn on. At least 1 should turn on (d). The number of lights may warry, so the programming should be dynamic (adress all available lights in the zone at any time).


(This is sadly not my house, but it has got some light automation…)

It should be possible to turn this automation on and off for zones and each zone could have configurable values for a, b, c and d.

Anyone got anything similar or have an idea of how to achieve this?

Maybe u could use the logic function “chance”. You can find/search things about this at the forum.

Be glad, it’ll get burgled (or at least attempts will be made).

4 Likes

Yes, that could be part of it, but how to per zone to address all lights, at least one on and so on?

My first attempt on pseudo code would be something like this:

a) for each zone to automate
  b) Put all available lights in an array/collection
     Randomize if each light should turn on
     Randomize individual delays between 5 - 45 min
     Loop over and identify
     c) The one which turns on first, randomize a new "on" time between 0 - 5min
        If none is randomized to turn on, randomize one to turn on, randomize when between 0 - 5min
        Schedule to turn on the lights according to delays

Is anyone capable to writing such a script?

Maybe an app like this can help you out?

Or maybe the developer (@LRvdLinden who is very productive with new apps) is willing to help you with specific needs in this app, or a spin-off from this app in a new app (Security lights app…??).

2 Likes

@mrPilloft As @Torch1969 mentioned, you can try Party Lights. If this is not close to your needs, let me know. Maybe I’ll build it in or in a separate app.

3 Likes