[ST Edge/Beta] Xiaomi/Aqara zigbee door sensor driver

These are the logs from the current driver that I am using. I did not know how to capture these logs when I had your driver installed. I can try to install your driver again and try my luck by swapping the drivers. Otherwise it is very painfully frustrating to unlink and relink the aqara sensor. I am still getting familiar with this new ‘edge’. So, apologies if I am not being helpful

2021-11-24T04:53:35.549742449+00:00 DEBUG Xiaomi Sensors Xiaomi Contact device thread event handled
2021-11-24T04:53:47.815593242+00:00 TRACE Xiaomi Sensors Received event with handler zigbee

2021-11-24T04:53:47.821197159+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Xiaomi Contact)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xA97F, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFE, rssi: -62, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x1E, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: true > > > >

2021-11-24T04:53:47.830343784+00:00 TRACE Xiaomi Sensors Found ZigbeeMessageDispatcher handler in xiaomi-devices
2021-11-24T04:53:47.833277034+00:00 INFO Xiaomi Sensors Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff

2021-11-24T04:53:47.837097117+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Xiaomi Contact)> emitting event: {“component_id”:“main”,“attribute_id”:“contact”,“capability_id”:“contactSensor”,“state”:{“value”:“open”}}

2021-11-24T04:53:47.847727909+00:00 DEBUG Xiaomi Sensors Xiaomi Contact device thread event handled
2021-11-24T04:53:48.980470534+00:00 TRACE Xiaomi Sensors Received event with handler zigbee health poll
2021-11-24T04:53:49.289704243+00:00 TRACE Xiaomi Sensors Received event with handler zigbee

2021-11-24T04:53:49.294416118+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Xiaomi Contact)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xA97F, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xFE, rssi: -59, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x1F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: false > > > >

2021-11-24T04:53:49.303509243+00:00 TRACE Xiaomi Sensors Found ZigbeeMessageDispatcher handler in xiaomi-devices
2021-11-24T04:53:49.306456076+00:00 INFO Xiaomi Sensors Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff

2021-11-24T04:53:49.310314159+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Xiaomi Contact)> emitting event: {“component_id”:“main”,“attribute_id”:“contact”,“capability_id”:“contactSensor”,“state”:{“value”:“closed”}}

yes, just give it a try

1 Like

Yes, I try, and:

  • The good news is that the 7 aqara already in use continue to work.
  • The bad news is that the new aqara is seen as a thing and does not work.

If from the ide I change the DH, then it works, but this makes me understand that it is still not seen that with edge but with DH.

do you click “scan nearby” ? I got a “thing” when I selected device by type menu

yes I selected “search nearby” and after several attempts Thing appeared (in my previous post, the photo)
Now i try to delete and reinstall the driver, now find good, but not work. Only close, not change

@ygerlovin
Ok. So I was able to swap the hacked driver i was using with ‘Zigbee Sensors Edge Driver [YG]’
Worked fine. Took couple minutes to repopulate the fields (RSSI, LQI) on device page in app.Thank you very much.

Battery and temperature are not working but I dont really care about them much.

2021-11-24T23:08:19.916929447+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Entrance Door)> emitting event: {“capability_id”:“contactSensor”,“component_id”:“main”,“state”:{“value”:“closed”},“attribute_id”:“contact”}
2021-11-24T23:08:19.928376655+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Entrance Door)> emitting event: {“capability_id”:“battery”,“component_id”:“main”,“state”:{“value”:0},“attribute_id”:“battery”}
2021-11-24T23:08:19.942323280+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Entrance Door)> emitting event: {“capability_id”:“voltageMeasurement”,“component_id”:“main”,“state”:{“value”:0.0,“unit”:“V”},“attribute_id”:“voltage”}

But with my other driver I had this was the log (I do not know the accuracy of the calculated value though
2021-11-24T21:22:46.759229596+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Entrance Door)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xA97F, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Basic >, lqi: 0xFF, rssi: -45, body_length: 0x0026, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x1C, mfg_code: 0x115F, seqno: 0x49, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0xFF01, DataType: CharString, CharString: “\x01\x21\xB3\x0B\x03\x28\x19\x04\x21\xA8\x13\x05\x21\x50\x00\x06\x24\x01\x00\x00\x00\x00\x0A\x21\x00\x00\x64\x10\x00” > > > >

2021-11-24T21:22:46.768295679+00:00 TRACE Xiaomi Sensors Found ZigbeeMessageDispatcher handler in xiaomi-devices
2021-11-24T21:22:46.771424929+00:00 INFO Xiaomi Sensors Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: 0xFF01

2021-11-24T21:22:46.776277679+00:00 INFO Xiaomi Sensors <ZigbeeDevice: 739b91ab-ebb5-4f58-be16-b471e03edffc [0xA97F] (Entrance Door)> emitting event: {“attribute_id”:“battery”,“capability_id”:“battery”,“component_id”:“main”,“state”:{“value”:99}}

@blitz79 ,
Aqara sensors reports battery once in a hour or so. You already should see the values for battery voltage and percentage with my driver.
Please let me know if this is not the case.

Regarding the logs from the other driver, it seems the device reports 0xBB3 for voltage, which means 2.995 V. The driver translates it to 99% which looks accurate. So another driver works fine as well.
The second log contain values for LQI/RSSI, which are excellent. The messages should not be lost with such strong network, so I’m puzzled why it didn’t work in the beginning.

Perhaps the issue is that you installed 2 different drivers that can handle the same device type. While it should theoretically be fine, I never tested how my driver behaves when installed on the hub with another driver.

@Diegocampy
Please let me see if I understand you correctly.
You currently have DTH installed with 7 sensors and you want to try a new sensor with edge driver. So you installed the edge driver and tried to pair the new device, but it was found as a ‘Thing’?
Did I get you right?

Wow. I did not know that. Thank you. It works. I see the battery 99%. Surprised it is as good compared to the Visonic ones that keep draining frequently. Also shows voltage 2.995V. The icon has also updated to show it as open/close sensor instead of a generic one that I had.

I guess you can edit your OP to remove ‘not tested’ against MCCGQ11LM…

1 Like

@ygerlovin 436 / 5000

therefore, I did like this: first I got confused and I was using the Drive recommended by @blitz79 Zach’s Edge Drivers but maybe I didn’t quite understand what to do, I just installed it and then looked for a new device. In this way it was detected with Things.


Then I deleted everything (device and drive) and installed the drives mentioned in this post Yakov’s SmartThings Edge Drivers (Beta) and now I see the door opening sensor correctly, but nothing works, neither opening, nor battery nor voltage.

Surely I did something wrong, but I didn’t understand what

@Diegocampy
What sensor model do you have, is it MCCGQ14LM?
Could you please provide logs?
When you open/close sensor, do you see LQI/RSSI fields updated?

Yes, i think is MCCGQ14LM (aqara motion sensor buy on aliexpress. The photos that are online of this code are exactly what I have) .
I don’t know how to see and save an edge device log. I don’t think I have to look on the IDE, this aqara sensor never appears in the ide live log.
When I open and close, absolutely nothing changes from the app.

@ygerlovin
Yes still having issue with the icon, dont know if you did any modification , but the version of the driver did’nt change
Thank you

Try to reboot your hub, it did that to me and i had to reboot the hub.

1 Like

Yes! Thank you! Now work fine!

1 Like

@Sylvain
I’m happy that the problem is solved.
However, if hub reboot was required, that probably means that different drivers might have side effects on each other.
This is very unfortunate.
During development of this driver I didn’t need to reboot the hub even once

@ygerlovin

Im still having probleme with the icon ,and the driver did’nt change since you ask me to verify the icon.

The hub reboot was to help @Diegocampy with is probleme.

@Sylvain
I’m trying to reproduce the issue with the icons you have.
I moved the sensor several times between the rooms and also checking regularly whether the icon has been changed. So far, nothing.
Are you on Android?
Have you tried to clean the app’s cache perhaps?
I’m thinking that perhaps there are some unexpected interactions between different drivers that are using similar device profiles.
I only have my own drivers installed, I do not use drivers, developed by others.
Perhaps I should install some and see how it goes.
What edge drivers are you using?

@ygerlovin
I have a lots of driver instelled. I will try to do a clean up and clear cache , but i think i already clear the cache …

@Sylvain
Do you have drivers for Aqara contact sensor?
Do you use different drivers for the same sensor type?