Skip to content

Instantly share code, notes, and snippets.

@BenediktNiehues
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenediktNiehues/2cf456fb8aa698d5a04c to your computer and use it in GitHub Desktop.
Save BenediktNiehues/2cf456fb8aa698d5a04c to your computer and use it in GitHub Desktop.
Rule Template
{
"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