Page 1 of 2

Randomized Lighting Plugin

PostPosted: Wed May 20, 2015 9:34 pm
by SpencerJRoberts
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 13189 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!

Re: NEW: Randomized Lighting Plugin

PostPosted: Thu May 21, 2015 2:57 am
by durosity
Awesome!! I've been meaning to write a script to do this but never got around to it! Very handy security tool!!

Re: NEW: Randomized Lighting Plugin

PostPosted: Thu May 21, 2015 2:21 pm
by Shutter
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)


:(

Re: NEW: Randomized Lighting Plugin

PostPosted: Thu May 21, 2015 7:55 pm
by SpencerJRoberts
Have you created a randomized lighting virtual device?

Re: NEW: Randomized Lighting Plugin

PostPosted: Fri May 22, 2015 2:51 am
by Shutter
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

Re: NEW: Randomized Lighting Plugin

PostPosted: Fri May 22, 2015 5:00 pm
by SpencerJRoberts
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.

Re: NEW: Randomized Lighting Plugin

PostPosted: Fri May 22, 2015 7:11 pm
by SpencerJRoberts
v0.0.5 Released
Download in first post

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

Quick Question

PostPosted: Sun Feb 07, 2016 11:21 am
by maslett
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

Re: NEW: Randomized Lighting Plugin

PostPosted: Wed Aug 17, 2016 4:43 pm
by durosity
Feature request:

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

Re: NEW: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 1:17 am
by Woetjes
+1 for on/off status

Re: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 9:32 am
by SpencerJRoberts
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!

Re: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 9:41 am
by durosity
Cool! Just have it ready by tomorrow 9am I'll be happy ;)

Re: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 9:42 am
by SpencerJRoberts
Hahaha :)

Sent from my Nexus 6P using Tapatalk

Re: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 11:39 am
by howartp
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

Re: Randomized Lighting Plugin

PostPosted: Thu Aug 18, 2016 1:38 pm
by durosity
As everyone should work to UK time that question is a tad redundant ;)