PLTS: PreState or what did I miss?

Hi,

Now I’m new to Vera and still in the initial phase of learning. Early understood that simple basic scenarios would bloat the interface, so thanks to RTS whom put all in one place - these will be great once learned.
The problem with all these RTS-PlugIns is not what you can do, but to begin, with them.

I’ve had a little bit of trying before I came up with this working solution, but it seems like I’ve got lost somewhere in all the options. So please guide/correct me (which will help me, and perhaps others, in the future).
Also couldn’t get page to load; http://rts-services.com/Vera/Plugin/PLTS/TurnOffTheLights/

Description:
I have a bathroom mirror with a top and a bottom light. I’ve separated them and added a Fibaro 2x1.5 switch connected S1 to a single switch.
Actions:
When switch turned on then both top and bottom light should be switched on (Note only S1 is attached to switch).
When switch turned of, then turn of top light and start the timer. After timer triggered then turn of bottom ligth.

PLTS setup (hopefully this can be perfected):
I had to use Arm/Disarm before this could be acceived.
Inputs (triggers): t1LightOn, t2LightOff [Fibaro switch S1 trigger on and off]
Condition: Interval 30, Interval2 - not used, ResetState; Off, SwitchMode; Imediate
Trigger Expressions: Arm; t1LightOn, Resett; t1LightOn, On; t2LightOff
Actions: Arm = (BottomLight) On, Reset = (PLTS) Armed, Off = (PLTS) Bypass + (BottomLight) Off + (TopLight) Off ← Just in case.

Problems:
If I enter the batchroom before the trigger time has finished it does not restart well.
The relay switch tends to flick on/off before it finaly sets (I don’t like the sound of it flickering). This is probably a Fibaro issue (which I have to live with) or can be perfected with better understanding.

It seems like I haven’t fully understood all the otions I can use. But main thing is: How do I/we select a PreState Scene (now done through Arm)? In this case turn the S2 on.
Why isn’t there an option for OnTimer (since trigger is the begining not the end), what did I miss here, which is after?

Hopefully this can help others start using the plug in.
These plugins are the right track for everyone to travel - becasue else the scenes would be too many. But they’re not that easy to start with (understandable since they’re not in the cor but add-ins).

Regards
// Qunaki

Hello @qunaki, you are nearly there.

Try this:

Inputs (triggers)
t1LightOn [Fibaro switch S1 trigger on]
t2LightOff [Fibaro switch S1 trigger off]

Inputs Conditions
Icon: , IconState

Conditions
Interval: 30
ResetState: Off
SwitchMode: Imediate Toggle/Delayed Reset

Arm: t1LightOn
Bypass: (Icon > 90) and t2LightOff
Reset: t1LightOn
Trigger: t2LightOff

Actions
Arm: (BottomLight) On
Bypass: (BottomLight) Off – You could also add i Off [/i]but it shouldn’t be necessary with the FGS 221.

This uses the state of the PLTS icon to indicate when the timing interval has elapsed so that the device can be set to Bypass. This technique works (I use it in several PLTS devices) but maybe @RichardTSchaefer will suggest a better way to achieve this.

The relay switch tends to flick on/off before it finaly sets (I don't like the sound of it flickering). This is probably a Fibaro issue (which I have to live with) or can be perfected with better understanding.
This is not an issue with the FG 221 and you should not see this with the settings above.

By the way, if you are using the FGS221 with a normal two-state switch (on and off) and you want the relay to follow this (so on is on, off is off), set the configuration parameters 13 and 14 to 1. You only need to do this for the S1 device.

[quote=“RexBeckett, post:2, topic:174435”]Inputs Conditions
Icon: , IconState[/quote]

Thanks for your suggestion. Unfortunately it didn’t work.

Chosed my device “PTLS1” and Iconstate and named it “Icon” in Device Prop.
(as a beginner we’re stay put in square one as we don’t from the start know what and why a setting like this. e.g. like what do 90 say? - can guess 90%).

Changed Bypassed to (Icon > 90) AND t2LightOff etc.
Changed the actions to only have Arm and Bypass with on respectivily off state for fibaro S2.
(even tried to set Arm and Bypass in actions, but no differences)

The action “arm” turns on the botttomlight, but it doesn’t handle the 30 sec trigger time. It turns of the bottom light instantly when S1 is turned of, though. Thus no get a 30 sec trigger (which today is down to 10 actaully).

Yet again, this is the main problem with an interface like Vera. Those how know how it’s rules and how it rocks have no issues, but a beginner like me have a hell. Those whom learn a great plugin like PLTS, are eased by it’s ability - for others it’s a quite high learning curve.
But yet again there will be new beginners and so forth. A great device like this should be standard and only real rare special cases should have to have luup-code.
I’m not afraid to put in luup code (once that I’ve learned it), but unfortenately it causes another level of complexity that it’s hard to find anyone nearby that can configure it, than me. Home automation should be simple and reliable.
Vera is like having a unix or dos-prompt. Unfortenately there is only a handfull using that, compared to mainstream using windows or osx. Home automation, as known today, is still at square one.

No, I use a mono-stable switch. This is one of the things I like and will implement as long as the transformation to Z-wave continues. 3-way swithes ha always been a little akward (mostly on switches with 2 paddles - don’t know the english name), since up/down isn’t always on/off. Another perculiar thing with bistable swithes is that if Vera turned something off, that you turned on before, then you have to turn off and then turn on. Else if one use switch mode param 13 = 0 and 14 = 1 the padles can be in any direction. Thus I think the only sane way is mono-stable switches.

// Qunaki

If the timer does not start when you turn off S1 there must be something wrong with either the definition of t2LightOff or the Trigger condition. I have set up a PLTS using exactly these settings and it works as you requested.

Unless… If you are using a momentary switch for S1 then perhaps the t2LightOff is firing when you release the switch so immediately after t1LightOn. Try changing the t1LightOn and t2LightOff triggers to use the state of the relay rather than the S1 switch. This is usually the device with the lowest device ID of the three that are created when you include the FGS221.

IconState has five values in a PLTS: 0 for Off, 25, 50 and 75 as the interval counts down and 100 when it switches On. You could think of it as a percentage.

I’ve used the lowest ID all the time since it update Vera visually better and I don’t know the difference between them two. But I’ll look in to this soon.

Thanks for the IconState numbers. Once I’ll manage this plug life will become much easier :slight_smile:

Now it works, and guess I know what made it failure:

When I finally had it to work originally (i.e. my way), then I started with 30 sec, then I decreased it to 20 and finally 10 sec. The settings above will actually kill the light (Icon > 90) before the timmer has triggered.

With 20 sek settings it turns of about 2-3 seconds before expire. With only 10 sek one gould hardly see the delay.
So one thing bad about above is that it’s not optimal for short times and/or more exact timings.
To get 10 sek I’ll just have to clock it and somewhere around 15 sec will probalby do the trick.

So for me and others to start understand this plug-in.
The different inputs are the triggers to begin different (condition-)actions.
Conditions are what the above triggers do with the plug-in buttons Arm/Disarm etc. (and timers).
Actions are what the above conditions trigger when changes.

So a defined trigger set to fire “trigger” in conditions, will start the countdown. When “trigger”-time expires it fires the action-trigger, which then handles the different scene settings.
If not then I’ve totaly lost focus on this very useable plug-in.

Best thing with it is that it keep all stuff together in (almost) one place.

// Qunaki

I use the clause (Icon > 90) with timers of ten and thirty seconds and it does not truncate the times. Are you using a recent version of the PLxx plugins? The latest version is 2.1 and I know it also worked reliably on version 2.0. I believe that earlier versions of the plugins used more icon states which would explain your results. I recommend using the latest versions of PLxx as the author has added some very useful features.

I should probably not encourage the use of this type of trigger condition although it works faultlessly on my system. I am trying to find a more direct alternative that achieves the same result.

Last State Change is when any state transition happens.
Read the documentation for the State transition Diagrams.
It’s different for the different modes.
I think I left out a state in the Immediate Trigger/Auto reset mode diagram.
It may be in a particular state only long enough to send out a notification.
On and Off are not really states. Their value is a function of what the Reset State is defined as.
I do generate events for On/Off … The actual states are RESET and TOGGLED.

I do generate events for On/Off ... The actual states are RESET and TOGGLED.
Thanks for the clarification. I've deleted the suggestion. I thought I tried [i]Toggled[/i] and [i]Reset[/i] but obviously not thoroughly enough. :-[

If you want a Delayed Toggle with Auto Reset in other words it is only Toggled long enough to trigger events or actions … I can create a new switch type.

It’s just a matter of creating the appropriate state transition table.

r.t.s.

@RichardTSchaefer

Up to five minutes ago I would have said “yes” to your kind offer. Now I find that something I tried weeks ago that did not work now does! I’m not sure if this is due to V2.1 or the Mios bug you mentioned that could affect triggers. I can now create a trigger for both the PLTS On and Off states. Curious…

Actually, it would still be useful to have the option of an auto reset. :slight_smile:

@qunaki

Here is a cleaner solution for your Bypass condition. Create an Inputs, Trigger for your PLTS device is turned off and name it PLTSOff. Now your Bypass condition can be: t2LightOff and (t2LightOff; PLTSOff) The Arm, Reset and Trigger conditions should not need to be changed.

I have verified correct operation using your original requirements and PLTS V2.1. You may need to upgrade your plugins to V2.1 for this to work. All three components (Program Logic Core, Program Logic Timer Switch and Program Logic Event Generator) should be updated.

You may remove the Device Properties in your PLTS that refer to IconState.

@RichardTSchaefer

There is still something curious happening. If I try to create an Inputs, Trigger, is turned on or off with specified status, device is turned off, and is armed - the saved trigger is all the above but is bypassed. Attempts to edit the trigger and/or delete it and create a new one with different names does not seem to help. Is this a manifestation of the Mios bug?

I thought I answered this … I guess I was distracted.

This is the MCV bug I listed on my web documentation.
I have a fix … It involves changing a MCV supplied javascript file.
Basically they have a serious bug for events that have more than one argument.
(i.e. Switch Status, and Armed Status)

There are actually lots of bugs in the way they handle trigger definitions … many can be worked around
by deleting a trigger and redefining it.

Since I use much of their code for PL?? trigger input definitions … I am mostly bug for bug compatible.

I have sent them the fix. You need to be able to execute some linux commands on Vera.
If interested email me …

[quote=“RexBeckett, post:12, topic:174435”]@qunaki

Now your Bypass condition can be: t2LightOff and (t2LightOff; PLTSOff)[/quote]

I have latest version.
Typically I first typed (t2LightOff AND PLTSOff), after that it worked. Thanks.

Thanks to both of you, clarifying the usage - one day I think I’ll get it.
Did see that in the Advanced tab and scrolling down one can see all the real actions and code set by the prevoius modifications. I like that a lot, it’s hands on and a great way to find errors, learn etc.

Unfortunately I still miss an selectable action OnTimer, Timer1Completed, TimerFinished (or whatever one want to call it) - because as I see it, it is what a timer does - it finally ends! It should not have to be fired with Bypass according to me, but maybe there is something lika above that I’ve missed.
But yet now it works and I’m greatefull for all of your (startup)help, clarification and for a great plugin.

Unfortunately I still miss an selectable action OnTimer, Timer1Completed, TimerFinished (or whatever one want to call it)
You do have that. You can define an action for [i]On[/i] and [i]Off[/i]. Which one of these fires when the time interval is completed depends on how you have set [i]ResetState[/i] and [i]SwitchMode[/i].
It should not have to be fired with Bypass according to me, but maybe there is something lika above that I've missed.
The reason for using the Arm/Bypass state in your application is to avoid the need for a separate switch or scene to turn on Light2 when Light1 is switched on - but not start the timer until Light1 is switched off. [i]Edit: This is not true - it is not necessary. I suggested additions to make the logic work rather than start from the requirements and construct the simplest solution. This is Engineering 1.0.1. I really should know better. [/i] ::) There are also other ways to achieve this. [i]Edit: See later post.[/i] One big advantage of the PLxx plugins is that, in most cases, you can have all your logic in one place - as you mentioned in an earler post.

I’m happy to hear it is working.

I thought I answered this ...
Yes, I think you did. I had not connected the dots. :-[

@qunaki

Looking back to the start of this thread, you were already using the Arm/Bypass “switch” and I didn’t question whether it was necessary. If it would make more sense for you, you can also achieve your requirements with the following PLTS configuration:

Inputs Triggers
t1LightOn: as before
t2LightOff: as before

Conditions
Interval: 30
ResetState: On
SwitchMode: Delayed Toggle/Explicit Reset

Reset: t1LightOn
Trigger: t2LightOff

Actions
On:
Off:

The PLTS should be armed - and will stay that way.

I’ll try this later. Right now Vera has gone totally bananas here, and nothing is changed since PLTS worked (so it’s not that part).

Can’t connect to anything and no node will repond. After tried repair etc. I finnaly restored with backup, but still everything seems the same. I.e. this has noting to do with PLTS or changed settings.
Vera just started to behave, or better, not behave at all.
Everything right now is totally unreliable, and this setup is just about 1 month old. Great stuff, relaible and real future proof.
Right now I’m quite pissed. Two times I’ve fired tickets because of date issues, and now nothing at all works, all in one single month. I’ll reset the unit then I’ll go to bed now and don’t bother for a while. A nice birthday isn’t it? Thanks Micasa!

EDIT: The unit is still out of order, the time is more than one hour behind and still nothing works. I’ll fire a third time issue ticket. Some stuff can act, but most don’t. Restored from an earlier backup and still nothing happens.