Randomized Lighting Plugin

Posted on
Wed May 20, 2015 9:34 pm
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Randomized Lighting Plugin

Randomized Lighting

Download Current Version (v0.0.5)

This plugin aims to make it simple to run a randomized lighthing sequence to make it look like you are home when you are not.

This is accomplished with 2 actions:
    1. Start Random Lighthing
    2. Stop Random Lighting
      a. Stop and Turn Off Lights
      b. Stop and Keep Current Lights On
      c. Stop and Keep Specific Lights On

A good way to trigger these actions would be to have an “atHome” variable for when the house is occupied or not. When it becomes false you can execute the “Start Random Lighting” action, and when it becomes true you can execute one of the “Stop Random Lighting” actions. The random lighting will never run unless it is dark.

Setup:
1. Create a “Random Lighting Group” virtual device
2. Select which lights you want to use for the random lighting sequence
3. Configure other options if desired
Configure.png
Configure.png (177.73 KiB) Viewed 8249 times


Now simply create the triggers to start and stop the random lighting and you are all set.
Tip: The "Stop and Keep Specific Lights On" action enables you to turn on any lights, even if they are not defined within your "Random Lighting Group" virtual device.

Future:
I am contemplating adding the ability to configure a "dark period" between cycles where either no lights turn on, or just one stays on for a period of time. Any other suggestions from the community are welcome too!

Posted on
Thu May 21, 2015 2:57 am
durosity offline
User avatar
Posts: 3071
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: NEW: Randomized Lighting Plugin

Awesome!! I've been meaning to write a script to do this but never got around to it! Very handy security tool!!

Computer says no.

Posted on
Thu May 21, 2015 2:21 pm
Shutter offline
Posts: 319
Joined: Mar 07, 2014
Location: London, UK

Re: NEW: Randomized Lighting Plugin

Hi,

I'm so glad this exists. But…

Code: Select all
  Randomized Lighting Error       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 63, in runConcurrentThread
<type 'exceptions.AttributeError'>: 'Plugin' object has no attribute 'p_device'

  Randomized Lighting Error       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Error                           script error: Can’t make characters 12 thru -1 of "" into type string. (-1700)


:(

Posted on
Thu May 21, 2015 7:55 pm
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

Have you created a randomized lighting virtual device?

Posted on
Fri May 22, 2015 2:51 am
Shutter offline
Posts: 319
Joined: Mar 07, 2014
Location: London, UK

Re: NEW: Randomized Lighting Plugin

I have now. :roll:

I saw the error in the logs as soon as I installed the plugin and left it at that. (Tinkering before bed is never a good idea). Anyway, errors are no more, and I'll do some testing this weekend.

Like I said, I'm sooooooo glad this exists. Thanks you.

As to your request for any suggestions - I have one. Even though the plug is for randomising lights could your add a strobe option? I've always wanted an easy way to be able to turn lights on and off like a strobe (maybe not the best name as it's never going to be a true strobe with domestic lights) in case the alarm ever gets tripped.

Thanks

Simon

Posted on
Fri May 22, 2015 5:00 pm
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

Glad you got it working, but I thought I had fixed it so that error wouldn't happen before device creation so I'll try to get an update out for that soon.

As for the strobe, it's not really within the scope of this plugin and would be easily done with a small script, so I probably won't include it in the plugin.

Posted on
Fri May 22, 2015 7:11 pm
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

v0.0.5 Released
Download in first post

FIXED: No more errors in log before you create the virtual device

Posted on
Sun Feb 07, 2016 11:21 am
maslett offline
Posts: 69
Joined: Aug 09, 2014

Quick Question

Hi Spencer,

thanks for the plugin.

Quick question Can you have more than one virtual group i.e. one for upstairs lights and one for downstairs lights.

Many thanks, Mark

Posted on
Wed Aug 17, 2016 4:43 pm
durosity offline
User avatar
Posts: 3071
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: NEW: Randomized Lighting Plugin

Feature request:

Ability for the device group to show a state as to if it's on or off.

Computer says no.

Posted on
Thu Aug 18, 2016 1:17 am
Woetjes offline
Posts: 99
Joined: Apr 04, 2016
Location: Belgium

Re: NEW: Randomized Lighting Plugin

+1 for on/off status

Posted on
Thu Aug 18, 2016 9:32 am
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Randomized Lighting Plugin

Hi all, sorry I've been away from this for quite a while!

I was a pretty novice programmer when I made this and now I'm maybe a slightly less novice programmer :mrgreen: so I'm going to try to make this better and incorporate the above suggestions/requests.

I don't really have a timeline because I just do this in my little spare time but I'll keep you posted. Thanks!

Posted on
Thu Aug 18, 2016 9:41 am
durosity offline
User avatar
Posts: 3071
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Randomized Lighting Plugin

Cool! Just have it ready by tomorrow 9am I'll be happy ;)

Computer says no.

Posted on
Thu Aug 18, 2016 9:42 am
SpencerJRoberts offline
User avatar
Posts: 248
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Randomized Lighting Plugin

Hahaha :)

Sent from my Nexus 6P using Tapatalk

Posted on
Thu Aug 18, 2016 11:39 am
howartp offline
Posts: 2857
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Randomized Lighting Plugin

durosity wrote:
Cool! Just have it ready by tomorrow 9am I'll be happy ;)

UK time or US time?

It either gives him longer or shorter depending on the answer?!


Sent from my iPhone using Tapatalk

Posted on
Thu Aug 18, 2016 1:38 pm
durosity offline
User avatar
Posts: 3071
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Randomized Lighting Plugin

As everyone should work to UK time that question is a tad redundant ;)

Computer says no.

Who is online

Users browsing this forum: No registered users and 0 guests