How do you create random events?

How do you turn devices on OR off during a selected time frame?

I do NOT mean using the Presence Simulation which turns devices on/off during a selected time frame.

For example I wish to turn off my garden lights at a random time between 23:00 and 23:45.

If someone is watching the property and the lights always go off at the same time it’s obvious that they are automated. A bit of randomness implies that someone is in residence.

In the ewelink app, go to the scene and create a new one. Cover the scene per day of the week/time of action.
In “If” use “Time of Day” and select the parameters… repeat, time, day.
In “Then” select your device to turn OFF.

Repeat in a similar way to create the next six scenes. If you also want it to be similar for ON, create more scenes, but this time specify the ON parameter for the device.

Unfortunately, it won’t be random…

If different times for each day are not enough, try experimenting with “Delay”.
Another option is to set a schedule for each day per month, then you can define, for example, a different time for different Mondays, etc.

The “Time of Day” function allows you to select the day, month, year and time. It’s a bit annoying to set up 365 scenes, but this way you theoretically have a different time for the action every day of the year.

1 Like

This is not an option, because for the moment, an automatic scene can be made no more than 3 months!

I can offer you something, but it’s a bit more complicated. You turn on another device with which you set at the time of 23:00-23:45 to turn on and off a second device and accordingly the second device is set with presence simulation and is physically connected to the lighting!

Nice idea. This solves the issue with presensce simulation not being able to control the individual channels of a 4 channel Pro. Thanks.

Are you using a device that has Node Red ability? Pretty sure there are nodes capable of pseudorandom activity available.

But the device with the presence set will always work regardless of the first one and will always turn on/off itself…
What’s more, he wants to turn it off once and for all, but your “presence” will turn the lights into a disco that will turn the lights on and off randomly within a certain period of time. With “presence” you cannot control whether the state. If it is on, it will turn off and vice versa, the only question is how many on/off sequences it will be able to complete within 45 minutes. And he probably doesn’t want his garden lights to blink.
He just wants to turn off the lights randomly in a 45 minute interval. One day at 23:01 and another at 23:24 etc. However, “presence” will make it turn on unnecessarily and this can be called slow blinking.

You’re right, there is a three-month limit that I forgot about.

If he limits himself to different hours per day he can still use it. Or create scenes every three months. He doesn’t have to create actions for the whole year at once!

Another option is to limit yourself to days of the week, time period, and random times.
We can fully achieve this using, it is free and works with ewelink. We create an account and create a Sequence, then select Time related steps (clock icon) and “At a random time” and create a trigger according to time needs, we can set the time interval and days of the week.
Then we create an action, select the webhook and provide the url to our webhook from ewelink web for the scene that will turn off our lights.
This way we can set which days of the week, in the time range 23:00-23:45, to execute the webhook at a random moment.

The difference between what ewelink offers in terms of time trigger is that “sequematic” also has a random execution function.

This time 23:00-23:45 I thought it was just for example. In principle, in order to simulate presence, time must be in a larger period. Otherwise, in this period it will still look like it was programmed, because in those 45 minutes it turns on and off, it doesn’t matter the days! It is more important that they turn on and off more than once. So I don’t know what is the idea of the person asking! We can only guess!
As for working from the first device and the second, you clearly missed the point! The first will turn off completely the second which is set for presence! Simply put, with the first one it controls the time every day and with the second one it only simulates presence when it is online. Let’s let the person join the thread.

You don’t read carefully what I wrote!

OP doesn’t want to turn on/off, off/on these lights.
From what I understand, he just wants to turn them off at a random minute between 23:00-23:45 and he doesn’t want them to turn on again. Therefore, the “Presence Simulation” function here is not useful because it will turn the lights on again.

What the OP wants to achieve will be done exactly by “”, control of turning off the light at a random time using the time interval 23:00 - 23:45. Optionally, it is possible to define the day of the week. Exactly what OP wants!
You can create a separate scene to turn them on again.

The sequence itself on the “” website can be done in two ways. By using a webhook for an ewelink scene that turns off the lights or by pairing an ewelink account and directly selecting the device.

And whether such a small period of time is ok or not is a decision for the OP and his needs. If he needs such a period of time, he clearly has such a need.

Go and check how “Presence Simulation” works… The state of your first device does not matter for this function to work. If it is set, it will try to execute regardless of everything else. Works relative to device does not take into account scenes and other devices and their status.
And the lights must be on until 23:00 and then turned off at a random time between 23:00-23:45.

Go and test your solution based on these two devices and see what happens.

It does not matter whether the lights are turned on or off by the first sequence. “Presence Simulation” will turn them on or off many times depending on the state. This does not in any way solve the situation the OP is talking about. Otherwise he would already be using “Presence Simulation”!

If the OP wants to have control on a daily basis, it matters, despite your assessment. However, you want to forcefully introduce an operating pattern that the OP does not want, i.e. turn it off and on using “Presence Simulation”!

The “If” function in ewelink scenes currently does not have the ability to execute at a random time within a defined time interval.
There is a “Time of Day” option and you can set the date, time and number of executions, but there is no random time option.
And what will “” give him in the form of this function but expanded with a random time.

On the ewelink side, you can basically do nothing if you pair your account. And if for some reason this is not the preferred option, we create a scene in ewelink and set the webhook as the trigger, and our device and its status to off as the action.

Simple and fast!

1 Like

Interesting topic, I’m wondering about it too. However, my neighbor used a simpler solution. It has IP cameras and a powerful LED illuminator on the roof, maybe 100W, I don’t know, which turns on all night long. Then it’s as bright as day, so a potential intruder would have to act “in the spotlight” :slight_smile:

Everyone chooses a solution according to their own needs. OP asks and we answer. :slight_smile:

My solution (used for many years now) is to create a schedule for different switch on time or switch off time every day of the week but this does leave you with only seven pseudo-random timings. It would be better if that setting for on/off could be an offset to sunrise and sunset. If someone is watching your property for over a week and they want to get it, random lights/devices coming on probably isn’t going to stop them. Deception is an art of good security but for the time, this helps work toward the goal without using an external function to EWeLink.