UPDATED: Program Logic Timer Switch Plugin

Program Logic Timer Switch or PLTS is a Timed Switch (similar to the Countdown Timer Plugin) where EACH of the buttons (On, Off, Arm, Bypass, Trigger, Reset, Restart) can have their OWN expression to trigger (similar to Combination Switch plugin)

The condition expressions are more expressive than the Combination Switch plugin.
It has all the same expressive capability as the Program Logic Event Generator; see: [url=http://forum.micasaverde.com/index.php/topic,12759.0.html]http://forum.micasaverde.com/index.php/topic,12759.0.html[/url]
Inputs to the condition expressions can be any combination of the following:

[ul][li]Triggers - From any other Vera Device[/li]
[li]Schedules - Unique to this device. Similar to the Schedule for a scene[/li]
[li]Device Properties - Any Device Property in Vera[/li][/ul]

It has dual timer periods … so you can emulate the behavior of the Smart Switch Plugin.

See [url=http://RTS-Services.com/Vera/Plugin/PL]http://RTS-Services.com/Vera/Plugin/PLTS[/url] for more details.

Hi RichardTSchaefer,

If you can pull this off, it will be awesome. Good luck writing the expression parser in Lua!*

It looks like you are going to blur the distinction between continuous state and instantaneous events, and allow mixing of both within expressions. I hope that works. Users definitely think that way, I’ve seen from innumerable conversations here on the forums. It’s a cognitive bridge I refused to cross with the Combination Switch, much to users’ disappointment.

Thinking back through the real-world examples that people have asked for, see if your syntax will allow for compact representation of things such as:

[ul][li]Trigger A happens within 90 seconds of Trigger B OR Trigger C, whatever happened most recently.[/li]
[li]Trigger D OR Trigger E happens within 90 seconds of Trigger F.[/li]
[li]Trigger G happens within 90 seconds of Trigger H, in either order.[/li]
[li]Trigger I happens in the range 10 to 20 seconds before Trigger J, no less, no more.[/li][/ul]

I don’t need any of these things personally (I’ll just program it), I’m just trying to recall what users have been trying to do, particularly things that are messy to do with (a small number of) Combination Switches and Countdown Timers.

Feel free to pinch any code from my plugins that you need. It’s nominally GPL but I can explicitly relicense it to you with whatever you need.

  • I once wrote a recursive-descent XPath parser in pure XSLT 1.0, so I feel qualified to say that.

Thanks for the feedback … I have to think of a good syntax for representing the various interval contraints you listed. If any one wants to propose one … I am open to suggestions.

Your “Combination Plugin” motivated me to think a little more out of the box. I implemented the Triggers editor differently than you … I cloned much of the Vera UI5 JavaScript code for setting up Triggers for scenes … but I do it all in one control panel. It also enforces that trigger names are unique and meets syntax requirements for the expression parser.

Only thing left to do is the parser …

I have modified the sequence expressions as follows:

Triggers in any order, separated by a comma:
Trigger1, Trigger2, … , TriggerN
Triggers in the specified order, separated by a semi-colon:
Trigger1; Trigger2; … ; TriggerN
optionally followed by one or both of the following time constraints

hh:mm:ss
The difference in time from the first event to the last event occurs in more than the interval specified
< hh:mm:ss
The difference in time from the first event to the last event occurs in less than the interval specified

i.e. Trigger1; Trigger2 > 30 < 5:00
Trigger2 follows Trigger1 by more than 30 seconds but less than 5 minutes.

Hi Richard

Just looked at your site at screenshots of the plugin, it looks very interesting indeed

How close are you to releasing it ?

Maybe this weekend …

All major components are done and tested (Countdown core, UI, Condition Parser, persistent state management to survive a reboot, …) one small (but critical) task left to do that links some of the components together.

Releasing as a plugin will be a pain … Since I have uncompressed LUA files, and icons that go in other areas.
The Application Portal does not persist settings for these options … So a lots of re-entry when I release a new version. (I have released versions for my own testing.)

Looks very promising !

It’s now available from the APP store.

Thanks for this! I can see some uses for this… However I was wondering if you could give examples of real life uses that you built this for and if anyone else uses it some of their uses.

I am new to Vera and Z-Wave and have come a LONG way in the last 3 weeks… As I read other peoples setups and uses it helps me realize new potential or features that I didn’t necessarily think of.

I just download from APP store … and noticed I forgot to update one file.
So I need to patch this.

I will add a typical Motion Sensor with Light scenario to the documentation.

Hi Richard

How long should we wait before downloading?

The initial version was 1.1, you want a version greater than that. i.e. 1.2
I have already released … but not sure how long it takes to get through approval process.

I’m on UI5 Vera 3 and tried to dl your plug in in apps.mios.

After it installed I got “Lua startup failed”.
I tried to use it, but Lua keeps failing. I uninstalled it and re installed it with the same result.

Any ideas?

Sorry … who would have thought that to release the code to the APP store would be half of the development time …

I need to release one more file (Actually I overwrote a file I did not intend to)

OK thanks. I will wait. Let us all know when you get the file included.

installed the plugin, but now it keeps on saying installing plugin and i cannot remove it. How can I get de install it. I keep on getting message “delivery failed”.

I had the same issue this morning. As a new user I didn’t know how else to stop it, so I just restored my backup from yesterday. This reverted my system back to before the plugin was attempting to install so everything was fine.

I used the special delete device url, and now my vera works again

UI5 only?

Yes. I am on UI5.