zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

For active devices, availability does not work properly.

Open CubeZ2mDeveloper opened this issue 1 year ago β€’ 3 comments

What happened?

I currently have a Sonoff device, model MINI-ZB2GS-L, which is a dual-channel switch with live and neutral wiring. Due to its special single-line power supply design, it needs to maintain low power consumption, so it is implemented as an end device and includes the checkinInterval attribute in the genPollCtrl cluster. However, this device is not battery-powered. In the availability detection logic, it is treated as an active device, and the system attempts to ping it to check its availability. The issue is that when this device is pinged, it causes communication blocking, preventing other active devices from updating their availability status properly.

What did you expect to happen?

I expect all active devices to report their availability status normally.

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.4.0

Adapter firmware version

6.10.3

Adapter

ezsp

Setup

windows

Device database.db entry

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0026b68529","nwkAddr":0,"manufId":4169,"epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":48879,"inClusterList":[0,3,6,10,25,26,768],"outClusterList":[0,3,4,5,6,8,32,768,1024,1026,1029,1030,1280,2817,2819,2820,1794,4096,64513,64514],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{},"lastSeen":1762433350694} {"id":2,"type":"Router","ieeeAddr":"0xe406bffffe6fef43","nwkAddr":40493,"manufId":4742,"manufName":"SONOFF","powerSource":"Mains (single phase)","modelId":"ZBM5-3C-80/86","epList":[1,2,3,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":2,"inClusterList":[0,3,4,5,6,2821,64599,64529],"outClusterList":[25],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":2,"inClusterList":[0,3,4,5,6,64599],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":2,"inClusterList":[0,3,4,5,6,64599],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":16,"hwVersion":16,"dateCode":"20250410","swBuildId":"1.0.4","zclVersion":8,"interviewCompleted":false,"interviewState":"PENDING","meta":{},"lastSeen":1762433423680} {"id":4,"type":"EndDevice","ieeeAddr":"0xc4d8c8fffe0f2631","nwkAddr":50465,"manufId":4742,"manufName":"SONOFF","powerSource":"Mains (single phase)","modelId":"MINI-ZB2GS-L","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":2,"inClusterList":[0,3,4,6,32,2821,64599,64529],"outClusterList":[3,6,25],"clusters":{"64529":{"attributes":{"16":0}},"genBasic":{"attributes":{"modelId":"MINI-ZB2GS-L","manufacturerName":"SONOFF","powerSource":1,"zclVersion":8,"hwVersion":0,"dateCode":"20250821","swBuildId":"1.0.4"}},"genPollCtrl":{"attributes":{"checkinInterval":14400}},"customClusterEwelink":{"attributes":{"16":0,"externalTriggerMode":0,"delayedPowerOnState":0,"delayedPowerOnTime":0,"relay_separation_modes":0}},"genOnOff":{"attributes":{"onOff":0,"startUpOnOff":0}}},"binds":[{"cluster":32,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1},{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1},{"cluster":64529,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":1,"maxRepIntval":270,"repChange":1}],"meta":{}},"2":{"profId":260,"epId":2,"devId":2,"inClusterList":[0,3,4,6,64529],"outClusterList":[3,6],"clusters":{"genBasic":{"attributes":{"hwVersion":0}},"genOnOff":{"attributes":{"onOff":1,"startUpOnOff":0}},"customClusterEwelink":{"attributes":{"delayedPowerOnState":0,"delayedPowerOnTime":0,"externalTriggerMode":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":1,"maxRepIntval":270,"repChange":1}],"meta":{}}},"hwVersion":0,"dateCode":"20250821","swBuildId":"1.0.4","zclVersion":8,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":332242049},"lastSeen":1762433380314,"checkinInterval":3600} {"id":5,"type":"Router","ieeeAddr":"0x7cb94c77af000000","nwkAddr":12089,"manufId":4742,"manufName":"eWeLink","powerSource":"Unknown","modelId":"CK-BL702-MSW-01(7012)-1","epList":[1,2,3,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":2,"inClusterList":[0,3,4,5,6,4096,64599,64529],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"CK-BL702-MSW-01(7012)-1","manufacturerName":"eWeLink","powerSource":0,"zclVersion":8,"appVersion":1,"stackVersion":0,"hwVersion":0,"dateCode":"20210610-BL","swBuildId":"1.2.6"}},"genOnOff":{"attributes":{"startUpOnOff":0,"onOff":0}},"customClusterEwelink":{"attributes":{"radioPower":10}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":65000,"repChange":1}],"meta":{}},"2":{"profId":260,"epId":2,"devId":2,"inClusterList":[0,3,4,5,6],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"stackVersion":0,"hwVersion":0}},"genOnOff":{"attributes":{"startUpOnOff":0,"onOff":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":65000,"repChange":1}],"meta":{}},"3":{"profId":260,"epId":3,"devId":2,"inClusterList":[0,3,4,5,6],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"stackVersion":0,"hwVersion":0}},"genOnOff":{"attributes":{"startUpOnOff":0,"onOff":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b68529","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":65000,"repChange":1}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":0,"hwVersion":0,"dateCode":"20210610-BL","swBuildId":"1.2.6","zclVersion":8,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":332242049},"lastSeen":1762433487798}

Debug log

No response

Notes

No response

CubeZ2mDeveloper avatar Nov 06 '25 13:11 CubeZ2mDeveloper

Image

After investigation, I found that the issue occurs because this device has the checkinInterval attribute. When a Ping to this device fails, the error is not propagated to Z2M; instead, it is added to a retry queue. The system waits for the device to report a message before attempting to ping it again. During this period, other active devices are blocked, waiting for this device’s retry to complete, which causes them to fail to go online or offline properly.

Image

My solution is to change the sending strategy of the Ping operation to immediate.

Image

CubeZ2mDeveloper avatar Nov 06 '25 13:11 CubeZ2mDeveloper

I believe this is a bug. Currently, the device has a checkinInterval of 14400, which means the request queue task may take up to an hour to time out. During this period, other active devices are unable to go online or offline properly.

CubeZ2mDeveloper avatar Nov 06 '25 13:11 CubeZ2mDeveloper

I agree that ping should be immediate indeed, could you create a pull request?

Koenkk avatar Nov 06 '25 18:11 Koenkk