[ST Edge/Beta] Xiaomi/Aqara/Tuya zigbee sensors driver

Overview

Supported devices

Brand        | Model        | Type                                | Fingerprint
---------------------------------------------------------------------------------------------
Xiaomi/Mijia | MCCGQ01LM    | Contact Sensor                      | LUMI/lumi.sensor_magnet
Xiaomi/Mijia | RTCGQ01LM    | Motion sensor                       | LUMI/lumi.sensor_motion
Aqara        | MCCGQ11LM    | Contact Sensor                      | LUMI/lumi.sensor_magnet.aq2
Aqara        | RTCGQ11LM    | Motion and Illuminance sensor       | LUMI/lumi.sensor_motion.aq2
Aqara        | RTCGQ14LM    | Motion and Illuminance sensor P1    | LUMI/lumi.motion.ac02
Aqara        | RTCGQ13LM    | High Precision Motion Sensor        | LUMI/lumi.motion.agl04
Aqara        | RTCZCGQ11LM  | Presence Detector FP1               | aqara/lumi.motion.ac01
Aqara        | DJT11LM      | Vibration Sensor                    | LUMI/lumi.vibration.aq1
Aqara        | DJT12LM      | Vibration Sensor T1                 | LUMI/lumi.vibration.agl01
Tuya         | QWS-001      | LCD Temperature and Humidity Sensor | _TZE200_bq5c8xfe/TS0601
Tuya         | CX-0726      | LCD Temperature and Humidity Sensor | _TZE200_qoy0ekbd/TS0601
Tuya         |              | Temperature and Humidity Sensor     | TUYATEC-yg5dcbfu/RH3052
Tuya         |              | Temperature and Humidity Sensor     | TUYATEC-v3uxbuxy/RH3052
Tuya         |              | Temperature and Humidity Sensor     | TUYATEC-gqhxixyk/RH3052
Tuya         |              | Temperature and Humidity Sensor     | _TZ3000_fllyghyj/TS0201

Invitation

Please install

Zigbee Sensors Edge Driver [YG] from the following channel

https://bestow-regional.api.smartthings.com/invite/8b2Ay0rKX2ve

Signal Strength

The devices, created by this driver will show Signal strength (LQI/RSSI) in detailed view.
Link Quality Indication (LQI) is a cumulative value used in multi-hop networks to assess the cost of a link.
Received Signal Strength (RSSI) is a measure of incoherent (raw) RF power in a channel.

The LQI will be shown as reported by the hub, without any transformation (i.e. will have 0-255 range).
Good values for strong network are above 150.

Similarly, RSSI values are not transformed.
RSSI value above -60 dbm (i.e -59 and higher) indicates a strong network.

For values below -70 dbm adding Zigbee repeaters should be considered.

Please refer to Microchip’s article for more details.

Battery voltage

Some devices report the battery voltage, instead of remaining battery (in %).
Whether supported by the device, Battery voltage measurement will be shown in the detailed view.

Pairing Xiaomi devices

Xiaomi sensors might have an issue paring.
Since those are sleepy devices, it is somethines required to wake them up during pairing.

  1. Put the hub into paring mode
  2. Long press a button on device until is starts blinking
  3. Release the button, wait for the device to stop blinking
  4. Short press button with the same time interval to prevent device going into sleeping mode

Note the led, press button only if the led is off.
It may take several attempts to successfully pair them.

Notes on Battery reporting

Aqara sensors reports battery once in a hour or so.
It is normal that you see battery 0% for up to 2 hours after pairing.
If the problem persists, please collect logs for at least 2 hours and provide them either in this post or as DM.

Notes on configuring sleepy devices

Sleeping devices need to be waken up during configuration. Otherwise, the configuration message might not be processed by the device and in most cases “Network error” would be shown.

To configure the device, press pairing button with 1 second or so interval immideately before and during configuration changes.

Notes on connectivity issues

Zigbee is a mesh network, devices connect to each other. Only some devices are connected directly to the hub. The devices that can recieve mesages from other devices and fowrward them further are called routers. More routers usually means stronger network.

Battery powered devices are always end devices (or sleepy devices), they do not forward messages.

Mesh network is constantly (but slowly) changing. That means the path from specific device to the hub (and back to the device) might change over the time. Even if you pair device near to hub, it is not guaranteed that the device would be connected directly to it. Further, even if the device was connected to the hub, after a while it can reconnect through diferent routers/repeaters, even though the hub seems to be closer.

There are multiple reasons for disconnected devices:

  • compatibility (some devices are using proprietary messages that are not recognized by routers or are just not fully compliant)

  • signal streangth (too far from repeaters or interference with other wireless networks, like WiFi)

  • loaded network (the number of messages exceed the throughtput of the network)

To help to troubleshoot connectivity issues, most, if not all devices have signal strength capability (see Signal Strength above)

Sleepy (battery powered) devices usually have weaker radio. If the signal strength is low, they might not work well, even if you have perfectly working modules/switches nearby.

Xiaomi/Aqara connectivity issues

Xiaomi/Aqara devices, especially sensors might be working in sticky parent mode. This means, they are not using automatic zigbee rerouting. Therefore, it is highly refommended to pair Aqara devices after all routers are in place and connected and to do it in the exact device location.

Notes on adding devices requests

If you want your device to be added to this driver, please provide

  • A fingerprint (model/manufacture) or at least the exact vendor name and model number (like Xiaomi MCCGQ01LM). This is absolutly a must. It is not sufficient to provide only a device picture. There are devices that look very much alike, but work quite different.

  • A link to product description (could be vendor’s site or even ebay/aliexpress, etc listing). This is needed to understand what capabilities are supported

  • If you have a link to DTH, it could also help

Please also be prepared to provide logs from CLI.



Devices

Contact Sensors

Please note, Aqara E1 MCCGQ14LM (lumi.magnet.acn001) sensor is not supported.

Name Mijia Door & Window Sensor Aqara Door & Window Sensor
Model MCCGQ01LM MCCGQ11LM
Image
Capabilities
  1. motionSensor
  2. illuminanceMeasurement
  3. battery
  4. battery voltage
  5. signalStrength
The same as for MCCGQ01LM
Battery CR1632 CR1632

In addition to contact sensor status and battery, the detailed view will show original (unmodified) battery voltage readings, received from the device and signal strength.

The driver allows to change icon for your contact sensor.

The supported icons are:

  • contact sensor (this is the default)
  • switch
  • lock
  • door bell
  • refrigerator

Motion Sensors

Name Mijia Human Body Sensor Aqara Motion and Illuminance Sensor
Model RTCGQ01LM RTCGQ11LM
Image
Capabilities
  1. motionSensor
  2. battery
  3. battery voltage
  4. signalStrength
  1. motionSensor
  2. illuminanceMeasurement
  3. battery
  4. battery voltage
  5. signalStrength
Settings
  1. No motion interval
  2. Signal Strength interval (min)
  1. No motion interval
  2. Signal Strength interval (min)
Battery CR2450 CR2450
Dimensions 30×30×33 mm
Notes
  • Max detection angle: 170 °
  • Distance: 7m
  • 5-Year Battery Life
    (depends on detection interval)


Name Aqara Motion and Illuminance Sensor P1 (MS-S02) Aqara High Precision Motion Sensor
Model RTCGQ14LM RTCGQ13LM
Image
Capabilities
  1. motionSensor
  2. illuminanceMeasurement
  3. Detection Sensitivity
    (low/medium/high)
  4. Detection Interval
  5. battery
  6. battery voltage
  7. signalStrength
  1. motionSensor
  2. Detection Sensitivity
    (low/medium/high)
  3. Detection Interval
  4. battery
  5. battery voltage
  6. signalStrength
Settings
  1. No motion interval
  2. Signal Strength interval (min)
  1. No motion interval
  2. Signal Strength interval (min)
Battery CR2450 CR2450
Dimensions 33.1×33.1×41.6 mm 74×74 ×43.3mm
Notes
  • Horizontal detection angle:
    170 ° (up to 2m )
    150 ° (up to 7m)
  • Distance: 7m
  • 5-Year Battery Life
    (depends on detection interval)
  • Detection angle: 60 ° conical
  • Distance: 5m
  • Detection interval: 2-180 seconds
  • Operating temperature: -10°C to +35°C

Usually, sleepy motion detectors are not checking motion constantly. Instead, they check motion, report if it was detected and go to sleep. If the motion is no longer detected, they do not report anything, they just go to sleep.

To clear motion, the driver schedules a timer, once motion is detected. It will fire after “no motion interval", unless another motion is detected during this period. This setting is also sometimes called cool down period.

Motion sensors have configurable (in settings) no motion interval.
After motion is detected, the sensor will go back to no motion after specified period of time,
unless a new motion is detected.

In addition, some devices, like RTCGQ14LM and RTCGQ13LM support configurable Detection interval. This is the time period the device waits before retrying to detect motion. This setting is configured on device itself. The minimal value depends on sensor’s firmware. The driver allows 0-255, but the device might reject the setting.



Presence Detectors

Name Aqara Presence Detector FP1
Model RTCZCGQ11LM
Image
Capabilities
  1. presenceSensor
  2. Presence Detection Status
    (enter/enter left/enter right/leave/leave left/leave right/approaching/absenting)
  3. Detection Sensitivity (low/medium/high)
  4. Monitored Approach Distance (far/medium/near)
  5. Sensor Monitoring Mode (undirected/left_right)
  6. Temperature (not tested)
  7. signalStrength
Not supported by driver
  1. power outage count
  2. reset nopresence status
Notes
  • Horizontal angle: 120°
  • Distance: 5m
  • Uses millimeter-wave radar to detect human presence
  • USB powered

Please also see

Vibration Sensors

Name Aqara Vibration Sensor Aqara Vibration Sensor T1
Model DJT11LM DJT12LM
Image
Capabilities
  1. accelerationSensor
  2. threeAxis
  3. battery
  4. voltageMeasurement
  5. signalStrength
  1. accelerationSensor
  2. battery
  3. voltageMeasurement
  4. signalStrength
Not supported by driver
  1. Automations are not available on threeAxis
  2. Event type (tilt/drop/vibration)
  3. Event strength
  4. Configurable sensor sensitivity (low/medium/high)
  1. Event type (tilt/touch/drop)
  2. Configurable sensor sensitivity (low/medium/high)
Battery CR2032 CR2032
Dimensions 36x36x9 mm 36×36×9 mm ?
Notes

Temperature and Humidity Sensor

(Since v1.2)




Tuya LCD Temperature and Humidity Sensor QWS-001 Tuya LCD Temperature and Humidity Sensor CX-0726 Tuya Temperature and Humidity Sensor RH3052

Supported capabilities:

  • temperatureMeasurement
  • relativeHumidityMeasurement
  • battery
  • signalStrength

Notes:

  • Temperature and Humidity Sensors allow changing profiles to select how the device is shown in dashboard. This option is available in settings.
    The supported options are
    • Temperature
    • Humidity
    • Multitile - the device will occupy 4 tiles and show all available info
  • QWS-001 and CX-0726 are using Tuya proprietary cluster EF00
  • RH3052 models are using standard reporting

Change log

v1.8.14

  1. Add support for Mijia Motion sensor RTCGQ01LM
  2. Add support for Vibration Sensor T1 DJT12LM
  3. Add support for Tuya Temperature and Humidity Sensor
    • TUYATEC-gqhxixyk/RH3052
    • _TZ3000_fllyghyj/TS0201

v1.8.0

  1. Add support for Aqara Vibration Sensor DJT11LM
  2. Rename “Presence Detection Sensitivity” to “Sensor Detection Sensitivity” for
    • Aqara High Precision Motion Sensor RTCGQ13LM
    • Aqara Motion and Illuminance sensor P1 RTCGQ14LM
    • Aqara Presence Detector FP1 RTCZCGQ11LM

Thanks to @montyfert for testing

v1.7.0

  1. Add support for Aqara High Precision Motion Sensor RTCGQ13LM
  2. Allow user to set signal strength update interval in setting for the following profiles:
    • Aqara Motion P1
    • Aqara High Precision Motion Sensor RTCGQ13LM
    • Aqara Presence Detector FP1 RTCZCGQ11LM
    • Aqara Contact Sensors

v1.6.2

Add support for Aqara Motion and Illuminance Sensor P1 (MS-S02)

v1.5.7

Add support for Aqara Presence Detector FP1

v1.4.3 2022-06-08T20:45:12.934280663

Fix an issue with Tuya sensosrs that ocasionally show zero values.

While Tuya sensors use proprietary messages to report the the attributes, some of them might also report incorrect (zero) values under standard clusters.
The fix ignores standard attribute reporting for devices that use proprietary messaging.

v1.4.1 2022-05-28T21:49:26.426404501Z

Allow changing dashboard tile for Tuya Temperature Humidity sensor
User can select

  • Temperature
  • Humidity
  • Multitile

v1.4 2022-05-27T19:20:47.838285380Z

Add support for Tuya Temperature Humidity sensor

  • TUYATEC-yg5dcbfu/RH3052
  • TUYATEC-v3uxbuxy/RH3052

v1.3 2022-05-16T21:16:58.594953

  1. Add support for Tuya Temperature Humidity sensor CX-0726

v1.2 2022-03-05T12:344:17.571490Z

  1. Add support for Tuya Temperature Humidity sensor QWS-001

v1.1 2021-12-10T20:01:20.394087

  1. Add support for Aqara Motion and Luminance sensor RTCGQ11LM
  2. Remove fingerprint for MCCGQ14LM contact sensor ( see Supporting new E1 Aqara devices for details)

Cheers,
Yakov

16 Likes

Hi Yakov,

Thank you for adding lumi.sensor_magnet.aq2 to the driver. I will test it later today and let you know if it works.

1 Like

@ygerlovin
Thank for your driver , i used it since one week and its working great .

Is it possible to add an option to change the icon.

I use those door sensor with some micro switch , solder wire inside the sensor , so i have put one micro switch on my patio door lock , so then it show me if the patio door is lock or unlock.
Or to trigger the mailbox door …

Thank you

1 Like

Thank you for the driver, lumi.sensor_magnet.aq2 is working fine.

I now got quite a few sensors to change from old DTH to the new edge driver :slightly_smiling_face:

@Sylvain ,
What icons do you need?
Also, I think in some forum it was mentioned that lumi.sensor_magnet.aq2 supports temperature measurement. Do you happen to know anything about it?

Great @JP3000 , thanks for the update

Hi, I don’t think it supports temperature.

No it does’nt support temperature.

Of course i would like to have to lock unlock icon and door bell .

Im not shure if the other icon is availlable in smarthings .
Freezer , mail box door open closed .

for my drivers, I regularly look into repo by Koenkk/zigbee-herdsman-converters/

it seems they use Xiaomi response for (rough) temperature readings

another useful resource is Xiaomi MCCGQ11LM control via MQTT | Zigbee2MQTT
I believe it’s a documentation for MQTT project

1 Like

@JP3000

Strange.
The log you provided
“\x01\x21\xC7\x0B \x03\x28\x1B \x04\x21\xA8\x01\x05\x21\x45\x06\x06\x24\x00\x00\x00\x00\x00\x0A\x21\xC4\x4A\x64\x10\x01”

I could bet x1B corresponds to 27 degrees Celcius ( 03 probably a temperature tag and 28 is uint8 type).
I think it is a temperature, just not officially supported. Perhaps due to reliability/precision issues.
Can’t think what else could it be, if not temperature

yes, \03 is definitely a temperature reading.

1 Like

The room temperature is around 20 degrees at the moment, when pairing the device it would report slightly higher as it can be in my hand.

I’m happy to send more logs if it helps.

@veonua ,
Thanks, even though I doubt 05/06 corresponds to LQI/RSSI for contact sensor, based on the logs I’ve seen
06 is 5 bytes long, seems unnecessary for LQI. Also, the values does not correlate to values, received on lower layer

Here are logs from two different door sensors, the first one is in a room where the temperature is 20c and the second one is in 14c room

┌───┬──────────────────────────────────────┬─────────────────────────────────┐
│ # │ Driver Id │ Name │
├───┼──────────────────────────────────────┼─────────────────────────────────┤
│ 1 │ 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 │ Virtual Devices V2 │
│ 2 │ efbe7be3-ab36-46eb-86e8-53ac056a1cec │ Zigbee Light Multifunction Mc │
│ 3 │ d620900d-f7bc-4ab5-a171-6dd159872f7d │ Zigbee Motion Sensor │
│ 4 │ 92f39ab3-7b2f-47ee-94a7-ba47c4ee8a47 │ Zigbee Power/Meter │
│ 5 │ 5ab64dc7-5d08-44a4-9806-5a5b823a18d2 │ Zigbee Sensors Edge Driver [YG] │
│ 6 │ b36f1d7a-1144-4a1d-bf8b-f7d69dee8909 │ Zigbee Switch Mc │
│ 7 │ 7fcf0d61-252d-4152-b001-a9901011acf5 │ Zigbee Temp Humidity Sensor Mc │
│ 8 │ f82dec82-e5fa-487f-8f0f-22c3e4a8bd89 │ Zigbee Water Leak Sensor │
└───┴──────────────────────────────────────┴─────────────────────────────────┘
? Select a driver. 5
2021-11-20T08:45:18.135227209+00:00 TRACE Zigbee Sensors Edge Driver [YG] Received event with handler zigbee
2021-11-20T08:45:18.141448376+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 35ed896f-0d16-4b5a-8054-662ff43a351a [0xA892] (LR window)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xA892, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Basic >, lqi: 0xD9, rssi: -56, body_length: 0x0040, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x1C, mfg_code: 0x115F, seqno: 0x53, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0005, DataType: CharString, ModelIdentifier: “lumi.sensor_magnet.aq2” >, < AttributeRecord || AttributeId: 0xFF01, DataType: CharString, CharString: “\x01\x21\x9F\x0B\x03\x28\x17\x04\x21\xA8\x33\x05\x21\x64\x00\x06\x24\x04\x00\x03\x00\x00\x0A\x21\xE4\xA1\x64\x10\x00” > > > >
2021-11-20T08:45:18.152593918+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘LR window’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:45:18.155921501+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘LR window’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:45:18.159649543+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘LR window’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:45:18.163010959+00:00 TRACE Zigbee Sensors Edge Driver [YG] Found ZigbeeMessageDispatcher handler in Zigbee sensors driver → Zigbee Xiaomi Contact Sensor
2021-11-20T08:45:18.166017543+00:00 INFO Zigbee Sensors Edge Driver [YG] Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: ModelIdentifier
2021-11-20T08:45:18.172837876+00:00 WARN Zigbee Sensors Edge Driver [YG] XiaomiContactSensor.model_id(){byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”} {address_header={cluster={byte_length=2, field_name=“cluster”, value=0}, dest_addr={byte_length=2, field_name=“dest_addr”, value=0}, dest_endpoint={byte_length=1, field_name=“dest_endpoint”, value=1}, profile={byte_length=2, field_name=“profile”, value=260}, src_addr={byte_length=2, field_name=“src_addr”, value=43154}, src_endpoint={byte_length=1, field_name=“src_endpoint”, value=1}}, body={zcl_body={attr_records={{attr_id={byte_length=2, value=5}, data={byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”}, data_type={byte_length=1, value=66}}, {attr_id={byte_length=2, value=65281}, data={byte_length=29, value="\x01\x21\x9F\x0B\x03\x28\x17\x04\x21\xA8\x33\x05\x21\x64\x00\x06\x24\x04\x00\x03\x00\x00\x0A\x21\xE4\xA1\x64\x10\x00"}, data_type={byte_length=1, value=66}}}}, zcl_header={cmd={byte_length=1, value=10}, frame_ctrl={byte_length=1, field_name=“frame_ctrl”, value=28}, mfg_code={byte_length=2, field_name=“mfg_code”, value=4447}, seqno={byte_length=1, field_name=“seqno”, value=83}}}, body_length={byte_length=2, field_name=“body_length”, value=64}, lqi={byte_length=1, field_name=“lqi”, value=217}, rssi={byte_length=1, field_name=“rssi”, value=-56}, type={byte_length=1, field_name=“type”, value=0}}: ‘LR window’ 35ed896f-0d16-4b5a-8054-662ff43a351a
2021-11-20T08:45:18.176744751+00:00 TRACE Zigbee Sensors Edge Driver [YG] Found ZigbeeMessageDispatcher handler in Zigbee sensors driver → Zigbee Xiaomi Contact Sensor
2021-11-20T08:45:18.179833126+00:00 INFO Zigbee Sensors Edge Driver [YG] Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: 0xFF01
2021-11-20T08:45:18.186851376+00:00 WARN Zigbee Sensors Edge Driver [YG] XiaomiContactSensor.report_ff01(){byte_length=29, value="\x01\x21\x9F\x0B\x03\x28\x17\x04\x21\xA8\x33\x05\x21\x64\x00\x06\x24\x04\x00\x03\x00\x00\x0A\x21\xE4\xA1\x64\x10\x00"} {address_header={cluster={byte_length=2, field_name=“cluster”, value=0}, dest_addr={byte_length=2, field_name=“dest_addr”, value=0}, dest_endpoint={byte_length=1, field_name=“dest_endpoint”, value=1}, profile={byte_length=2, field_name=“profile”, value=260}, src_addr={byte_length=2, field_name=“src_addr”, value=43154}, src_endpoint={byte_length=1, field_name=“src_endpoint”, value=1}}, body={zcl_body={attr_records={{attr_id={byte_length=2, value=5}, data={byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”}, data_type={byte_length=1, value=66}}, {attr_id={byte_length=2, value=65281}, data={byte_length=29, value="\x01\x21\x9F\x0B\x03\x28\x17\x04\x21\xA8\x33\x05\x21\x64\x00\x06\x24\x04\x00\x03\x00\x00\x0A\x21\xE4\xA1\x64\x10\x00"}, data_type={byte_length=1, value=66}}}}, zcl_header={cmd={byte_length=1, value=10}, frame_ctrl={byte_length=1, field_name=“frame_ctrl”, value=28}, mfg_code={byte_length=2, field_name=“mfg_code”, value=4447}, seqno={byte_length=1, field_name=“seqno”, value=83}}}, body_length={byte_length=2, field_name=“body_length”, value=64}, lqi={byte_length=1, field_name=“lqi”, value=217}, rssi={byte_length=1, field_name=“rssi”, value=-56}, type={byte_length=1, field_name=“type”, value=0}}: ‘LR window’ 35ed896f-0d16-4b5a-8054-662ff43a351a
2021-11-20T08:45:18.191183501+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x01 data_type=0x21 data=2975>
2021-11-20T08:45:18.194696209+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 35ed896f-0d16-4b5a-8054-662ff43a351a [0xA892] (LR window)> emitting event: {“attribute_id”:“battery”,“component_id”:“main”,“state”:{“value”:95},“capability_id”:“battery”}
2021-11-20T08:45:18.207699293+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 35ed896f-0d16-4b5a-8054-662ff43a351a [0xA892] (LR window)> emitting event: {“attribute_id”:“voltage”,“component_id”:“main”,“state”:{“value”:2.975,“unit”:“V”},“capability_id”:“voltageMeasurement”}
2021-11-20T08:45:18.219976168+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x03 data_type=0x28 data=23>
2021-11-20T08:45:18.224035043+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x04 data_type=0x21 data=13224>
2021-11-20T08:45:18.227387209+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x05 data_type=0x21 data=100>
2021-11-20T08:45:18.230930668+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x06 data_type=0x24 data=196612>
2021-11-20T08:45:18.234024626+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x0A data_type=0x21 data=41444>
2021-11-20T08:45:18.237534668+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x64 data_type=0x10 data=false>
2021-11-20T08:45:18.240916751+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 35ed896f-0d16-4b5a-8054-662ff43a351a [0xA892] (LR window)> emitting event: {“attribute_id”:“contact”,“component_id”:“main”,“state”:{“value”:“closed”},“capability_id”:“contactSensor”}
2021-11-20T08:45:18.251697334+00:00 DEBUG Zigbee Sensors Edge Driver [YG] Aqara Contact Sensor device thread event handled
listening for logs… done

┌───┬──────────────────────────────────────┬─────────────────────────────────┐
│ # │ Driver Id │ Name │
├───┼──────────────────────────────────────┼─────────────────────────────────┤
│ 1 │ 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 │ Virtual Devices V2 │
│ 2 │ efbe7be3-ab36-46eb-86e8-53ac056a1cec │ Zigbee Light Multifunction Mc │
│ 3 │ d620900d-f7bc-4ab5-a171-6dd159872f7d │ Zigbee Motion Sensor │
│ 4 │ 92f39ab3-7b2f-47ee-94a7-ba47c4ee8a47 │ Zigbee Power/Meter │
│ 5 │ 5ab64dc7-5d08-44a4-9806-5a5b823a18d2 │ Zigbee Sensors Edge Driver [YG] │
│ 6 │ b36f1d7a-1144-4a1d-bf8b-f7d69dee8909 │ Zigbee Switch Mc │
│ 7 │ 7fcf0d61-252d-4152-b001-a9901011acf5 │ Zigbee Temp Humidity Sensor Mc │
│ 8 │ f82dec82-e5fa-487f-8f0f-22c3e4a8bd89 │ Zigbee Water Leak Sensor │
└───┴──────────────────────────────────────┴─────────────────────────────────┘
? Select a driver. 5
2021-11-20T08:48:00.607386157+00:00 TRACE Zigbee Sensors Edge Driver [YG] Received event with handler zigbee
2021-11-20T08:48:00.647524282+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c [0xCAFA] (Garage Door 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xCAFA, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Basic >, lqi: 0xFD, rssi: -67, body_length: 0x0040, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x1C, mfg_code: 0x115F, seqno: 0x01, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0005, DataType: CharString, ModelIdentifier: “lumi.sensor_magnet.aq2” >, < AttributeRecord || AttributeId: 0xFF01, DataType: CharString, CharString: “\x01\x21\x7B\x0C\x03\x28\x15\x04\x21\xA8\x33\x05\x21\x1A\x00\x06\x24\x07\x00\x00\x00\x00\x0A\x21\xD2\xEE\x64\x10\x01” > > > >
2021-11-20T08:48:00.672924532+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘Garage Door 1’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:48:00.679361199+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘Garage Door 1’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:48:00.692984074+00:00 DEBUG Zigbee Sensors Edge Driver [YG] xiaomi_contact_can_handle(): true ‘Garage Door 1’ LUMI/lumi.sensor_magnet.aq2
2021-11-20T08:48:00.696286949+00:00 TRACE Zigbee Sensors Edge Driver [YG] Found ZigbeeMessageDispatcher handler in Zigbee sensors driver → Zigbee Xiaomi Contact Sensor
2021-11-20T08:48:00.700559616+00:00 INFO Zigbee Sensors Edge Driver [YG] Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: ModelIdentifier
2021-11-20T08:48:00.722531032+00:00 WARN Zigbee Sensors Edge Driver [YG] XiaomiContactSensor.model_id(){byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”} {address_header={cluster={byte_length=2, field_name=“cluster”, value=0}, dest_addr={byte_length=2, field_name=“dest_addr”, value=0}, dest_endpoint={byte_length=1, field_name=“dest_endpoint”, value=1}, profile={byte_length=2, field_name=“profile”, value=260}, src_addr={byte_length=2, field_name=“src_addr”, value=51962}, src_endpoint={byte_length=1, field_name=“src_endpoint”, value=1}}, body={zcl_body={attr_records={{attr_id={byte_length=2, value=5}, data={byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”}, data_type={byte_length=1, value=66}}, {attr_id={byte_length=2, value=65281}, data={byte_length=29, value="\x01\x21\x7B\x0C\x03\x28\x15\x04\x21\xA8\x33\x05\x21\x1A\x00\x06\x24\x07\x00\x00\x00\x00\x0A\x21\xD2\xEE\x64\x10\x01"}, data_type={byte_length=1, value=66}}}}, zcl_header={cmd={byte_length=1, value=10}, frame_ctrl={byte_length=1, field_name=“frame_ctrl”, value=28}, mfg_code={byte_length=2, field_name=“mfg_code”, value=4447}, seqno={byte_length=1, field_name=“seqno”, value=1}}}, body_length={byte_length=2, field_name=“body_length”, value=64}, lqi={byte_length=1, field_name=“lqi”, value=253}, rssi={byte_length=1, field_name=“rssi”, value=-67}, type={byte_length=1, field_name=“type”, value=0}}: ‘Garage Door 1’ 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c
2021-11-20T08:48:00.728459116+00:00 TRACE Zigbee Sensors Edge Driver [YG] Found ZigbeeMessageDispatcher handler in Zigbee sensors driver → Zigbee Xiaomi Contact Sensor
2021-11-20T08:48:00.734475907+00:00 INFO Zigbee Sensors Edge Driver [YG] Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: 0xFF01
2021-11-20T08:48:00.745368282+00:00 WARN Zigbee Sensors Edge Driver [YG] XiaomiContactSensor.report_ff01(){byte_length=29, value="\x01\x21\x7B\x0C\x03\x28\x15\x04\x21\xA8\x33\x05\x21\x1A\x00\x06\x24\x07\x00\x00\x00\x00\x0A\x21\xD2\xEE\x64\x10\x01"} {address_header={cluster={byte_length=2, field_name=“cluster”, value=0}, dest_addr={byte_length=2, field_name=“dest_addr”, value=0}, dest_endpoint={byte_length=1, field_name=“dest_endpoint”, value=1}, profile={byte_length=2, field_name=“profile”, value=260}, src_addr={byte_length=2, field_name=“src_addr”, value=51962}, src_endpoint={byte_length=1, field_name=“src_endpoint”, value=1}}, body={zcl_body={attr_records={{attr_id={byte_length=2, value=5}, data={byte_length=22, field_name=“ModelIdentifier”, value=“lumi.sensor_magnet.aq2”}, data_type={byte_length=1, value=66}}, {attr_id={byte_length=2, value=65281}, data={byte_length=29, value="\x01\x21\x7B\x0C\x03\x28\x15\x04\x21\xA8\x33\x05\x21\x1A\x00\x06\x24\x07\x00\x00\x00\x00\x0A\x21\xD2\xEE\x64\x10\x01"}, data_type={byte_length=1, value=66}}}}, zcl_header={cmd={byte_length=1, value=10}, frame_ctrl={byte_length=1, field_name=“frame_ctrl”, value=28}, mfg_code={byte_length=2, field_name=“mfg_code”, value=4447}, seqno={byte_length=1, field_name=“seqno”, value=1}}}, body_length={byte_length=2, field_name=“body_length”, value=64}, lqi={byte_length=1, field_name=“lqi”, value=253}, rssi={byte_length=1, field_name=“rssi”, value=-67}, type={byte_length=1, field_name=“type”, value=0}}: ‘Garage Door 1’ 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c
2021-11-20T08:48:00.759095782+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x01 data_type=0x21 data=3195>
2021-11-20T08:48:00.765721116+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c [0xCAFA] (Garage Door 1)> emitting event: {“attribute_id”:“battery”,“component_id”:“main”,“state”:{“value”:100},“capability_id”:“battery”}
2021-11-20T08:48:00.779057407+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c [0xCAFA] (Garage Door 1)> emitting event: {“attribute_id”:“voltage”,“component_id”:“main”,“state”:{“value”:3.195,“unit”:“V”},“capability_id”:“voltageMeasurement”}
2021-11-20T08:48:00.802142157+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x03 data_type=0x28 data=21>
2021-11-20T08:48:00.805578907+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x04 data_type=0x21 data=13224>
2021-11-20T08:48:00.811797616+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x05 data_type=0x21 data=26>
2021-11-20T08:48:00.814936574+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x06 data_type=0x24 data=7>
2021-11-20T08:48:00.820574407+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x0A data_type=0x21 data=61138>
2021-11-20T08:48:00.832823866+00:00 DEBUG Zigbee Sensors Edge Driver [YG] attr=<XiaomiAttributeRecord: attr_id=0x64 data_type=0x10 data=true>
2021-11-20T08:48:00.836476074+00:00 INFO Zigbee Sensors Edge Driver [YG] <ZigbeeDevice: 21c085e1-0124-4fa7-b1af-4a6c60d9ce5c [0xCAFA] (Garage Door 1)> emitting event: {“attribute_id”:“contact”,“component_id”:“main”,“state”:{“value”:“open”},“capability_id”:“contactSensor”}
2021-11-20T08:48:00.851121991+00:00 DEBUG Zigbee Sensors Edge Driver [YG] Aqara Contact Sensor device thread event handled
listening for logs… done

@JP3000 thanks for sharing.
So, LR window reports 23, while Garage Door 1 reports 21.
Not only the readings are incorrect, but also the differences does not match (20-14=6 vs 23-21=2).
It doesn’t seem like it is worth to add temperature measurement capability to the sensor.

@ygerlovin
I was thinking i also have one door sensor attach to a wall switch.
So if you can also add a switch icon
Thank you

@Sylvain ,

The problem is that currently the platform lacks the ability to change only an icon. It requires definition of complete profile with only icon changed. It makes the driver very hard to maintain and extend.

Even though I’ve got it working, I’m concerned about future support and maintenance.

Have you considered to use virtual devices? There are a lot of icons to choose

@ygerlovin
Thanks for the explanation .Thats ok for me
Thats good idea i will take a look.
Thank you

Hi @Sylvain ,

Since it is not possible to remove profiles once added to the driver, even though it was not published on the public channel, I decided to publish the new version that allows changing the icon for the contact sensor.

The supported icons are:

  • contact sensor (this is the default)
  • switch
  • lock
  • door bell
  • refrigerator

Regards,
Yakov

Hi @ygerlovin
Wow thank you very much…

Perfect , small problem with the refresh of the app , icon showing up if i leave the app and the app still running in background when i come back in the app
Icon is switching back to default . I need to closed the app so it wont run in background .

But i saw that with another driver that i can replace the icon to. So the probleme is on smartthings side i thinks

Anyway i like it
Thank you Sylvain