{
  "schema": "devcap1.schema.json",
  "manufacturername": "Develco Products A/S",
  "modelid": "SPLZB-131",
  "vendor": "Develco Products",
  "product": "SPLZB-131 smart plug (Schuko)",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SMART_PLUG",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "refresh.interval": 84000,
          "read": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015"
          },
          "parse": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015",
            "script": "develco_firmware.js"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "description": "The currently active alert effect.",
          "default": "none"
        },
        {
          "name": "state/on",
          "refresh.interval": 360
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_POWER_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x02",
        "0x0b04"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0051",
        "endpoint": "0x02",
        "in": [
          "0x0B04"
        ],
        "out": [
          "0x0019",
          "0x000A"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "refresh.interval": 84000,
          "read": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015"
          },
          "parse": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015",
            "script": "develco_firmware.js"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/current",
          "refresh.interval": 360
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "refresh.interval": 360
        },
        {
          "name": "state/voltage",
          "refresh.interval": 360,
          "parse": {
            "at": "0x0505",
            "cl": "0x0b04",
            "ep": 2,
            "eval": "Item.val = Math.round(Attr.val / 100);",
            "fn": "zcl:attr"
          }
        }
      ]
    },
    {
      "type": "$TYPE_CONSUMPTION_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x02",
        "0x0702"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0051",
        "endpoint": "0x02",
        "in": [
          "0x0702"
        ],
        "out": [
          "0x0019",
          "0x000A"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "refresh.interval": 84000,
          "read": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015"
          },
          "parse": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 2,
            "fn": "zcl:attr",
            "mf": "0x1015",
            "script": "develco_firmware.js"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/consumption",
          "refresh.interval": 360
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "refresh.interval": 360,
          "read": {
            "at": "0x0400", 
            "cl": "0x0702", 
            "ep": 2,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0400",
            "cl": "0x0702",
            "ep": 2,
            "eval": "if (Attr.val != -16777215 && Attr.val != 16777215) { Item.val = Attr.val; }",
            "fn": "zcl:attr"
          },
          "default": 0
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 2,
      "dst.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 2,
      "dst.ep": 1,
      "cl": "0x0B04",
      "report": [
        {
          "at": "0x050B",
          "dt": "0x29",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        },
        {
          "at": "0x0505",
          "dt": "0x21",
          "min": 1,
          "max": 300,
          "change": "0x00000064"
        },
        {
          "at": "0x0508",
          "dt": "0x21",
          "min": 1,
          "max": 300,
          "change": "0x00000064"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 2,
      "dst.ep": 1,
      "cl": "0x0702",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x25",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        },
        {
          "at": "0x0400",
          "dt": "0x2A",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        }
      ]
    }
  ]
}