SONOFF ZBMINI-L state previous_on_behavior swapping between previous and null

My SONOFF ZBMINI-L switch keeps switching between “previous_on_behavior” : null and “previous_on_behavior” : “previous” and am unable to turn on or off the switch. This is after HA restarts or a power outage. The only way I am able to regain control is by resetting and repairing the switch.

The log shows this many times per second:

info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":176,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":128,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":176,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":176,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":176,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":128,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:44: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":180,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":180,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":128,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":180,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":128,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Warm', payload '{"linkquality":180,"power_on_behavior":"previous","state":"OFF","update":{"state":"idle"},"update_available":null}'
info  2022-10-19 19:55:45: MQTT publish: topic 'zigbee2mqtt/Light: Kitchen Cold', payload '{"linkquality":124,"power_on_behavior":null,"state":"OFF","update":{"state":"idle"},"update_available":null}'

There is a FW update for the ZBMINI-L. Not sure what it entails, but it fixes some things.
Did you apply it? Do you have the latest version?

Yes, I have updated it. Firmware 1.1.1

After it disconnecting again I have tried restarting HA and restarting MQTT.

After that I tried reconfiguring the problem switch.

This is the resulting error:

Error <small>2022-10-27 12:18:58</small>`Failed to configure 'Kitchen Warm', attempt 1 (Error: Unbind 0x00124b0026b777e2/1 genPollCtrl from '0xe0798dfffe882a32/1' failed (Route error) at /app/node_modules/zigbee-herdsman/src/utils/waitress.ts:33:70 at Waitress.forEachMatching (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:83:17) at Waitress.reject (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:33:21) at Driver.handleRouteError (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:393:23) at Driver.handleFrame (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:314:18) at Ezsp.emit (node:events:527:28) at Ezsp.onFrameReceived (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:300:28) at SerialDriver.emit (node:events:527:28) at SerialDriver.handleDATA (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:209:14) at SerialDriver.onParsed (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:161:22))`

Info <small>2022-10-27 12:18:58</small>`MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"Kitchen Warm"},"error":"Failed to configure (Unbind 0x00124b0026b777e2/1 genPollCtrl from '0xe0798dfffe882a32/1' failed (Route error))","status":"error","transaction":"txnrj-4"}'`

I do not know a lot about Z2M, but it is possible that during configuration it may help to toggle the switch every two seconds.

As far as I understood from the FW upgrade, it should decrease the polling period (/increase the polling frequency), but you can ensure that your ZBMINI-L wakes up more often by toggling it every two seconds. I do stuff like that with battery powered devices, and the ZBMINI-L is a lot like a battery powered device.

As in turn the switch on and off? They’re connected to my lights so that would be very annoying. The problem occurs during every reboot and sometimes just randomly on its own.

Right now, one switch works and the other one doesn’t.

Working switch’s state:

{
    "linkquality": 164,
    "state": "OFF",
    "power_on_behavior": null,
    "update": {
        "state": null
    },
    "update_available": null
}

Not working switch:

{
    "linkquality": 128,
    "state": "OFF",
    "update": {
        "state": "idle"
    }
}

That’s only to be done on initial (re)configuration where HA sends the binding and reporting settings to the device.

I’m having a very similar issue with one of 4 zbmini-l devices on my network. Signal quality isn’t as good as yours but it seems to be updating constantly. Switch just seems to turn itself on and off at random. I can use the manual button to turn off but it just turns right back on again.

One thing that’s strange is that the state is reflected in HA when it turns on or off, but I can’t control it with HA when it’s doing this.

Have you figured out a solution? I have also updated the firmware to 1.1.1.

I have found that stopping the zigbee2mqtt service stops the behavior (but of course stops me from being able to control the device). Upon restart it behaves normally, but for how long?

Running zigbee2mqtt edge

I haven’t found a solution, but with the many home assistant core updates that have come out, the problem occurs less often. Now the switches are just randomly dropped from the network and have to be repaired.