Randomized Lighting Plugin

User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Randomized Lighting Plugin

Post 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. 1. Start Random Lighthing
    2. Stop Random Lighting
    1. 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 15001 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!
User avatar
durosity
Posts: 4381
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: NEW: Randomized Lighting Plugin

Post by durosity »

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.
Shutter
Posts: 345
Joined: Fri Mar 07, 2014 7:11 am
Location: London, UK

Re: NEW: Randomized Lighting Plugin

Post 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)
:(
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

Post by SpencerJRoberts »

Have you created a randomized lighting virtual device?
Shutter
Posts: 345
Joined: Fri Mar 07, 2014 7:11 am
Location: London, UK

Re: NEW: Randomized Lighting Plugin

Post 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
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

Post 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.
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: NEW: Randomized Lighting Plugin

Post by SpencerJRoberts »

v0.0.5 Released
Download in first post

FIXED: No more errors in log before you create the virtual device
maslett
Posts: 95
Joined: Sat Aug 09, 2014 6:58 am

Quick Question

Post 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
User avatar
durosity
Posts: 4381
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: NEW: Randomized Lighting Plugin

Post by durosity »

Feature request:

Ability for the device group to show a state as to if it's on or off.
Computer says no.
Woetjes
Posts: 117
Joined: Mon Apr 04, 2016 6:44 am
Location: Belgium

Re: NEW: Randomized Lighting Plugin

Post by Woetjes »

+1 for on/off status
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: Randomized Lighting Plugin

Post 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!
User avatar
durosity
Posts: 4381
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Randomized Lighting Plugin

Post by durosity »

Cool! Just have it ready by tomorrow 9am I'll be happy ;)
Computer says no.
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: Randomized Lighting Plugin

Post by SpencerJRoberts »

Hahaha :)

Sent from my Nexus 6P using Tapatalk
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Randomized Lighting Plugin

Post 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
User avatar
durosity
Posts: 4381
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Randomized Lighting Plugin

Post by durosity »

As everyone should work to UK time that question is a tad redundant ;)
Computer says no.
Post Reply

Return to “Spencer's Plugins”