{
    "schema": "devcap1.schema.json",
    "manufacturername": "$MF_SAMJIN",
    "modelid": "multi",
    "product": "Multipurpose Sensor (IM6001-OTP01)",
    "status": "Gold",
    "subdevices": [
        {
            "type": "$TYPE_OPEN_CLOSE_SENSOR",
            "restapi": "/sensors",
            "uuid": [ "$address.ext", "0x01", "0x0500"],
            "fingerprint": { "profile": "0x0104", "device": "0x0402", "endpoint": "0x01", "in": ["0x0001", "0x0500"] },
            "items": [
                {
                    "name": "config/checkin",
                    "default": 480
                },
                {
                    "name": "attr/lastseen"
                },
                {
                    "name": "attr/manufacturername"
                },
                {
                    "name": "attr/modelid"
                },
                {
                    "name": "attr/name"
                },
                {
                    "name": "attr/swversion",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "eval": "Item.val = Attr.val"},
                    "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"},
                    "refresh.interval": 84000
                },
                {
                    "name": "attr/type"
                },
                {
                    "name": "attr/uniqueid"
                },
                {
                    "name": "config/battery",
                    "awake": true,
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"},
                    "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021"},
                    "refresh.interval": 3660
                },
                {
                    "name": "config/on"
                },
                {
                    "name": "config/pending",
                    "public": false
                },
                {
                    "name": "config/enrolled"
                },
                {
                    "name": "config/reachable"
                },
                {
                    "name": "state/lastupdated"
                },
                {
                    "name": "state/open"
                }
            ]
        },
        {
            "type": "$TYPE_TEMPERATURE_SENSOR",
            "restapi": "/sensors",
            "uuid": [ "$address.ext", "0x01", "0x0402"],
            "fingerprint": { "profile": "0x0104", "device": "0x0402", "endpoint": "0x01", "in": ["0x0001", "0x0402"] },
            "items": [
                {
                    "name": "attr/lastseen"
                },
                {
                    "name": "attr/manufacturername"
                },
                {
                    "name": "attr/modelid"
                },
                {
                    "name": "attr/name"
                },
                {
                    "name": "attr/swversion",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "eval": "Item.val = Attr.val"},
                    "read": {"fn": "none"}
                },
                {
                    "name": "attr/type"
                },
                {
                    "name": "attr/uniqueid"
                },
                {
                    "name": "config/battery",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"},
                    "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021"},
                    "refresh.interval": 3660
                },
                {
                    "name": "config/offset"
                },
                {
                    "name": "config/on"
                },
                {
                    "name": "config/reachable"
                },
                {
                    "name": "state/lastupdated"
                },
                {
                    "name": "state/temperature"
                }
            ]
        },
        {
            "type": "$TYPE_VIBRATION_SENSOR",
            "restapi": "/sensors",
            "uuid": [ "$address.ext", "0x01", "0xfc02"],
            "fingerprint": { "profile": "0x0104", "device": "0x0402", "endpoint": "0x01", "in": ["0x0001", "0xfc02"] },
            "items": [
                {
                    "name": "attr/lastseen"
                },
                {
                    "name": "attr/manufacturername"
                },
                {
                    "name": "attr/modelid"
                },
                {
                    "name": "attr/name"
                },
                {
                    "name": "attr/swversion",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "eval": "Item.val = Attr.val"},
                    "read": {"fn": "none"}
                },
                {
                    "name": "attr/type"
                },
                {
                    "name": "attr/uniqueid"
                },
                {
                    "name": "config/battery",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"},
                    "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021"},
                    "refresh.interval": 3660
                },
                {
                    "name": "config/on"
                },
                {
                    "name": "config/reachable"
                },
                {
                    "name": "state/orientation_x",
                    "public": true,
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0xfc02", "at": "0x0012", "mf": "0x1241", "eval": "Item.val = Attr.val"}
                },
                {
                    "name": "state/orientation_y",
                    "public": true,
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0xfc02", "at": "0x0013", "mf": "0x1241", "eval": "Item.val = Attr.val"}
                },
                {
                    "name": "state/orientation_z",
                    "public": true,
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0xfc02", "at": "0x0014", "mf": "0x1241", "eval": "Item.val = Attr.val"}
                },
                {
                    "name": "state/lastupdated"
                },
                {
                    "name": "state/vibration",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0xfc02", "at": "0x0010", "mf": "0x1241", "eval": "Item.val = Attr.val === 1"}
                }
            ]
        }
    ],
    "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 1800,
          "max": 3600,
          "change": "0x01"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0402",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x29",
          "min": 10,
          "max": 300,
          "change": "0x0014"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0xfc02",
      "report": [
        {
          "at": "0x0010",
          "dt": "0x18",
          "min": 5,
          "max": 3600,
          "mf": "0x1241"
        },
        {
          "at": "0x0012",
          "dt": "0x29",
          "min": 1,
          "max": 3600,
          "change": "0x0001",
          "mf": "0x1241"
        },
        {
          "at": "0x0013",
          "dt": "0x29",
          "min": 1,
          "max": 3600,
          "change": "0x0001",
          "mf": "0x1241"
        },
        {
          "at": "0x0014",
          "dt": "0x29",
          "min": 1,
          "max": 3600,
          "change": "0x0001",
          "mf": "0x1241"
        }
      ]
    }
  ]
}
