zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

SNZB-02D doing OTA checks every 5mins

Open MFornander opened this issue 1 year ago • 3 comments

What happened?

Looking at the logs I see that the otherwise awesome SONOFF SNZB-02D T&H w/ display, does an OTA check (genOta commandQueryNextImageRequest) every 5mins which will really drain the battery since the other updates are set to very infrequent.

Now I realize that this is probably not zigbee2mqtt's fault since it responds with a "NO_IMAGE_AVAILABLE" (genOta queryNextImageResponse) but I'm wondering if the reply payload doesn't satisfy the SNZB-02D so it keeps trying.

Is anyone else seeing this and/or working on a solution? I'm about to order a SONOFF Zigbee Bridge Pro Hub and boot up my Zigbee sniffer to figure this out. I'm wondering if there is a response or arcane set of commands that quiet the chatter if paired with a standard SONOFF controller.

Any ideas or workarounds? Is everyone else's SNZB-02D reporting softwareBuildID: 1.0.9 and maybe I have an old firmware?

SNZB-02D device state below:

{
    "battery": 100,
    "humidity": 54.4,
    "last_seen": "2024-06-25T04:47:56.030Z",
    "linkquality": 240,
    "temperature": 22.6,
    "device": {
        "applicationVersion": 0,
        "dateCode": "20230105",
        "friendlyName": "SNZB-02D",
        "hardwareVersion": 0,
        "ieeeAddr": "0x0ceff6fffedf950f",
        "manufacturerID": 4742,
        "manufacturerName": "SONOFF",
        "model": "SNZB-02D",
        "networkAddress": 17356,
        "powerSource": "Battery",
        "softwareBuildID": "1.0.9",
        "type": "EndDevice",
        "zclVersion": 8
    }
}

What did you expect to happen?

I expected that OTA checks would be at most every day.

How to reproduce it (minimal and precise)

  1. Install zigbee2mqtt
  2. add SNZB-02D
  3. Enable z2m debug log
  4. See "z2m: Device 'SNZB-02D' requested OTA" every 5mins

Zigbee2MQTT version

1.38.0-dev commit: 889e41ca

Adapter firmware version

7.4.1 [GA]

Adapter

SLZB-06M v2.3.6 on ember 20240510 over TCP

Setup

Plain linux x86-64 using manual npm start to debug

Debug log

[2024-06-24 22:32:54] debug: zh:ember:ezsp: <=== [FRAME: ID=69:"INCOMING_MESSAGE_HANDLER" Seq=52 Len=36] [2024-06-24 22:32:54] debug: zh:ember:ezsp: ezspIncomingMessageHandler(): callback called with: [type=UNICAST], [apsFrame={"profileId":260,"clusterId":25,"sourceEndpoint":1,"destinationEndpoint":1,"options":64,"groupId":0,"sequence":227}], [lastHopLqi=236], [lastHopRssi=-41], [sender=17356], [bindingIndex=255], [addressIndex=255], [messageContents=117101008612050809100000] [2024-06-24 22:32:54] debug: zh:controller: Received payload: clusterID=25, address=17356, groupID=0, endpoint=1, destinationEndpoint=1, wasBroadcast=false, linkQuality=236, frame={"header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":0,"disableDefaultResponse":true,"reservedBits":0},"manufacturerCode":null,"transactionSequenceNumber":113,"commandIdentifier":1},"payload":{"fieldControl":0,"manufacturerCode":4742,"imageType":2053,"fileVersion":4105},"command":{"ID":1,"response":2,"parameters":[{"name":"fieldControl","type":32},{"name":"manufacturerCode","type":33},{"name":"imageType","type":33},{"name":"fileVersion","type":35}],"name":"queryNextImageRequest"}} [2024-06-24 22:32:54] debug: z2m: Received Zigbee message from 'SNZB-02D', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":4105,"imageType":2053,"manufacturerCode":4742}' from endpoint 1 with groupID 0 [2024-06-24 22:32:54] info: z2m:mqtt: MQTT publish: topic 'z2m/SNZB-02D', payload '{"battery":100,"device":{"applicationVersion":0,"dateCode":"20230105","friendlyName":"SNZB-02D","hardwareVersion":0,"ieeeAddr":"0x0ceff6fffedf950f","manufacturerID":4742,"manufacturerName":"SONOFF","model":"SNZB-02D","networkAddress":17356,"powerSource":"Battery","softwareBuildID":"1.0.9","type":"EndDevice","zclVersion":8},"humidity":54.4,"last_seen":"2024-06-25T04:32:54.980Z","linkquality":236,"temperature":22.6}' [2024-06-24 22:32:54] debug: z2m: Device 'SNZB-02D' requested OTA [2024-06-24 22:32:54] debug: zh:controller:endpoint: CommandResponse 0x0ceff6fffedf950f/1 genOta.queryNextImageResponse({"status":152}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) [2024-06-24 22:32:54] debug: zh:controller:endpoint: Request Queue (0x0ceff6fffedf950f/1): send request [2024-06-24 22:32:54] debug: zh:ember:queue: Status queue=0 priorityQueue=0. [2024-06-24 22:32:54] debug: zh:ember: ~~~> [ZCL to=17356 apsFrame={"profileId":260,"clusterId":25,"sourceEndpoint":1,"destinationEndpoint":1,"options":4352,"groupId":0,"sequence":0} header={"frameControl":{"reservedBits":0,"frameType":1,"direction":1,"disableDefaultResponse":true,"manufacturerSpecific":false},"manufacturerCode":null,"transactionSequenceNumber":113,"commandIdentifier":2}] [2024-06-24 22:32:54] debug: zh:ember:ezsp: ===> [FRAME: ID=52:"SEND_UNICAST" Seq=53 Len=25] [2024-06-24 22:32:55] debug: zh:ember:ezsp: <=== [FRAME: ID=52:"SEND_UNICAST" Seq=53 Len=7] [2024-06-24 22:32:55] debug: zh:ember:ezsp: ~~~> [SENT type=DIRECT apsSequence=9 messageTag=7 status=SUCCESS] [2024-06-24 22:32:55] debug: z2m: Responded to OTA request of 'SNZB-02D' with 'NO_IMAGE_AVAILABLE'

MFornander avatar Jun 25 '24 04:06 MFornander