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: lumiOutageCountRestoreBindReporting sometimes stuck #7805

Merged
merged 3 commits into from
Jul 28, 2024

Conversation

sjorge
Copy link
Contributor

@sjorge sjorge commented Jul 27, 2024

I noticed I was getting bind errors over and over again, due to timeouts.

There seems to have been some changes in zh, maybe in the past these did not propagate properly to zhc?

When the device recovers from a power outage (aka sometimes battery voltages dips when for example it refreshes the eInk display. We try and restore the bind/reporting settings, generally the device is awake for a bit after this happens before going to sleep.

If we somehow end up hitting a timeout, meta.outageCount was never updates because the bind and/or reporting hit an error. So we try again every message we get, but on a normal message the device does not seem to be awake for long to finish all the bind/reporting restores. So we end up where we started.

We can 'avoid' this by updating meta.outageCount first and adding a try {} catch {} around the bind/reporting restores.

This seems to be doing OK for the 2 power outages I triggered. Will monitor for a few days.

@sjorge
Copy link
Contributor Author

sjorge commented Jul 27, 2024

Well I tried 3 times and could not trigger a failure (of course I can't when I want one)... at least the restoring is still working :)

[2024-07-27 14:16:08] debug:    zh:controller:endpoint: Bind 0x54ef441000781c8d/1 genPowerCfg from '0x00124b00228120b5/1'
[2024-07-27 14:16:09] debug:    zh:controller:endpoint: Bind 0x54ef441000781c8d/1 genAnalogInput from '0x00124b00228120b5/1'
[2024-07-27 14:16:11] debug:    zh:controller:endpoint: Bind 0x54ef441000781c8d/1 msTemperatureMeasurement from '0x00124b00228120b5/1'
[2024-07-27 14:16:12] debug:    zh:controller:endpoint: Bind 0x54ef441000781c8d/1 msRelativeHumidity from '0x00124b00228120b5/1'
[2024-07-27 14:16:13] debug:    zh:controller:endpoint: Bind 0x54ef441000781c8d/1 msTemperatureMeasurement from '0x001fee0000009911/1'
[2024-07-27 14:16:15] debug:    zh:controller:endpoint: ZCL command 0x54ef441000781c8d/1 genPowerCfg.configReport([{"attribute":"batteryVoltage","minimumReportInterval":3600,"maximumReportInterval":65000,"reportableChange":0}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
[2024-07-27 14:16:15] debug:    zh:controller:endpoint: Request Queue (0x54ef441000781c8d/1): send request
[2024-07-27 14:16:16] debug:    zh:controller:endpoint: ZCL command 0x54ef441000781c8d/1 genAnalogInput.configReport([{"attribute":"presentValue","minimumReportInterval":60,"maximumReportInterval":600,"reportableChange":10}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
[2024-07-27 14:16:16] debug:    zh:controller:endpoint: Request Queue (0x54ef441000781c8d/1): send request
[2024-07-27 14:16:17] debug:    zh:controller:endpoint: ZCL command 0x54ef441000781c8d/1 msTemperatureMeasurement.configReport([{"attribute":"measuredValue","minimumReportInterval":60,"maximumReportInterval":600,"reportableChange":10}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
[2024-07-27 14:16:17] debug:    zh:controller:endpoint: Request Queue (0x54ef441000781c8d/1): send request
[2024-07-27 14:16:18] debug:    zh:controller:endpoint: ZCL command 0x54ef441000781c8d/1 msRelativeHumidity.configReport([{"attribute":"measuredValue","minimumReportInterval":60,"maximumReportInterval":600,"reportableChange":10}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
[2024-07-27 14:16:18] debug:    zh:controller:endpoint: Request Queue (0x54ef441000781c8d/1): send request

@sjorge sjorge marked this pull request as ready for review July 28, 2024 07:46
@sjorge
Copy link
Contributor Author

sjorge commented Jul 28, 2024

Seems good, outage count of device + db match and there has been no repeat attempts to restore binds.

sjorge@amethyst:~$ grep -c 'Restoring binding and reporting' /var/log/zigbee2mqtt.log
0

Good to go in.

@Koenkk Koenkk merged commit bc57b14 into Koenkk:master Jul 28, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jul 28, 2024

thanks!

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