{
    "schema": "devcap1.schema.json",
    "doc:path": "tuya/rh3040_motion_sensor.md",
    "doc:hdr": "Motion sensor RH3040",
    "manufacturername": ["TUYATEC-zn9wyqtr", "TUYATEC-lakq7nse", "TUYATEC-53o41joc"],
    "modelid": ["RH3040", "RH3040", "RH3040"],
    "vendor": "$MF_TUYA",
    "product": "Motion Sensor RH3040",
    "status": "Gold",
    "supportsMgmtBind": true,
    "subdevices": [
        {
            "type": "$TYPE_PRESENCE_SENSOR",
            "restapi": "/sensors",
            "uuid": [ "$address.ext", "0x01", "0x0500"],
            "fingerprint": { "profile": "0x0104", "device": "0x0402", "endpoint": "0x01", "in": ["0x0001", "0x0500"] },
            "items": [
                {
                    "name": "attr/id"
                },
                {
                    "name": "attr/manufacturername"
                },
                {
                    "name": "attr/modelid"
                },
                {
                    "name": "attr/name"
                },
                {
                  "name": "attr/swversion",
                  "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
                  "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
                },
                {
                    "name": "attr/type"
                },
                {
                    "name": "attr/uniqueid"
                },
                {
                    "name": "attr/lastseen"
                },
                {
                    "name": "config/battery",
                    "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val"},
                    "awake": true
                },
                {
                    "name": "config/duration",
                    "default": 120
                },
                {
                    "name": "config/enrolled"
                },
                {
                    "name": "config/on"
                },
                {
                    "name": "config/pending"
                },
                {
                    "name": "config/reachable"
                },
                {
                    "name": "state/presence",
                    "awake": true
                },
                {
                    "name": "state/lowbattery"
                },
                {
                    "name": "state/tampered"
                },
                {
                    "name": "state/lastupdated"
                }
            ],
            "example": {
                "config": {
                    "battery": 75,
                    "duration": 120,
                    "on": true,
                    "pending": [],
                    "reachable": true
                },
                "lastseen": "2020-12-29T14:47Z",
                "manufacturername": "TUYATEC-lakq7nse",
                "modelid": "RH3040",
                "name": "Presence 68",
                "state": {
                    "lastupdated": "2020-12-29T14:47:19.022",
                    "lowbattery": false,
                    "presence": true,
                    "tampered": false
                },
                "type": "ZHAPresence",
                "swversion": "1.0.3",
                "uniqueid": "14:b4:57:ff:fe:15:66:fc-01-0500"
            }
        }
    ]
}