veonua / SmartThingsEdge-Xiaomi

SmartThings Edge drivers for XIaomi and Aqara devices
MIT License
67 stars 60 forks source link

Aqara temp/humidity/pressure sensor spurious 0 values #18

Closed pxFIN closed 10 months ago

pxFIN commented 1 year ago

Quick background, I've been using long time DTH for this sensor without problems and switched to your edge driver version lately

Now I've been seeing since last weekend 'spurious' 0 values for temperature and humidity. Usually 1 to 3 times a day

I started partly yesterday and now today logging (CLI) and could catch a couple of 0 value cases

2023-07-10T07:27:14.008109911+00:00 INFO Aqara/Xiaomi Temperature 1.3  Doing health check read for [69FE]:0402:0000
2023-07-10T07:27:14.012583578+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x69FE, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-07-10T07:27:14.033139911+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  driver device thread event handled
2023-07-10T07:27:18.901592580+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Received event with handler zigbee
2023-07-10T07:27:18.903024914+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x69FE, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD2, rssi: -56, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x05, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Int16, MeasuredValue: 0 > > > >
2023-07-10T07:27:18.983828914+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Found ZigbeeMessageDispatcher handler in xiaomi_temp
2023-07-10T07:27:18.984673580+00:00 INFO Aqara/Xiaomi Temperature 1.3  Executing ZclClusterAttributeValueHandler: cluster: TemperatureMeasurement, attribute: MeasuredValue
2023-07-10T07:27:18.986393914+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> emitting event: {"component_id":"main","attribute_id":"temperature","state":{"unit":"C","value":0.0},"capability_id":"temperatureMeasurement"}
2023-07-10T07:27:18.997940580+00:00 WARN Aqara/Xiaomi Temperature 1.3  Attempted to generate event for 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8.main but it does not support capability Temperature Alarm
2023-07-10T07:27:19.003329580+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  Xiaomi 3 device thread event handled

2023-07-10T11:07:17.385505213+00:00 INFO Aqara/Xiaomi Temperature 1.3  Doing health check read for [69FE]:0402:0000
2023-07-10T11:07:17.387389547+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x69FE, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-07-10T11:07:17.410792880+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  driver device thread event handled
2023-07-10T11:07:42.292403225+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Received event with handler zigbee
2023-07-10T11:07:42.293654892+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x69FE, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xC6, rssi: -79, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x11, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Int16, MeasuredValue: 0 > > > >
2023-07-10T11:07:42.372589559+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Found ZigbeeMessageDispatcher handler in xiaomi_temp
2023-07-10T11:07:42.373438225+00:00 INFO Aqara/Xiaomi Temperature 1.3  Executing ZclClusterAttributeValueHandler: cluster: TemperatureMeasurement, attribute: MeasuredValue
2023-07-10T11:07:42.376159892+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> emitting event: {"component_id":"main","attribute_id":"temperature","state":{"unit":"C","value":0.0},"capability_id":"temperatureMeasurement"}
2023-07-10T11:07:42.378781892+00:00 WARN Aqara/Xiaomi Temperature 1.3  Attempted to generate event for 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8.main but it does not support capability Temperature Alarm
2023-07-10T11:07:42.381374559+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  Xiaomi 3 device thread event handled

Now from my brief analysis all proper reported values like


2023-07-10T08:33:45.341776603+00:00 INFO Aqara/Xiaomi Temperature 1.3  Doing health check read for [69FE]:0405:0000
2023-07-10T08:33:45.343682936+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x69FE, dest_endpoint: 0x01, profile: 0x0104, cluster: RelativeHumidity >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-07-10T08:33:45.350182270+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  driver device thread event handled
2023-07-10T08:34:15.342704284+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  driver device thread event handled
2023-07-10T08:34:28.414863624+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Received event with handler zigbee
2023-07-10T08:34:28.416293290+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x69FE, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD2, rssi: -74, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x2F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Int16, MeasuredValue: 2114 > > > >
2023-07-10T08:34:28.447166290+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Found ZigbeeMessageDispatcher handler in xiaomi_temp
2023-07-10T08:34:28.447994957+00:00 INFO Aqara/Xiaomi Temperature 1.3  Executing ZclClusterAttributeValueHandler: cluster: TemperatureMeasurement, attribute: MeasuredValue
2023-07-10T08:34:28.449689957+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> emitting event: {"component_id":"main","attribute_id":"temperature","state":{"unit":"C","value":21.14},"capability_id":"temperatureMeasurement"}
2023-07-10T08:34:28.463042957+00:00 WARN Aqara/Xiaomi Temperature 1.3  Attempted to generate event for 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8.main but it does not support capability Temperature Alarm
2023-07-10T08:34:28.464758624+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  Xiaomi 3 device thread event handled

2023-07-10T10:11:59.146888306+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Received event with handler zigbee
2023-07-10T10:11:59.148782306+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x69FE, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xC4, rssi: -77, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x36, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Int16, MeasuredValue: 2128 > > > >
2023-07-10T10:11:59.165849639+00:00 TRACE Aqara/Xiaomi Temperature 1.3  Found ZigbeeMessageDispatcher handler in xiaomi_temp
2023-07-10T10:11:59.169681306+00:00 INFO Aqara/Xiaomi Temperature 1.3  Executing ZclClusterAttributeValueHandler: cluster: TemperatureMeasurement, attribute: MeasuredValue
2023-07-10T10:11:59.173955306+00:00 INFO Aqara/Xiaomi Temperature 1.3  <ZigbeeDevice: 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8 [0x69FE] (Xiaomi 3)> emitting event: {"component_id":"main","attribute_id":"temperature","state":{"unit":"C","value":21.28},"capability_id":"temperatureMeasurement"}
2023-07-10T10:11:59.203680973+00:00 WARN Aqara/Xiaomi Temperature 1.3  Attempted to generate event for 8b5fc57b-74d2-45c1-a99d-6973ea8d2ba8.main but it does not support capability Temperature Alarm
2023-07-10T10:11:59.205036306+00:00 DEBUG Aqara/Xiaomi Temperature 1.3  Xiaomi 3 device thread event handled

Do come as ReportAttribute

Reported 0 values are always ReadAttributeResponse ???

So far i have many hours of logs and ReadAttributeResponse do happen only 2 times with those 0 values reports.. everything else valid values are ReportAttributes

StarScream159 commented 11 months ago

I too have this problem with temperature. I have automations setup to trigger an alert if something drops below a specific temperature and I am getting a few alerts a day when I know the value isn't that low.

I saw a comment @veonua made here https://community.smartthings.com/t/aqara-temperature-sensor-problem-it-goes-instantly-to-0-c-and-comes-back-to-normal/270950/3 that says in his driver he ignores zero values if the previous value wasn't zero.

Is this not working anymore? I have version 1.3 of the driver.

veonua commented 10 months ago

try v1.4.

StarScream159 commented 10 months ago

Thank you @veonua. I'll give this a test and report back.

StarScream159 commented 10 months ago

Thank you for the update. Looks like I am updating to version 1.5 now. I haven't seen a 0 value since Thursday the 4th. I believe this has been fixed. This can the closed.