Stopping timers

Is there a way to stop or clear timers, once they have been created? And if so, how does one find them? I am still trying to solve the problem of stopping scenes, once they have been started.

Unless your scene does all of it’s work in LUUP code … I do not think it is possible to stop a scene once it starts executing the immediate and delayed device commands that are visible from the Advanced Tab on a scene.

I have some ideas … but all would require considerable effort with trial and error testing to see if any would work.

I suggest you take another strategy … Try using the Program Logic Event Generator and/or Program Logic Timer Switch plugins. You have a lot more control over those devices.

Thanks, yes, I looked at hose. But it seems that you can only control one device per PLEG. I have also tried to use vacation ghost. But it is too beta ;-}. Could you possible give me a link to how to write your own LUUP scene code. I don’t mean just the standard startup LUUP snippet. Thanks.

PLEG can have a large number of Inputs(triggers, schedules, device properties) … a large number of logic conditions, and an actions (Similar to a scene) for EACH condition.

If you want to program in LUUP … here are some references:

Standard LUA documentation:
[url=http://www.lua.org/docs.html]http://www.lua.org/docs.html[/url]
MCV Extensions to LUA for Vera:
[url=http://wiki.micasaverde.com/index.php/Luup_Lua_extensions]http://wiki.micasaverde.com/index.php/Luup_Lua_extensions[/url]

Where you start … depends on what you want to do. You can search the forums for examples of what people have done already … If that does not meet your needs then you should be able to do what every you want with the above material … and a little guidance from this community.

If you have basic programming skills it will not take long to pick up the language … If not … you will have to learn these skills at the same time as learning the language … that will take longer.

Thank you for your help. My goal is to create an occupancy simulator similar to the intent of vacation ghost; but one that works. The PLEG is quite ingenous, but I would have to set one up for each light. I might well do so if I don’t find a more economic solution.
I have 52 years of programming experience in languages evolving from patch cords (if you ever heard of it) to C#. But my problem is with understanding the Vera ecosystem. Vera 3 runs a no frill version of Linux, on top of which sits MIOS. I am still trying to figure out how the various files belonging to an App interact.

One more question: does PLEG survive a luup restart?

Yes, the state for PLEG survives a LUUP restart … as does the CountDown timers.
The other nice thing is the interval timers are all modulo math of midnight … as opposed to modulo Vera restart.

i.e. if you have a Scene timer that runs every 6 Hrs … if it is going to run in 10 minutes on Vera … then Vera Restarts … It will run in 6 Hrs from when Vera restarts.
With PLEG and PLTS it will run at the same time … independent of when Vera reboot …

t I would have to set one up for each light.
How many lights do you have.

In general there is about 2MB overhead for every device on the Vera Dashboard. If you have say 30 lights and you have 30 (ANY Device Like PLEG) to automate these lights you will now have a 4MB overhead per device. If you have a Vera Lite … memory will start to be a problem much sooner!

A single instance of PLEG can handle more than one light … you just have different variable/condition names. Also note that PLEG does not have any Random capabilities.

Also note that PLEG does not have any Random capabilities.
By an amazing coincidence, I had just read that line when PLEG turned on my lounge light triggered by a randomized timer. Yes - it really did happen just at that moment. Spooky. :o

Anyway, it is not difficult to give PLEG randomized timers. I have a dedicated PLEG that makes my house looked lived-in based on four randomized timers which are set with reference to my normal habits and adjusted for sunrise and sunset. I don’t believe there is a practical limit to how many lights this could control.

It uses two scenes: One runs each day at 02:05:00 (to avoid DST changes) and the other runs every five minutes. The timers are saved in a VariableContainer plugin and survive restarts unscathed. Even if the five-minute scene gets delayed it does not affect the accuracy of the timers. See [url=http://forum.micasaverde.com/index.php/topic,12759.msg101561.html#msg101561]http://forum.micasaverde.com/index.php/topic,12759.msg101561.html#msg101561[/url] for details.