-
-
Save BenediktNiehues/2cf456fb8aa698d5a04c to your computer and use it in GitHub Desktop.
Rule Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id" : "MotionSwitchRuleTemplate", | |
"description" : "Switch lamp on motion detection.", | |
"input" : [ | |
{ "name":"interval", | |
"type": "long", | |
"label": "Timer Interval", | |
"description": "Timer interval in milliseconds.", | |
"required": false, | |
"default": 20000 | |
}, | |
{ | |
"name":"motionItem", | |
"type": "string", | |
"label": "Motion Item Name", | |
"description": "Name of motion detector", | |
"required": true | |
}, | |
{ | |
"name":"dimmerItem", | |
"type": "string", | |
"label": "Dimmer Item Name", | |
"description": "Name of dimmer actuator.", | |
"required": true | |
} | |
] | |
}, | |
"on" : [ | |
{ | |
"name":"motionTrigger2", | |
"type": "MotionTrigger", | |
"input": { | |
"itemName" : "$motionItem" | |
} | |
}, | |
{ | |
"name":"MyPeriodicalTimerTrigger1", | |
"type": "PeriodicalTimerTrigger", | |
"input": { | |
"interval" : "$interval" | |
} | |
} | |
] | |
"if" : | |
[ | |
{ | |
"name":"MyMotionCondition", | |
"type": "MotionBrightnessCondition", | |
"input": { | |
"expression" : "motion == true", | |
"motion" : "${motionTrigger2.motion}" | |
} | |
} | |
], | |
"then" : [ | |
{ | |
"name":"setdimmerlevel", | |
"type": "ItemScriptAction", | |
"input": { | |
"expression": "items.$dimmerItem.level = 60" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment