Project Home‎ > ‎Documentation‎ > ‎Attributes‎ > ‎

Trigger

Trigger will trigger the MAPPED command once it receives COMMAND from the optional SOURCE and the time delay has expired. In other words once COMMAND happens, wait SECS seconds, then issued MAPPED command.


Syntax:


trigger={
	Attribute.COMMAND:	Command.<State>,
	Attribute.MAPPED:	Command.<State>,
	Attribute.SOURCE:	<source device>,    <-- Optional
	Attribute.SECS:	        <time in seconds>,
},


or
trigger={ Attribute.COMMAND: Command.<State>, Attribute.MAPPED: Command.<State>, Attribute.SOURCE: <source device>, Attribute.SECS:         <time in seconds>,
    
    Attribute.START:        <time> <-- Optional
    
    Attribute.END:          
<time> <-- "
},

<time> can be:'HH:MM' 'HH:MM:SS' 'HH:MMam|pm' HH:MM:SSam|pm or
(seconds, minutes, hours, day-of-month, month, day-of-week)

Examples:

'16:30' - 24 hour clock
'16:30:25'
'4:30pm' - 12 hour clock
'4:30:25pm'
'4:30am'
('*',30,16,'*','*','*') <- 4:30pm in cron format
('*',0,9,'*','*',5) <- 9:00am on Saturdays only


Example:

In this example, when the device receives a MOTION command from the “m_backdoor” motion sensor, the timer begins counting down. Once the timer has reached 3 minutes, Pytomation will issue the OFF command to the device.

trigger={
	Attribute.COMMAND:	Command.MOTION,
	Attribute.MAPPED:	Command.OFF,
	Attribute.SOURCE:	m_backdoor,
	Attribute.SECS:	3*60,
},


Here is the same command as above but it only is effective between 10:10pm and 7:00am

trigger={
        Attribute.COMMAND: Command.ON,
        Attribute.MAPPED: Command.OFF,
        Attribute.SOURCE: (m_backdoor,m_garage),
        Attribute.SECS: 5*60,
        Attribute.START: '10:10pm',
        Attribute.END: '7:00am',
},

This Trigger has date ranges from 6:10pm on Saturday to 7:00am on Sunday

trigger={
        Attribute.COMMAND: Command.ON,
        Attribute.MAPPED: Command.OFF,
        Attribute.SOURCE: (m_backdoor,m_garage),
        Attribute.SECS: 5*60,
        Attribute.START: ('*'10,18,'*','*',5),
        Attribute.END: ('*'0,7,'*','*',6),
},
Comments