Random Toggle Action

Posted on
Fri Nov 25, 2016 10:48 pm
jheddings offline
User avatar
Posts: 149
Joined: Dec 01, 2013
Location: Denver, CO

Random Toggle Action

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

Posted on
Sat Nov 26, 2016 3:27 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Random Toggle Action

Oh cool! There's already something for randomised lighting but doesn't have a "twinkling" mode which could be handy this time of year. :)

Computer says no.

Posted on
Sun Nov 27, 2016 11:24 am
yassi offline
Posts: 468
Joined: Sep 06, 2015
Location: Germany

Re: Random Toggle Action

Very handy!
Thank you very much!

Yassi

Posted on
Wed Dec 28, 2016 8:55 pm
jheddings offline
User avatar
Posts: 149
Joined: Dec 01, 2013
Location: Denver, CO

Re: Random Toggle Action

NOTE this plugin has moved to a dedicated forum. Please check there for announcements and support.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests