{
  "schema": "devcap1.schema.json",
  "manufacturername": "$MF_LUMI",
  "modelid": "lumi.airmonitor.acn01",
  "vendor": "Xiaomi",
  "product": "Aqara TVOC Air Quality Monitor VOCKQJK11LM",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_TEMPERATURE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0402"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0302",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0402",
          "0xFCC0"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid",
          "awake": true
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x18",
            "eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x01",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/battery_bis",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0001",
            "at": "0x0020",
            "script": "0001_battery.js"
          }
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/temperature"
        },
        {
          "name": "state/temperature_bis",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x64",
            "eval": "R.item('state/temperature').val = Attr.val + R.item('config/offset').val"
          }
        }
      ]
    },
    {
      "type": "$TYPE_HUMIDITY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0405"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0302",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0405",
          "0xFCC0"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid",
          "awake": true
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x18",
            "eval": "item.val = '0.0.0_' + ('0000' + (val & 0xFF).toString()).slice(-4)"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x01",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/battery_bis",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0001",
            "at": "0x0020",
            "script": "0001_battery.js"
          }
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/humidity"
        },
        {
          "name": "state/humidity_bis",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x65",
            "eval": "R.item('state/humidiy').val = Attr.val + R.item('config/offset').val"
          }
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "$TYPE_AIR_QUALITY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x000c"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0302",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x000C"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid",
          "awake": true
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x18",
            "eval": "item.val = '0.0.0_' + ('0000' + (val & 0xFF).toString()).slice(-4)"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x01",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/battery_bis",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0001",
            "at": "0x0020",
            "script": "0001_battery.js"
          }
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/airqualityppb",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x000c",
            "at": "0x0055",
            "eval": "Item.val = Attr.val"
          }
        },
        {
          "name": "state/airqualityppb_bis",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x66",
            "eval": "R.item('state/airqualityppb').val = Attr.val"
          }
        },
        {
          "name": "state/airquality",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x0129",
            "eval": "Item.val = ['excellent', 'good', 'moderate', 'poor', 'unhealthy'][Attr.val - 1]"
          }
        },
        {
          "name": "state/airquality_bis",
          "awake": true,
          "parse": {
            "fn": "xiaomi:special",
            "mf": "0x115F",
            "at": "0x00F7",
            "idx": "0x67",
            "eval": "R.item('state/airquality').val = ['excellent', 'good', 'moderate', 'poor', 'unhealthy'][Attr.val - 1]"
          }
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}
