Random waiting in scene

Hello,

Is it possible in scenes, when defining wait action, to set time as random value? Specifically, I’m looking for option to set random value between two integers (for instance wait for random number of minutes between 5 to 10).

The motivation is to set vacation mode on lightning to give impression that someone is in the house, hence randomization.

Hi @Niomak ! It’s not currently possible natively in scene.

I don’t know if you have a bit of technical knowledge, but you could do it with the MQTT integration + Node-RED, or just with a simple script

If you want some help to setup that, I’d be happy to help :slight_smile:

Sorry for late response, I didn’t notice e-mail that there was response.

I have some programming knowledge so script option would be more natural for me.
However I did not see any option to write custom scripts in Gladys.
Could you provide some hints how to do this?
Thank you in advance.

For your use case, you can create a fake MQTT device (e.g. “Light On”).

Then, using Node-RED or a custom script, you can publish messages to an MQTT topic at random times to toggle this virtual light on or off.

In Gladys, you can create a scene that listens for state changes on this fake device and use it to control all your real lights.

Helpful resources:

:point_right: MQTT integration guide:

:point_right: Node-RED integration guide:

Feel free to ask if you need any help setting it up :slightly_smiling_face:

Hi @Niomak,

I’ve been working on this feature so you can use this natively in Gladys!

I’ve modified the “Wait” action in scene to support computed values.

This action will support the random function to generate random values here:

The PR is here, it’ll probably go live in the next version of Gladys :slight_smile:

Thanks for your feedback :pray:

Amazing. Thank you. This will be extremely helpful.

1 Like