Create a PLEG from previously utilizing Combination switches and vitural.

Yes everything gets a name. (Input Triggers, Device Properties, and schedules, and Conditions themselves.)

Associated with the name is a Value, and On Time Stamp and an Off Time Stamp.

Logic is defined by expressions of these names. Most expressions deal with the Value of these named things.
The Sequence Expression, Multi Trigger Operator @, and the # operator deal with the time stamps.

In the examples I use bold to represent the names.

Input Schedule:
MotionSchedule On Mon-Sun at 22:00:00, Off Mon-Sun at 05:00:00

Input Trigger:
MotionX Armed Motion Detector at location X is tripped.

Condition:
MotionXStart MotionSchedule and MotionX

[hr]
Now lets use some advanced features and detect 10 minutes after all motion stops.
Input Schedule:
OffMotionTimer ON: SelfReTrigger Off Interval of 10:00

Conditions:
MotionXRestart MotionXStart
Set the Repeat flag to True.
We want the repeat to restart/extend the counter if more motion happens before 10 minutes.
The Action for condition will start/extend the timer.
To do this … go to the Actions Advanced Tab, Pick the PLEG device, Pick the StartTimer, Specify the timer name: OffMotionTimer

MotionXDelayedStop MotionXStart;!OffMotionTimer

This expression will require you read up on sequence expressions to understand.
Basically it states that wen the OffMotionTimer turns OFF adter MotionXStart happens … then turn true and run actions.

Turn on lights with the MotionXStart action.
Turn off lights with the MotionXDelayedStop action.

Yes I am arming these during the 10:00pm to 5:00am time.

Under INPUT then SCHEDULE TAB i made MotionSchedule

I made a motionx & a motionX_X since I have two different sensors

for my condition I did: MotionSchedule AND (MotionX OR MotionX_X)

created Input Schedule:
OffMotionTimer ON: SelfReTrigger Off Interval of 10:00

created the following:

MotionXRestart MotionXStart
Set the Repeat flag to True.
We want the repeat to restart/extend the counter if more motion happens before 10 minutes.
The Action for condition will start/extend the timer.
To do this … go to the Actions Advanced Tab, Pick the PLEG device, Pick the StartTimer, Specify the timer name: OffMotionTimer

capture1

created condition :

MotionXDelayedStop MotionXStart;!OffMotionTimer

made the following actions.
Turn on lights with the MotionXStart action.
Turn off lights with the MotionXDelayedStop action.

Now I just wait for 10:00 pm to test.

The Doit Now button in the schedules editor can force the schedule to change state now so you can test it now!

Well it appears I have done an error somewhere. First both motion sensors never go it ARM mode. I manually made them go into armed mode and they sensed motion but my light never game on.

[table]
[tr]
[td]Program Logic Event Generator

Device ID: 812014-03-04 14:38:40.140 PLC Version: 6

Registration

You have 1 licenses, which allows for 4 PLEG and/or PLTS plugins.
Your license key is: $1$1J4tlX5J$DQdLjWk40W2MZyN4RArdAA
Triggers

Name Description State Last True Last False
Front_door_tripped FRONT DOOR is tripped false 2014-03-04 13:16:37.647 2014-03-04 13:18:18.307
Back_door_tripped BACK DOOR is tripped false 2014-03-03 23:18:23.818 2014-03-03 23:18:28.798
Night_time_arrived Day or Night indicates Night time. false 2014-03-03 23:11:59.307 2014-03-04 06:34:26.121
Day_time_has_arrived Day or Night indicates Day time. true 2014-03-04 06:34:26.123 2014-03-03 23:11:59.310
Family_room_Light_on Family Room Light is turned on false 2014-03-04 06:51:44.151 2014-03-04 10:12:01.501
MotionX House Motion Sensor armed is tripped false 2014-03-04 14:36:53.333 2014-03-04 14:37:05.667
MotionX_X Arduino Motion 1:0 armed is tripped true 2014-03-04 14:36:55.903 2014-03-04 14:36:42.286
Schedules

Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay State Last On Last Off
MotionSchedule Weekly 22:00:00 1,2,3,4,5,6,7 None Weekly 05:00:00 1,2,3,4,5,6,7 None false 2014-03-04 14:35:52.894 2014-03-04 14:38:42.365
OffMotionTimer Self ReTrigger None Interval 00:10:00 None false 2014-03-04 14:37:05.731 2014-03-04 14:38:48.260
Conditions

Name Repeat Expression State Last True Last False
c1 No !Family_room_Light_on AND (Front_door_tripped OR Back_door_tripped) AND Night_time_arrived false 2014-03-03 22:41:20.413 2014-03-03 22:41:21.633
c2 No Family_room_Light_on AND (back_door_tripped OR Front_door_tripped) AND Night_time_arrived false 2014-03-03 23:19:20.786 2014-03-03 23:19:24.616
MotionXStart No MotionSchedule AND (MotionX OR MotionX_X) false 2014-03-04 14:36:53.397 2014-03-04 14:38:42.378
MotionXRestart Yes MotionXStart false 2014-03-04 14:37:05.699 2014-03-04 14:38:42.380
MotionXDelayedStop No MotionXStart;!OffMotionTimer false 2014-03-04 13:49:08.749 2014-03-04 14:36:53.411
Actions

Actions for Condition: c1

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=1
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Family Room Light SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: c2

Immediate

Device Action Arguments
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: MotionXStart

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=0
Actions for Condition: MotionXRestart

Immediate

Device Action Arguments
Program Logic Event Generator StartTimer timerName=OffMotionTimer intervalTime=
Actions for Condition: MotionXDelayedStop

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=0[/td]
[/tr]
[/table]

You will need to set them to ARM either manually, as you have done, or with a scene, or with PLEG. Or, just use the “sensor is tripped” state on the MotionX input.

MotionSchedule Weekly 22:00:00 1,2,3,4,5,6,7 None Weekly 05:00:00 1,2,3,4,5,6,7 None false 2014-03-04 14:35:52.894 2014-03-04 14:38:42.365

is False or “Not During the Schedule”, so to test it, Open PLEG, go to that schedule and press the Do It Now button as Richard pointed out. It will change the state to True and you can test it. verify that by opening the status report after you toggle the schedule.

MotionXStart should then become true because your Arduino sensor is tripped.

my code looks like it should work. But after about 4 minutes it finally clicked the two lights on.

[table]
[tr]
[td]Program Logic Event Generator

Device ID: 812014-03-04 16:32:34.909 PLC Version: 6

Registration

You have 1 licenses, which allows for 4 PLEG and/or PLTS plugins.
Your license key is: $1$1J4tlX5J$DQdLjWk40W2MZyN4RArdAA
Triggers

Name Description State Last True Last False
Front_door_tripped FRONT DOOR is tripped false 2014-03-04 16:11:31.727 2014-03-04 16:12:56.957
Back_door_tripped BACK DOOR is tripped false 2014-03-03 23:18:23.818 2014-03-03 23:18:28.798
Night_time_arrived Day or Night indicates Night time. false 2014-03-03 23:11:59.307 2014-03-04 06:34:26.121
Day_time_has_arrived Day or Night indicates Day time. true 2014-03-04 06:34:26.123 2014-03-03 23:11:59.310
Family_room_Light_on Family Room Light is turned on false 2014-03-04 06:51:44.151 2014-03-04 10:12:01.501
MotionX House Motion Sensor armed is tripped false 2014-03-04 16:32:40.108 2014-03-04 16:32:53.496
MotionX_X Arduino Motion 1:0 armed is tripped true 2014-03-04 16:32:38.108 2014-03-04 16:31:31.068
Schedules

Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay State Last On Last Off
MotionSchedule Weekly 22:00:00 1,2,3,4,5,6,7 None Weekly 05:00:00 1,2,3,4,5,6,7 None true 2014-03-04 16:20:08.744 2014-03-04 16:16:25.691
OffMotionTimer Self ReTrigger None Interval 00:10:00 None true 2014-03-04 16:32:53.549 2014-03-04 15:03:23.101
Conditions

Name Repeat Expression State Last True Last False
c1 No !Family_room_Light_on AND (Front_door_tripped OR Back_door_tripped) AND Night_time_arrived false 2014-03-03 22:41:20.413 2014-03-03 22:41:21.633
c2 No Family_room_Light_on AND (back_door_tripped OR Front_door_tripped) AND Night_time_arrived false 2014-03-03 23:19:20.786 2014-03-03 23:19:24.616
MotionXStart No MotionSchedule AND (MotionX OR MotionX_X) true 2014-03-04 16:29:34.092 2014-03-04 16:29:22.098
MotionXRestart Yes MotionXStart true 2014-03-04 16:32:53.529 2014-03-04 16:29:22.100
MotionXDelayedStop No MotionXStart;!OffMotionTimer false 2014-03-04 15:04:05.480 2014-03-04 16:22:29.104
Actions

Actions for Condition: c1

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=1
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Family Room Light SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: c2

Immediate

Device Action Arguments
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: MotionXStart

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Actions for Condition: MotionXRestart

Immediate

Device Action Arguments
Program Logic Event Generator StartTimer timerName=OffMotionTimer intervalTime=
Actions for Condition: MotionXDelayedStop

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=0[/td]
[/tr]
[/table]

Then I disarmed the two sensors toggled the schedule and this is what I got. But light not off yet.

[table]
[tr]
[td]Program Logic Event Generator

Device ID: 812014-03-04 16:40:00.490 PLC Version: 6

Registration

You have 1 licenses, which allows for 4 PLEG and/or PLTS plugins.
Your license key is: $1$1J4tlX5J$DQdLjWk40W2MZyN4RArdAA
Triggers

Name Description State Last True Last False
Front_door_tripped FRONT DOOR is tripped false 2014-03-04 16:11:31.727 2014-03-04 16:12:56.957
Back_door_tripped BACK DOOR is tripped false 2014-03-03 23:18:23.818 2014-03-03 23:18:28.798
Night_time_arrived Day or Night indicates Night time. false 2014-03-03 23:11:59.307 2014-03-04 06:34:26.121
Day_time_has_arrived Day or Night indicates Day time. true 2014-03-04 06:34:26.123 2014-03-03 23:11:59.310
Family_room_Light_on Family Room Light is turned on true 2014-03-04 16:33:42.677 2014-03-04 10:12:01.501
MotionX House Motion Sensor armed is tripped false 2014-03-04 16:38:17.897 2014-03-04 16:39:26.447
MotionX_X Arduino Motion 1:0 armed is tripped false 2014-03-04 16:38:00.532 2014-03-04 16:39:11.167
Schedules

Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay State Last On Last Off
MotionSchedule Weekly 22:00:00 1,2,3,4,5,6,7 None Weekly 05:00:00 1,2,3,4,5,6,7 None false 2014-03-04 16:20:08.744 2014-03-04 16:39:00.888
OffMotionTimer Self ReTrigger None Interval 00:10:00 None true 2014-03-04 16:38:30.152 2014-03-04 15:03:23.101
Conditions

Name Repeat Expression State Last True Last False
c1 No !Family_room_Light_on AND (Front_door_tripped OR Back_door_tripped) AND Night_time_arrived false 2014-03-03 22:41:20.413 2014-03-03 22:41:21.633
c2 No Family_room_Light_on AND (back_door_tripped OR Front_door_tripped) AND Night_time_arrived false 2014-03-03 23:19:20.786 2014-03-03 23:19:24.616
MotionXStart No MotionSchedule AND (MotionX OR MotionX_X) false 2014-03-04 16:37:42.676 2014-03-04 16:39:00.908
MotionXRestart Yes MotionXStart false 2014-03-04 16:38:30.129 2014-03-04 16:39:26.481
MotionXDelayedStop No MotionXStart;!OffMotionTimer false 2014-03-04 15:04:05.480 2014-03-04 16:22:29.104
Actions

Actions for Condition: c1

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=1
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Family Room Light SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: c2

Immediate

Device Action Arguments
Hallway Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Front Porch SetTarget newTargetValue=1
Delay 45

Device Action Arguments
Family Room Plug SetTarget newTargetValue=0
Hallway Light SetTarget newTargetValue=0
Front Porch SetTarget newTargetValue=0
Actions for Condition: MotionXStart

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=1
Family Room Plug SetTarget newTargetValue=1
Actions for Condition: MotionXRestart

Immediate

Device Action Arguments
Program Logic Event Generator StartTimer timerName=OffMotionTimer intervalTime=
Actions for Condition: MotionXDelayedStop

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=0[/td]
[/tr]
[/table]

It could be because you have set the light to turn off in MotionXStart

Actions for Condition: MotionXStart

Immediate

Device Action Arguments
Family Room Light SetTarget newTargetValue=0
Actions for Condition: MotionXRestart

You may want to review that Action

I guess you figured that out…

Yes, i got it. What is the best way to put in Notification on movement. I do have Vera Alerts installed and pushover and smtp profiles. What I am looking for is based on say 10 consective minutes of motion during the MotionSchedule to send me notification that there has been 10 minutes of motion after hours.

The same concept is going to hold true for a new trigger I am going to make for if Barn_door_Sensor tripped during MotionSchedule to automatically notify me immediately of Barn door intrusion. I am just awaiting some additional Arduino Nano and motion sensors from China and then I will actually have the barn door triggered and arm motion sensor during Motion schedule trip my Fortrezz strob/siren and notify me immediately. .

Assuming the MotionTrigger is called MotionX

The following condition will notify if MotionX is On and has been on for 10 Minutes;

NotifyX MotionX and MotionSchedule and (MotionX; NOW > 10:00)

[hr]
Two ways to add the notifications:

  1. In the notification tab … When a Condtion is Satisfied … select the NotifyX condition.
  2. Int the actions for NotifyX Select the Vera Alerts Tab, Select the SendAlert Command, Specify the Message and recipients (Profile(s) or UserName(s))

Got it inserted with the notify if condition satified.

To have my Panasoic PTZ take a picture and send them to me when motion detected and been 10 minutes?

Under inputs I do not see any of my cameras listed. I have two Panasonic and one vera brand.

For Vera ALerts (Email and Vera Alerts Mobile Profile) add the following to the Message
{Picture(87)}

Where 87 is the Vera DeviceID of the camera … 87 for me.

You wouldn’t happen to have a screen shot of this for the camera. My family room camera is id 17

I do not know what your datamm2000 profile is

It should show up as an attachment for the email.
It will not do anything for the PushOver profile.

I am lost when it comes to this. Under veraalerts I have two profiles. SMTP & pushover.
my smtp utilizes my gmail account. under the smtp it says

Messages can use Templates to access just about any variable from any device in Vera. No need for luup code … but the syntax can be detailed.
You can also enhance your messages with the following:

{Picture(DeviceID)} Send a snapshot of the camera identified by DeviceID and associate it with the alert.
You can send multiple pictures.
{To=XXX@YYY.com} you can override the default to.
{From=XXX@YYY.com} you can override the default from.
{Subject=Your Subject For This Message} you can override the default Email Subject.

But where am I suppose to be puting picture device id to get a captured picture sent to me.?

IN the message string … you did it correctly.

for example in our example notifyX my question is where does {Picture(17)} go…

I have a regular scene created that automatically closes blinds at 6:30 pm and opens at 6:30 am. That scene notifies me via capture2 pic.

How would I add the {Picture(17)} to my VeraAlerts so that when the blinds schedule hits it also includes a picture.

This should really be in VeraAlerts I know but the NotifyX is what is still in question so that it not only emails me put includes a picture.

So, Richard showed you this, and you confirmed that you did it with the screenshot you sent a few posts ago. Plus, Richard confirmed you did it correctly.

Is that not working for you?

I tried what you said even in NOTIFYX Action

Int the actions for NotifyX Select the Vera Alerts Tab, Select the SendAlert Command, Specify the Message and recipients (Profile(s) or UserName(s))

When I go down to VeraAlerts Icon it has a big red circle with x in it

Correct NO pictures are coming threw.

OK that’s a problem for Richard