We have moved at community.getvera.com

Author Topic: The "Lived-in" look; lighting timer randomness available?  (Read 20604 times)

Offline easyIsle

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
The "Lived-in" look; lighting timer randomness available?
« on: December 07, 2009, 11:52:44 am »
Hello,

I have a pending customer wondering if the lighting timers can be varied with some sort of randomness to make the home look especially lived-in.. is this a feature of the current Vera?

If not, can it be added to a future Vera firmware update?

Thank you for your help, both current Vera users and Vera employees :-)

Offline JimMac

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +2/-1
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #1 on: December 07, 2009, 04:06:03 pm »
I asked this question a while ago and never got an answer from MV.
http://forum.micasaverde.com/index.php?topic=2020.0


Offline Chimpware

  • Sr. Member
  • ****
  • Posts: 426
  • Karma: +0/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #2 on: December 07, 2009, 07:09:59 pm »
Only way to achieve something like this right now is to make the light on and off relative to sunset/sunrise.  It then has differing times each day, but relative to sunrise/sunset is fixed.

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 642
  • Karma: +15/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #3 on: December 08, 2009, 11:40:38 am »
I have no idea if it works, but the Lua language does have a "math" library that contains a random function. Call is math.random(), and is supposed to return a random number (fraction) between 0 and 1. The documentation indicates there are other options for what random returns as well.

You could write a scene with Lua code that fires every couple of minutes during the window that you want the scene to run, and does a random number lookup, and if the returned number is within a certain range (say > .9 for example), turns on the light (I would add a fail safe that turns on the light at the end of the time "window", just in case).

I found the string library functions kind of work, but there are a couple of issues. I have not tried any of the math functions.

Hope this helps

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #4 on: December 08, 2009, 11:52:11 am »
Here's some stuff to get you a few steps closer.  I had written this a few weeks back, but never got it completed (was heading out on vacation and ran out of time).

It was intended as an example to help illustrate what the functionality could look like if "Timers" were augmented, and to find out what worked best for parameters, so it's very rought.

It has a bunch of parameters controlling the minimum time (IntervalLower), maximum time (IntervalUpper) to wait before making a choice along with the on/percentage weighting (eg 30% chance of setting state to "on") at the decision point.

The code waits for a "random" period of time between intervalLower and intervalUpper (in minutes), and then it does an evaluation of whether to turn the Scene event "on" or "off".

It uses the OnPercentage "weighting" to determine whether to set the light to an "on" state or an "off" state at that decision point.


I had it running solo, not controlling anything, but hadn't gotten to getting it correctly working in scenes just yet.


Someone might like to try it as a project....
« Last Edit: December 08, 2009, 04:41:52 pm by guessed »

Offline brsipaq

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #5 on: December 08, 2009, 04:39:42 pm »
Guessed,

This is great stuff.  What are the problems you are having?

Also, could you post the S_ file?

Thanks,
Brian
Controllers - Vera firmware 979 Dongle version 2.78 L:1, GE 45601 and 45608, HA07c, HA09c
Outlets/Switches - HA01c, (2) HA02c, (4) VRI06, (2) VRS15, HA04c (Not used yet) Sensor - HRDS1 Door/Window (garage door) Thermostat - WDTC-20 IP Camera - Linksys WVC54GCA

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #6 on: December 08, 2009, 04:58:19 pm »
Sorry about that Brian, I've amended the post above to include the S_Randomizer.xml file.

Quote
What are the problems you are having?

Mostly, time to write it, I was leaving on vacation the next morning ;)   I had it ticking over, flipping "states", but I wasn't getting it to work when I attached a Lamp/Appliance Module to it's Scene definitions.

In testing, I would set the min/max to 1 (minute) so it would poll quickly, but I couldn't work out the kinks in Scenes.



After that, I had planned to add an "Enabled/Disabled" (better than "Armed/Disarmed") flags that I'd control with regular Timer Scenes.

ie. At 6:00pm set Randomizer "Enabled", at 10:00pm set Randomizer "Disabled"

Where I'd have the Randomizer idle it's state down to "off" after some [random] period after it's diabled.

I was also doing it to see if we could work out "how" we wanted these things to behave, to pilot a better [built in] behaviour of the Timers.... since otherwise you'd need to setup a who bunch of different Randomizer Devices.



On a longer term/larger scale note...
It would be better to be able to "record" user behavior, and then playback.  Unfortunately Vera's Device Luup dont have the capability to see all the requests in order to "Record" them.  The Device hooks to "play back" are, but there's no point unless you can "record".

ie. Record/Playback combined with the Lua XML and Socket libs I've asked for in another thread, and you can read/write a Google Calendar (CalDAV) to control the whole shooting match. 

...perhaps I've had too much quality time with the low level CalDAV protocol lately ;)

Offline JoTa

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #7 on: February 22, 2011, 01:17:25 pm »
Guessed,

   Ive have some experience with the panasonic adapted pluggin to control Foscam PT ipcam pluggin and the Fuztle's Caddx one too, i'll be interesting to look in your randomize pluggin and make some efforts trying to complete it. Can you give me some directions first to save some time before ??


Thanks,
JoTa.-

Offline mbairhead

  • Hero Member
  • *****
  • Posts: 516
  • Karma: +5/-2
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #8 on: February 22, 2011, 02:38:04 pm »
While I'd really like to see a working random scene, I just created a bunch of "Vacation" scenes (I think 12 of them) and set them to run at different times on different days on different lights and let them run over each other. So I might have a Mon - Tues - Fri scene that runs the front door lights and foyer from 7 pm -  9:15 and a Tues - Wed - Sat scene that runs the dining room and stairs from 7:45 - 11:20pm and just kept building like that. It's not truly random but it appears random enough from the outside for a week or so and it's very easy to set up. plus you can easily expand or contract it. Once the Puck is easy to use, I'll probably add a TV on setting every now and then at night too.

Offline maks327

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #9 on: February 22, 2011, 05:09:14 pm »
It's worth looking at this thread as well:
http://forum.micasaverde.com/index.php?PHPSESSID=f8790d3feb3a89f4c88926311679ebb2&topic=5609.msg32457#msg32457

AP15e is working on a plugin there.  In the mean time, I've got a little snippet of luup code I use to randomize the time a light comes on within a specified time period. 

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 642
  • Karma: +15/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #10 on: February 22, 2011, 05:51:23 pm »
I really just don't worry about the randomness. If someone is watching my house closely enough to realize the light turns on and off at the same time each day, then I feel I am already in trouble.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #11 on: February 22, 2011, 09:50:22 pm »
Given that @Ap15e's work is active, probably best to add details to that implementation to get it to do what people need.

Mine started life in UI2, so there's no .json file, it doesn't yet have the logic to enable/disable, etc, etc.  All relatively easy to add, if you're willing to "borrow" snippets of code from things like:

a) D_MotionSensor1.json (for the Scene/Event presence, and a UI to control the "On/Off" nature),
... or from @woodsby's code http://code.mios.com/trac/mios_activerfid/browser/D_RFIDTransmitter.json

b) Add code to handle Actions in the <actionList>
...for when users interact with the JSON-based UI, similar to this snippet from @woodsby's code http://code.mios.com/trac/mios_activerfid/browser/I_ActiveRFID.xml#L147

At the end of that, you could basically use it declaratively (no code) as the "event" to drive two scenes (one for on, one for off) via the Standard scene creation/editing UI.

Again, probably best to get the ideas and fold them into one implementation.  I provide the above info just in case someone wants to learn more about Luup programming, since it's often easier to start with a stub, and go from there.

Offline glaso

  • Jr. Member
  • **
  • Posts: 59
  • Karma: +0/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #12 on: March 31, 2011, 03:11:25 pm »
Any news about this. I think it could represent a major improvement in z-wave / Vera functionality

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #13 on: March 31, 2011, 04:10:11 pm »
I came to the conclusion that the best way to implement a 'lived-in' look would be to record a whole day and play back the recording with a user-defined (or random) timeshift.

The recording functionality is there (http://forum.micasaverde.com/index.php?topic=5609.msg34012#msg34012), but it lacks the recording of timestamps: http://bugs.micasaverde.com/view.php?id=1428

Offline raskell

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Re: The "Lived-in" look; lighting timer randomness available?
« Reply #14 on: March 31, 2011, 07:27:31 pm »
I do this using before sunrise & after sunset, but then add a different 'off' timer for each day of the week.  Each off timer is, by example, around 11:00 pm but then varies by +/- 25 minutes from day to day.  Monday could be 10:40, Tuesday 11:05, Wed 10:50, etc...  This is as random as currently possible and would require a significant amount of survellience to figure it out.  I often go in monthly and shufle the times by day around just in case.
Vera2, UI4, Trane/Schlage TStats(6), Schlage LeverLock, GE 3-wayswitches, WD HA14 3-way dimmers, Intermatic Outdoor Module, Hawking door/window sensor(s), VeraLite UI5, Everspring SM-103