Code : Tout sélectionner
{
"schema": "devcap1.schema.json",
"manufacturername": ["$MF_LUMI", "$MF_LUMI"],
"modelid": ["lumi.ctrl_ln2.aq1", "lumi.ctrl_ln2"],
"vendor": "Xiaomi",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_ON_OFF_LIGHT",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x01"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert"
},
{
"name": "state/on"
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_ON_OFF_LIGHT",
"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"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert"
},
{
"name": "state/on"
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_POWER_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x03",
"0x000C"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "config/temperature"
},
{
"name": "state/lastupdated"
},
{
"name": "state/power",
"refresh.interval": 100,
"read": {
"at": "0x0055",
"cl": "0x000C",
"ep": 3,
"fn": "zcl:attr"
},
"parse": {
"at": "0x0055",
"cl": "0x000C",
"ep": 3,
"eval": "Item.val = Math.round(Attr.val);"
}
}
]
},
{
"type": "$TYPE_SWITCH",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x05",
"0x0006"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/clickmode",
"refresh.interval": 86400,
"read": {
"at": "0xFF22",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr",
"mf": "0x115f"
},
"parse": {
"at": "0xFF22",
"cl": "0x0000",
"ep": 1,
"eval": "if (Attr.val == 0xFE) { Item.val = 'decoupled' } else if (Attr.val == 0x12) { Item.val = 'coupled' } else { Item.val = 'unknown' }",
"fn": "zcl:attr",
"mf": "0x115f"
},
"write": {
"at": "0xFF22",
"cl": "0x0000",
"dt": "0x20",
"ep": 1,
"eval": "if (Item.val == 'decoupled') { 0xFE } else if (Item.val == 'coupled') { 0x12 } else { 'unknown' }",
"fn": "zcl:attr",
"mf": "0x115f"
},
"values": [
["\"decoupled\"", "Decoupled Mode"],
["\"coupled\"", "Coupled Mode"]
],
"default": "coupled"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "config/temperature"
},
{
"name": "state/buttonevent"
},
{
"name": "state/lastupdated"
}
]
}
]
}
Il devrait gerer, les commande on/off, les retours boutons, et j'ai mis un ZHAPower sur un des endpoints en tests.
Par contre je n'ai fais aucun bind/report car avec Xiaomi en general ca sert a rien.
Si il les faut pour les commandes, tu pourras lancer des commandes mais tu n'auras pas de retour.
Si il les faut pour les retours boutons, state/buttonevent ne bougera pas.