This is a very basic plugin that randomly toggles one device in a list. I couldn't find a straightforward way to accomplish this, so I wrote my own. The plugin provides a single action called Toggle Device, which randomly picks one device from a list and toggles its state. The user is able to select multiple devices when configuring the action. Only actions that support an onState property will be displayed for selection.
I am currently using this action in two ways:
"Twinkling" Lights
I have a couple of colored bulbs attached to some legacy X10 devices for Christmas. In the past, I simply turned them on for the added color. With this plugin, I set up a schedule to run every 5 seconds with a Toggle Device action. Each of the colored lights is selected in the action preferences. The result is that every 5 seconds, one of the colored lights randomly turned on or off, giving a nice twinkling effect.
"Vacation" Lights
I created a new schedule that runs every hour (but only when dark and houseMode == 'vacation') and randomized by 30 minutes. The action is a Toggle Device action, which selects from several lights from around my house. The result is that once every 30-90 minutes a light in the house turns on or off. This makes a very nice deterrent when we are away.
I'd appreciate any feedback!
Source Code: https://github.com/jheddings/indigo-rtoggle
Version 1.0.1: https://github.com/jheddings/indigo-rtoggle/releases/download/v1.0.1/rtoggle_1.0.1.zip