zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Help request for new device Xiaomi Aqara E1 door & window contact sensor

Open sabamimi opened this issue 5 years ago • 223 comments

I tried to copy the existing MCCGQ12LM definition since MCCGQ14LM seems to be a new version of the MCCGQ12LM device the code i tried was:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access;

const definition = { zigbeeModel: ['lumi.magnet.acn001'], model: 'MCCGQ14LM', vendor: 'Xiaomi', description: 'Aqara E1 door & window contact sensor', fromZigbee: [fz.ias_contact_alarm_1, fz.battery], toZigbee: [], meta: {battery: {voltageToPercentage: '3V_2100'}}, exposes: [e.contact(), e.battery()] }

module.exports = definition;


the result was

  • no error during startup
  • Device recognized correctly during pairing
  • BUT no contact ON /OFF detected

later on I have found this chinese web page that seems to reflect the zigbee parameters of this device....but I don't know how to use this information ....

Information about the device + link

https://home.miot-spec.com/spec/lumi.magnet.acn001#srv-4

data/database.db entry of the device

.. (I am not really sure what is requested here

Thank you for help, guidance and "mercy" since this is my first attempt .....

sabamimi avatar Oct 22 '21 13:10 sabamimi

After searching a little more, I have found the following in the database.db; {"id":19,"type":"EndDevice","ieeeAddr":"0x54ef44100027f9de","nwkAddr":18255,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.magnet.acn001","epList":[1],"endpoints":{"1":{"epId":1,"inClusterList":[],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"appVersion":4,"modelId":"lumi.magnet.acn001"}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":4,"interviewCompleted":true,"meta":{},"lastSeen":1634898624897}

sabamimi avatar Oct 22 '21 13:10 sabamimi

The same here. Only link quality will be sent. :(

hexenmeister avatar Oct 23 '21 18:10 hexenmeister

The same issue here. Here is an topic from deconz, giving more details regarding this new sensor. But also didnt know how to use it. https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5403?fbclid=IwAR0-lIWVo2Q9MWBabbYOGgUEJoKmlNbhUgNOLxBqt5vuhCVG7DLxICdo3L8

pprzybyl avatar Oct 23 '21 19:10 pprzybyl

Yes, I forgot to mention that I am getting only the Link Quality. ( like hexenmeister)

sabamimi avatar Oct 24 '21 07:10 sabamimi

Log

Zigbee2MQTT:warn  2021-10-24 18:14:40: Received message from unsupported device with Zigbee model 'lumi.magnet.acn001' and manufacturer name 'LUMI',
Zigbee2MQTT:warn  2021-10-24 18:14:40: Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.

i think the file looks like:

MCCGQ14LM.js

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.magnet.acn001'], 
    model: 'MCCGQ14LM',
    vendor: 'Xiaomi',
    description: 'Aqara door & window contact sensor',
    fromZigbee: [], 
    toZigbee: [], 
    exposes: [e.battery(), e.contact(), e.linkquality(), e.temperature(), e.voltage()], 
};

module.exports = definition;

but i can't create in the directory to my Docker container (write protectet) i hope i can help and i get an update soon ;)

Armageddit avatar Oct 24 '21 18:10 Armageddit

Log

Zigbee2MQTT:warn  2021-10-24 18:14:40: Received message from unsupported device with Zigbee model 'lumi.magnet.acn001' and manufacturer name 'LUMI',
Zigbee2MQTT:warn  2021-10-24 18:14:40: Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.

i think the file looks like:

MCCGQ14LM.js

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.magnet.acn001'], 
    model: 'MCCGQ14LM',
    vendor: 'Xiaomi',
    description: 'Aqara door & window contact sensor',
    fromZigbee: [], 
    toZigbee: [], 
    exposes: [e.battery(), e.contact(), e.linkquality(), e.temperature(), e.voltage()], 
};

module.exports = definition;

but i can't create in the directory to my Docker container (write protectet) i hope i can help and i get an update soon ;)

I did try your file ...but no improvement ! device recognized but nothing in the log file when I "open the window" :-)

sabamimi avatar Oct 24 '21 18:10 sabamimi

what says the debug log? when u open? or close?

now we are at point 3 -> https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

Armageddit avatar Oct 24 '21 18:10 Armageddit

unfortunately, nothing moves in the log when I open / close

sabamimi avatar Oct 24 '21 19:10 sabamimi

is the log set to debug?

Armageddit avatar Oct 24 '21 19:10 Armageddit

Yes

sabamimi avatar Oct 24 '21 19:10 sabamimi

and if u push the litle button? or repair?

Armageddit avatar Oct 24 '21 19:10 Armageddit

I did delete the device and re-pair after using your file + restart MQTT

sabamimi avatar Oct 24 '21 19:10 sabamimi

If i single click (device is paired) i am getting the following:

Oct 24 21:12:31 nodered npm[23232]: Zigbee2MQTT:debug 2021-10-24 21:12:31: Received Zigbee message from '0x54ef44100027f9de', type 'attributeReport', cluster 'genBasic', data '{"modelId":"lumi.magnet.acn001"}' from endpoint 1 with groupID 0

sabamimi avatar Oct 24 '21 19:10 sabamimi

make sure you keep the small strokes together

Armageddit avatar Oct 24 '21 19:10 Armageddit

no difference

sabamimi avatar Oct 24 '21 19:10 sabamimi

did you look at the chinese URL ?

image

sabamimi avatar Oct 24 '21 19:10 sabamimi

when i hold them together i hear a soft click extremely quiet when pulling apart a louder click

its my first time adding last time some one was faster

we need a massage to translate

Armageddit avatar Oct 24 '21 19:10 Armageddit

I can hear the same (very quiet) click, now that you mentioned it but only when pulling apart ....at least we know the device is working OK....

sabamimi avatar Oct 24 '21 19:10 sabamimi

i am trying to find the file for the old version:MCCGQ11LM

and hope we can copy and paste :D

Armageddit avatar Oct 24 '21 19:10 Armageddit

hi guys, take a look here https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5403#issuecomment-950383030

alfakenzo avatar Oct 24 '21 20:10 alfakenzo