You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've purchased this device and would like it to be supported by Z2M. I've made some investigations and, hopefully, with some help, will be able to propose and publish a solution.
This device is the new version of the MFKZQ11LM but the code (device & converters) is not compatible. This new device seems to have the same functionnalities but now the documentation indicates that this device has 2 modes (action and scene).
The functionnalities expected: flip 90, flip 180, slide, fall, shake, rotation.
During my test (last Z2M dev version, on VM Debian 10), I was able to detect with Z2M: flip, fall, shake, rotation, the cube side which is up.
Here is the database definition: {"id":2,"type":"EndDevice","ieeeAddr":"0x54ef44100062dd66","nwkAddr":12598,"manufId":4447,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.remote.cagl02","epList":[1,2,3],"endpoints":{"1":{"profId":260,"epId":1,"devId":259,"inClusterList":[0,3,1,18,6],"outClusterList":[0,3,25],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.remote.cagl02","appVersion":25,"manufacturerName":"LUMI","powerSource":3,"zclVersion":3,"stackVersion":2,"hwVersion":1,"dateCode":"20220602","swBuildId":"2019\u0000www."}},"genPowerCfg":{"attributes":{"batteryVoltage":30}},"aqaraOpple":{"attributes":{"247":{"type":"Buffer","data":[1,33,245,11,3,40,25,4,33,168,19,5,33,221,0,6,36,15,0,0,0,0,8,33,25,1,10,33,0,0,12,32,1,102,32,3,103,32,1,104,33,168,0,151,33,9,0,152,33,1,0,153,33,0,0,154,33,4,0,155,32,1]}}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":259,"inClusterList":[18],"outClusterList":[18],"clusters":{"genMultistateInput":{"attributes":{"presentValue":2}},"aqaraOpple":{"attributes":{"329":0}}},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":259,"inClusterList":[12],"outClusterList":[12],"clusters":{"genAnalogInput":{"attributes":{"267":890,"329":3,"presentValue":108.85001373291016}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":25,"stackVersion":2,"hwVersion":1,"dateCode":"20220602","swBuildId":"2019\u0000www.","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1672871137679,"defaultSendRequestWhen":"immediate"}
Here are examples of message recieved in Z2M web front end in DEBUG mode:
Wake up: Received Zigbee message from 'Cube Aqara 2', type 'attributeReport', cluster 'genMultistateInput', data '{"presentValue":2}' from endpoint 2 with groupID null
Flip: Received Zigbee message from 'Cube Aqara 2', type 'attributeReport', cluster 'genMultistateInput', data '{"presentValue":1025}' from endpoint 2 with groupID null
Rotation: Received Zigbee message from 'Cube Aqara 2', type 'attributeReport', cluster 'genAnalogInput', data '{"267":500,"329":4,"presentValue":121.70999908447266}' from endpoint 3 with groupID null
Shake: Received Zigbee message from 'Cube Aqara 2', type 'attributeReport', cluster 'genMultistateInput', data '{"presentValue":0}' from endpoint 2 with groupID null
I've made the following changes:
/zigbee-herdsman-converters/device/xiaomi.js
MFCZQ12LM_action_multistate: {
cluster: 'genMultistateInput',
type: ['attributeReport', 'readResponse'],
options: [exposes.options.legacy()],
convert: (model, msg, publish, options, meta) => {
/*
Cube face = numbers on the cube itself:
- Face 1 = 'Aqara logo'
- Face 6 = Battery face
- Face f = Face with the f number of poin
attrId 329 (x) => Give the final face up
- The final face number is x+1
attrId 85 (y) => Give the action/movement
- y = 2 => Wake up
- y = 4 => Fall/Fly
- y = 0 => Shake
- y >= 1024 => Flip (90 or 180) to the face y-1023
Note: Don't know how to differentiate flip 90 or 180 (can be deduced from the previous face and the current one)
Note: Don't know how to detect slide (in such a case, attibId 85 is sent (no change) but not attrId 329
Note: Dont't know hot to detect a tap (in such case, attrId 85 is sent (no change) and attrId is sent (no change)
Note: After each movement, the sensor sent a last dedicated message indicating its final side. This event is captured in the part MFCZQ12LM_action_finalface (see below)
*/
const value_action = msg.data['presentValue'];
let result = null;
if (value_action === 0) result = {action: 'shake'};
else if (value_action === 2) result = {action: 'wakeup'};
else if (value_action === 4) result = {action: 'fall'};
else if (value_action >= 1024) result = {action: 'flip', side: value_action-1023};
if (result && !isLegacyEnabled(options)) {
delete result.to_side;
delete result.from_side;
}
if (value_action == null) {
delete result.side;
}
return result ? result : null;
},
},
MFCZQ12LM_action_analog: {
cluster: 'genAnalogInput',
type: ['attributeReport', 'readResponse'],
options: [exposes.options.legacy()],
convert: (model, msg, publish, options, meta) => {
/* This cluster is catched each time a rotation is detected.
2 informations are sent by the sensor:
- the rotation angle (positive is clockwise, negative if not)
- the concerned side (the side up)
Note: After each movement, the sensor sent a last dedicated message indicating its final side. This event is captured in the part MFCZQ12LM_action_finalface (see below)
*/
const value = msg.data['presentValue'];
const face = msg.data['329'];
const result = {
action: value < 0 ? 'rotate_left' : 'rotate_right',
angle: Math.floor(value * 100) / 100,
action_angle: Math.floor(value * 100) / 100,
side: face+1,
};
if (!isLegacyEnabled(options)) delete result.angle;
return result;
},
},
MFCZQ12LM_action_finalface: {
cluster: 'aqaraOpple',
type: ['attributeReport', 'readResponse'],
options: [exposes.options.legacy()],
convert: (model, msg, publish, options, meta) => {
/* This dedicated message is sent after any movement of the cube (flip, rotation, slide, etc...)
It contains the final side (up) of the cube after the movement
*/
const face = msg.data['329'];
const result = {
//action: 'finalface',
side: face+1,
};
if (!isLegacyEnabled(options)) delete result.angle;
return result;
},
},
MFCZQ12LM_action_multistate is called when the cube is moved.
MFCZQ12LM_action_analog is called when the cube is rotated.
MFCZQ12LM_action_finalface is called after any move of the cube and provide, in a dedicated message, the final side (up) of the cube.
Testing with deCONZ offers more information (starting side and final side, slide, etc...). Curiously, the RAW data coming from this device are different between deCONZ (5001, 4003, 6006, etc...) and Z2M (1024 to 1026). I don't understand such a difference while zigbee-herdsman use deconz driver for using my Conbee. If I was able to retrieve the same infos as deCONZ (5001, 4003, 6006, etc...) in the genMultistateInput cluster, I would be able to detect all the Cube movements.
If someone can help me to progress, it will be really apreciated. Thank you.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I've purchased this device and would like it to be supported by Z2M. I've made some investigations and, hopefully, with some help, will be able to propose and publish a solution.
This device is the new version of the MFKZQ11LM but the code (device & converters) is not compatible. This new device seems to have the same functionnalities but now the documentation indicates that this device has 2 modes (action and scene).
The functionnalities expected: flip 90, flip 180, slide, fall, shake, rotation.
During my test (last Z2M dev version, on VM Debian 10), I was able to detect with Z2M: flip, fall, shake, rotation, the cube side which is up.
Here is the device: https://zigbee.blakadder.com/Aqara_MFCZQ12LM.html
Here is the database definition:
{"id":2,"type":"EndDevice","ieeeAddr":"0x54ef44100062dd66","nwkAddr":12598,"manufId":4447,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.remote.cagl02","epList":[1,2,3],"endpoints":{"1":{"profId":260,"epId":1,"devId":259,"inClusterList":[0,3,1,18,6],"outClusterList":[0,3,25],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.remote.cagl02","appVersion":25,"manufacturerName":"LUMI","powerSource":3,"zclVersion":3,"stackVersion":2,"hwVersion":1,"dateCode":"20220602","swBuildId":"2019\u0000www."}},"genPowerCfg":{"attributes":{"batteryVoltage":30}},"aqaraOpple":{"attributes":{"247":{"type":"Buffer","data":[1,33,245,11,3,40,25,4,33,168,19,5,33,221,0,6,36,15,0,0,0,0,8,33,25,1,10,33,0,0,12,32,1,102,32,3,103,32,1,104,33,168,0,151,33,9,0,152,33,1,0,153,33,0,0,154,33,4,0,155,32,1]}}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":259,"inClusterList":[18],"outClusterList":[18],"clusters":{"genMultistateInput":{"attributes":{"presentValue":2}},"aqaraOpple":{"attributes":{"329":0}}},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":259,"inClusterList":[12],"outClusterList":[12],"clusters":{"genAnalogInput":{"attributes":{"267":890,"329":3,"presentValue":108.85001373291016}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":25,"stackVersion":2,"hwVersion":1,"dateCode":"20220602","swBuildId":"2019\u0000www.","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1672871137679,"defaultSendRequestWhen":"immediate"}Here are examples of message recieved in Z2M web front end in DEBUG mode:
I've made the following changes:
/zigbee-herdsman-converters/device/xiaomi.js
/zigbee-herdsman-converters/converters/fromZigbee.js
MFCZQ12LM_action_multistate is called when the cube is moved.
MFCZQ12LM_action_analog is called when the cube is rotated.
MFCZQ12LM_action_finalface is called after any move of the cube and provide, in a dedicated message, the final side (up) of the cube.
Testing with deCONZ offers more information (starting side and final side, slide, etc...). Curiously, the RAW data coming from this device are different between deCONZ (5001, 4003, 6006, etc...) and Z2M (1024 to 1026). I don't understand such a difference while zigbee-herdsman use deconz driver for using my Conbee. If I was able to retrieve the same infos as deCONZ (5001, 4003, 6006, etc...) in the genMultistateInput cluster, I would be able to detect all the Cube movements.
If someone can help me to progress, it will be really apreciated. Thank you.
All reactions