PLTS Example - A Smarter Bathroom Fan

So the simple answer is, don’t fiddle with it and leave the advanced Tab alone…

I’ve deleted the old one, is there anything else I should do before creating a new one?

I guess you missed my previous response!
Create a NEW device before you delete the OLD device!

yep, sure did…

Since yesterday I’ve created and deleted 5-7 PLEGS.

What now?

FYI, I tried the wiki first for more info, but it doesn’t open.

If you have strange unexplained behavior … do it the other way around …
Create a new one then delete the old one.

If you delete then add … if the device you want to delete has the highest device ID, then your newly created device will get the same device ID as the one you deleted … Vera has some bugs actually deleting everything … so you can see left over data from the previous instance. If you add first … you are guaranteed to get a new device ID and it can’t be confused with something else.

OK, Created a new PLEG, checked the TABS before I went any further and found an existing Input trigger for the Motion Sensor, deleted it then coded as per Rex’s post.

In DashBoard Overview, I still have 2 Input triggers appearing even though I have no PLEG.
I created a new one, hoping that a trigger might attach itself to it, alas, no such luck.

[s]How can I delete these?

Scene Name Description Last run Setup
ProgramLogic_42 Motion1 Entry 4 in 1 sensor (motion) is tripped 10/04/2013 12:32:41
ProgramLogic_45 Motion1 Entry 4 in 1 sensor (motion) is tripped [/s]

OK solved that problem, at the very least I’m finding my way around… :slight_smile:

Recoded the PLEG, now I can’t get it to turn on…talk about hair pulling.
Initially thought it might have been the lightlevel, so I deleted it as a device Property making the only trigger motion…nup… device is triggering, PLEG not seeing it trigger…
please send me a hat…

Report as follows:

Triggers
Name Description
Motion1 Entry 4 in 1 sensor (motion) armed is tripped

Schedules
Name Type Time Days

Conditions
Name Expression
LightsOn Motion1
Light1Off LightsOn; Now > 3:00
Light2Off LightsOn; Now > 4:00

Actions

Actions for Condition: LightsOn
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=100
TV LED SetTarget newTargetValue=1

Actions for Condition: Light1Off
Device Action Arguments
Kitchen LED SetTarget newTargetValue=0

Actions for Condition: Light2Off
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=0

edit:

Just out of interest I created a PLTS and used the sensor to trigger it…so I know that the sensor is working OK.

Can anyone help?

Your LightsOn condition seems to reference Motion11 rather than Motion1. I would have expected this to throw an error in the blue message console.

If correcting this doesn’t fix it, see: [url=http://forum.micasaverde.com/index.php/topic,14385.0.html]http://forum.micasaverde.com/index.php/topic,14385.0.html[/url] and post the log.

Thanks Rex, I did notice that after I posted it in the pdf and changed the Name, so the report as written in the body of the post was correct, I should have deleted the pdf so it didn’t confuse.

OK, as the problem revolves around the name Motion, I coded a simple PLEG to turn on a light using the Name M1, and it triggers, go figure, is Motion a reserved name?

I’ll work (play) on the timer function later.

Thanks guy’s it can be frustrating but it’s great having both of you (yourself & Richard) as a backup.

Is Motion a reserved name?
The [b]PL[/b] plugins try to make sure you name things uniquely. If you delete a variable ... it still will not let you re-use it's name until you reload the browser window. That's why it appended the [b]1[/b] to the name. You should be able to rename after you reload the browser window.

Thanks Richard, oddly, it still doesn’t like Motion or Motion1, I have a Veralite, not sure if that has anything to do with it?
I’ll need to remember that Motion11 is verboten now as well!

The timer is causing me grief now, I take it NOW is a reserved word as it is a function.
For the life of me I just don’t see why it doesn’t recognise the function and act accordingly…
Just thinking out aloud, I’m wondering if the country format has an effect, I’m in Australia using dd/mm/yyyy rather than US mm/dd/yyyyy?

I have not been following this thread … But Send me your current Report And I will look it over. You can PM or Email me.

I'm wondering if the country format has an effect, I'm in Australia using dd/mm/yyyy rather than US mm/dd/yyyyy?
No it isn't that. I'm in the UK using dd/mm/yyyy and it still works fine.

How long does your motion-detector stay tripped before it resets? We may need to add a little more logic:

Triggers
MotionTrip Entry 4 in 1 sensor (motion) armed is tripped
KitchenOn Kitchen light is turned on
UpstairsOn Upstairs light is turned on

Conditions
LightsOn MotionTrip and not (KitchenOn) and not (UpstairsOn)
Light1Off KitchenOn and (LightsOn; Now > 3:00)
Light2Off UpstairsOn and (LightsOn; Now > 4:00)

OMG, I’m so far out of my depth here.
For something that sounds so easy, it’s creating so many problems.
Rex, you’re a god send, but we’re still not there.

Vera is returning the following error message.

Program Logic : UpstairsOn and (LightsOn); Now > 4:00: Illegal Count Expression: UpstairsOn and TMP_1; Now > 4:00

Report attached.

The following syntax is incorrect:

UpstairsOn and (LightsOn); Now > 4:00

You should change to:

UpstairsOn and (LightsOn; Now > 4:00)

Check to see if you made the same mistake on other conditions.

Yes, thanks RTS, corrected and accepted by Vera.

Still not triggering.

This is the cause of much frustration, the trigger on the PLTS works, why doesn’t it on the PLEG?

I must confess I am puzzled by this. I have configured a PLEG with the same settings and it works as expected. Here’s what I would do:

Do not delete the current PLEG but create a new one. Create two VirtualSwitch devices - call them VS1 and VS2.
Add the MotionTrip trigger to the PLEG.
Add a condition LightsOn MotionTrip and an action for it to turn on VS1. Check that it works.

Add a condition Light1Off (LightsOn; Now >30) and an action to turn off VS1. Check that it works.

Add a trigger for VS1On.
Change LightsOn to MotionTrip and not (VS1On). Check that it works.

Change Light1Off to VS1On and (LightsOn; Now > 30). Check that it works.

Add a trigger for VS2On.
Change LightsOn to MotionTrip and not (VS1On) and not (VS2On).
Change the action for LightsOn to also turn on VS2.
Add a condition Light2Off (LightsOn; Now > 1:00) and an action to turn off VS2. Check that it works.

If you got this far without a problem, change the VS1 trigger and action to one of your lights. Check it works.

Change the VS2 trigger and action to the other light. Check it works.

(Sudden screech of brakes) Your upstairs light is a dimmer not a switch. Your trigger UpstairsOn needs to be changed to LoadTargetValue > 50 or similar depending on what is provided by the dimmer device.

I’m leaving the step-by-step in the post: (a) In case the dimmer is a red-herring; (b) The approach may help someone; (c) I already typed it! ;D

Also Read the Debugging Thread:
http://forum.micasaverde.com/index.php/topic,14385.0.html

A log during the interval when you are getting unexplained behaviour would be useful with an attached current report.

Another day…Today the PLEG trips, nothing has been changed. ???

[s]I’m still getting this error message from Vera.

Program Logic : MotionTrip and Not(KitchenOn) and Not(UpstairsOn): Invalid Value token: NOTTMP_1[/s]

See posts below for solution of LightsOn

That might be because UpstairsOn is a dimmer, none the less it is tripping, why it wouldn’t yesterday is a mystery.

I’ve tried to set the loadtargetlevel when it’s triggered it seems to indicate 0, I have no options open to do this in the DeviceProperty TAB.

I’m going to delete the Upstairs Light and just get the PLEG to function as a single light timer (which it still isn’t doing) then go forth from there.

I've tried to set the loadtargetlevel when it's triggered it seems to indicate 0, I have no options open to do this in the DeviceProperty TAB.

Is there an option for LoadLevelStatus? There appears to be some variation in devices as to whether LoadLevelTarget reflects the current dimming level.

It maybe a good idea to get it working with one light and then try adding the dimmable one later.

[s]For some reason the light triggers aren’t resetting after being triggered, consequently freezing any subsequent actions.

Below taken from UI5 Overview.

Triggers
Scene Name Description Last run Setup
ProgramLogic_46 KitchenOn Kitchen LED is turned on 16/04/2013 08:39:09
ProgramLogic_46 UpstairsOn Upstairs Entry is turned on 16/04/2013 08:39:07
ProgramLogic_46 Motiontrip Entry 4 in 1 sensor (motion) is tripped 16/04/2013 12:57:04

Any idea on how to reset them?[/s]

In the mean time, I’ll restore yesterday backup and continue blindly.

Continuing on blindly I have discovered that the brackets appear to be the problem.
Deleting them in the LightsOn has lights being turned on as expected. +1

Still have timer issues…-1