Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix invalid contact for MCCGQ01LM #7452

Merged
merged 1 commit into from
Apr 27, 2024
Merged

fix: Fix invalid contact for MCCGQ01LM #7452

merged 1 commit into from
Apr 27, 2024

Conversation

Koenkk
Copy link
Owner

@Koenkk Koenkk commented Apr 27, 2024

This PR reverts #4009 (CC: @McGiverGim) as it generated incorrect contact values.

Log in which contact incorrectly goes from true -> false:

// Since msg.data['65282'].value[0].elmVal === 0, contact incorrectly becomes `false` here
[2024-04-26 06:30:42] �[34mdebug�[39m: 	z2m: Received Zigbee message from 'mailbox_new_mail_sensor', type 'attributeReport', cluster 'genBasic', data '{"65282":[{"elmType":16,"elmVal":1},{"elmType":33,"elmVal":2975},{"elmType":33,"elmVal":5032},{"elmType":36,"elmVal":[0,1]},{"elmType":33,"elmVal":552},{"elmType":32,"elmVal":119}]}' from endpoint 1 with groupID 0
[2024-04-26 06:30:42] �[34mdebug�[39m: 	zhc:lumi: MCCGQ01LM: Processed data into payload {"contact":false,"voltage":2975,"battery":83,"power_outage_count":551}
[2024-04-26 06:30:42] �[34mdebug�[39m: 	z2m: MQTT publish: topic 'zigbee2mqtt/mailbox_new_mail_sensor', payload '{"battery":83,"contact":false,"linkquality":87,"power_outage_count":551,"voltage":2975}'
// Immediately after the sensor reports the correct `contact` value using the `genOnOff`
[2024-04-26 06:30:42] �[34mdebug�[39m: 	z2m: Received Zigbee message from 'mailbox_new_mail_sensor', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
[2024-04-26 06:30:42] �[34mdebug�[39m: 	z2m: MQTT publish: topic 'zigbee2mqtt/mailbox_new_mail_sensor', payload '{"battery":83,"contact":true,"linkquality":87,"power_outage_count":551,"voltage":2975}'

Based on this we should not use msg.data['65282'].value[0].elmVal to determine the contact value.

@Koenkk Koenkk merged commit d9640a4 into master Apr 27, 2024
3 checks passed
@Koenkk Koenkk deleted the fix/MCCGQ01LM branch April 27, 2024 12:16
@McGiverGim
Copy link
Contributor

Strange, it seems to be working in my system without problem since my commit, but I understand maybe there are cases were not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants