{
   "author" : "Maroš Kollár",
   "category" : "complex_applications",
   "defaults" : {
      "description" : "__m_descr__",
      "dimmer" : {
         "mode" : "full"
      },
      "lights" : [],
      "preconditions" : {
         "binary" : [],
         "multilevel" : [],
         "recheck" : false,
         "time" : []
      },
      "securitySensors" : [],
      "timeout" : 60,
      "title" : "__m_title__"
   },
   "dependencies" : [
      "BaseModule"
   ],
   "homepage" : "https://github.com/maros/Zway-MotionTrigger/",
   "icon" : "icon.png",
   "maturity" : "stable",
   "moduleName" : "MotionTrigger",
   "options" : {
      "fields" : {
         "dimmer" : {
            "fields" : {
               "code" : {
                  "dependencies" : {
                     "mode" : "code"
                  },
                  "helper" : "__dimmer_code_helper__",
                  "label" : "__dimmer_code_label__",
                  "order" : 2,
                  "type" : "textarea"
               },
               "dynamic" : {
                  "dependencies" : {
                     "mode" : "dynamic"
                  },
                  "fields" : {
                     "levelMax" : {
                        "label" : "__dimmer_dynamic_level_max_label__",
                        "order" : 5
                     },
                     "levelMin" : {
                        "label" : "__dimmer_dynamic_level_min_label__",
                        "order" : 4
                     },
                     "luminosityDevice" : {
                        "datasource" : "namespaces",
                        "field" : "optionLabels",
                        "label" : "__dimmer_dynamic_luminosity_device_label__",
                        "optionLabels" : "namespaces:devices_sensorMultilevel:deviceName",
                        "order" : 1,
                        "type" : "select"
                     },
                     "luminosityMax" : {
                        "label" : "__dimmer_dynamic_luminosity_max_label__",
                        "order" : 3
                     },
                     "luminosityMin" : {
                        "label" : "__dimmer_dynamic_luminosity_min_label__",
                        "order" : 2
                     }
                  },
                  "label" : "__dimmer_dynamic_label__",
                  "order" : 4
               },
               "mode" : {
                  "helper" : "__dimmer_mode_helper__",
                  "label" : "__dimmer_mode_label__",
                  "oder" : 1,
                  "optionLabels" : [
                     "__dimmer_mode_full__",
                     "__dimmer_mode_static__",
                     "__dimmer_mode_code__",
                     "__dimmer_mode_dynamic__"
                  ],
                  "type" : "select"
               },
               "static" : {
                  "dependencies" : {
                     "mode" : "static"
                  },
                  "label" : "__dimmer_static_label__",
                  "order" : 3
               }
            },
            "order" : 6,
            "type" : "object"
         },
         "lights" : {
            "fields" : {
               "item" : {
                  "datasource" : "namespaces",
                  "field" : "optionLabels",
                  "optionLabels" : "namespaces:devices_switchBinary:deviceName,namespaces:devices_switchMultilevel:deviceName",
                  "type" : "select"
               }
            },
            "label" : "__lights_label__",
            "order" : 2
         },
         "pollSensors" : {
            "helper" : "__poll_sensors_helper__",
            "label" : "__poll_sensors_label__",
            "order" : 5
         },
         "preconditions" : {
            "fields" : {
               "binary" : {
                  "helper" : "__binary_helper__",
                  "items" : {
                     "fields" : {
                        "device" : {
                           "datasource" : "namespaces",
                           "field" : "optionLabels",
                           "label" : "",
                           "optionLabels" : "namespaces:devices_sensorBinary:deviceName,namespaces:devices_switchBinary:deviceName",
                           "order" : 1,
                           "type" : "select"
                        },
                        "value" : {
                           "order" : 2
                        }
                     }
                  },
                  "label" : "__binary_label__",
                  "order" : 1
               },
               "multilevel" : {
                  "helper" : "__multilevel_helper__",
                  "items" : {
                     "fields" : {
                        "device" : {
                           "datasource" : "namespaces",
                           "field" : "optionLabels",
                           "label" : "",
                           "optionLabels" : "namespaces:devices_sensorMultilevel:deviceName,namespaces:devices_switchMultilevel:deviceName",
                           "order" : 1,
                           "type" : "select"
                        },
                        "operator" : {
                           "optionLabels" : [
                              "=",
                              "≠",
                              ">",
                              "≥",
                              "<",
                              "≤"
                           ],
                           "order" : 2,
                           "type" : "select"
                        },
                        "value" : {
                           "order" : 3
                        }
                     }
                  },
                  "label" : "__multilevel_label__",
                  "order" : 2
               },
               "recheck" : {
                  "helper" : "__recheck_preconditions_helper__",
                  "label" : "__recheck_preconditions_label__",
                  "order" : 4
               },
               "time" : {
                  "helper" : "__time_helper__",
                  "items" : {
                     "fields" : {
                        "dayofweek" : {
                           "label" : "__dayofweek_label__",
                           "optionLabels" : [
                              "__dayofweek_0__",
                              "__dayofweek_1__",
                              "__dayofweek_2__",
                              "__dayofweek_3__",
                              "__dayofweek_4__",
                              "__dayofweek_5__",
                              "__dayofweek_6__"
                           ],
                           "type" : "checkbox"
                        },
                        "timeFrom" : {
                           "dateFormat" : "HH:mm",
                           "label" : "__time_from_label__",
                           "maskString" : "99:99",
                           "order" : 1,
                           "placeholder" : "__time_placeholder__",
                           "type" : "time"
                        },
                        "timeTo" : {
                           "dateFormat" : "HH:mm",
                           "label" : "__time_to_label__",
                           "maskString" : "99:99",
                           "order" : 2,
                           "placeholder" : "__time_placeholder__",
                           "type" : "time"
                        }
                     }
                  },
                  "label" : "__time_label__",
                  "order" : 3
               }
            },
            "helper" : "__preconditions_helper__",
            "label" : "__preconditions_label__",
            "order" : 3
         },
         "securitySensors" : {
            "fields" : {
               "item" : {
                  "datasource" : "namespaces",
                  "field" : "devices",
                  "optionLabels" : "namespaces:devices_sensorBinary:deviceName",
                  "type" : "select"
               }
            },
            "label" : "__security_sensors_label__",
            "order" : 1
         },
         "timeout" : {
            "helper" : "__timeout_helper__",
            "label" : "__timeout_label__",
            "order" : 4
         }
      }
   },
   "repository" : {
      "source" : "https://github.com/maros/Zway-MotionTrigger",
      "type" : "git"
   },
   "schema" : {
      "properties" : {
         "dimmer" : {
            "properties" : {
               "code" : {
                  "dependencies" : "mode",
                  "type" : "string"
               },
               "dynamic" : {
                  "dependencies" : "mode",
                  "properties" : {
                     "levelMax" : {
                        "maximum" : 100,
                        "minimum" : 0,
                        "required" : true,
                        "type" : "integer"
                     },
                     "levelMin" : {
                        "maximum" : 100,
                        "minimum" : 0,
                        "required" : true,
                        "type" : "integer"
                     },
                     "luminosityDevice" : {
                        "datasource" : "namespaces",
                        "enum" : "namespaces:devices_sensorMultilevel:deviceId",
                        "field" : "enum",
                        "required" : true
                     },
                     "luminosityMax" : {
                        "maximum" : 1000,
                        "minimum" : 0,
                        "required" : true,
                        "type" : "integer"
                     },
                     "luminosityMin" : {
                        "maximum" : 1000,
                        "minimum" : 0,
                        "required" : true,
                        "type" : "integer"
                     }
                  },
                  "type" : "object"
               },
               "mode" : {
                  "default" : "full",
                  "enum" : [
                     "full",
                     "static",
                     "code",
                     "dynamic"
                  ],
                  "required" : true,
                  "type" : "string"
               },
               "static" : {
                  "dependencies" : "mode",
                  "type" : "number"
               }
            },
            "type" : "object"
         },
         "lights" : {
            "items" : {
               "datasource" : "namespaces",
               "enum" : "namespaces:devices_switchBinary:deviceId,namespaces:devices_switchMultilevel:deviceId",
               "field" : "enum",
               "required" : true
            },
            "minItems" : 1,
            "type" : "array",
            "uniqueItems" : true
         },
         "pollSensors" : {
            "type" : "integer"
         },
         "preconditions" : {
            "properties" : {
               "binary" : {
                  "items" : {
                     "properties" : {
                        "device" : {
                           "datasource" : "namespaces",
                           "enum" : "namespaces:devices_sensorBinary:deviceId,namespaces:devices_switchBinary:deviceId",
                           "field" : "enum",
                           "required" : true
                        },
                        "value" : {
                           "default" : "on",
                           "enum" : [
                              "off",
                              "on"
                           ],
                           "required" : true,
                           "type" : "string"
                        }
                     },
                     "type" : "object"
                  },
                  "type" : "array"
               },
               "multilevel" : {
                  "items" : {
                     "properties" : {
                        "device" : {
                           "datasource" : "namespaces",
                           "enum" : "namespaces:devices_sensorMultilevel:deviceId,namespaces:devices_switchMultilevel:deviceId,namespaces:devices_battery:deviceId",
                           "field" : "enum",
                           "required" : true
                        },
                        "operator" : {
                           "enum" : [
                              "=",
                              "!=",
                              ">",
                              ">=",
                              "<",
                              "<="
                           ],
                           "required" : true,
                           "type" : "string"
                        },
                        "value" : {
                           "required" : true,
                           "type" : "number"
                        }
                     },
                     "type" : "object"
                  },
                  "type" : "array"
               },
               "recheck" : {
                  "required" : true,
                  "type" : "boolean"
               },
               "time" : {
                  "items" : {
                     "properties" : {
                        "dayofweek" : {
                           "enum" : [
                              "0",
                              "1",
                              "2",
                              "3",
                              "4",
                              "5",
                              "6"
                           ],
                           "type" : "array"
                        },
                        "timeFrom" : {
                           "format" : "time",
                           "required" : true,
                           "type" : "string"
                        },
                        "timeTo" : {
                           "format" : "time",
                           "required" : true,
                           "type" : "string"
                        }
                     },
                     "type" : "object"
                  },
                  "type" : "array"
               }
            },
            "required" : true,
            "type" : "object"
         },
         "securitySensors" : {
            "items" : {
               "datasource" : "namespaces",
               "enum" : "namespaces:devices_sensorBinary:deviceId",
               "field" : "enum",
               "required" : true
            },
            "minItems" : 1,
            "type" : "array",
            "uniqueItems" : true
         },
         "timeout" : {
            "minimum" : 1,
            "required" : true,
            "type" : "integer"
         }
      },
      "required" : true,
      "type" : "object"
   },
   "singleton" : false,
   "version" : "1.08"
}