Xiaomi switch qbkg12lm state after power lost

Hello. I am using the Home assistant and zigbee2mqtt addon. I have some Aqara light switches - Xiaomi QBKG12LM control via MQTT | Zigbee2MQTT

The problem with them is with the state after power loss and restore - state_left and state_right became always “OFF”

{
    "consumption": 74.67,
    "energy": 74.67,
    "linkquality": 87,
    "operation_mode_left": "decoupled",
    "operation_mode_right": "decoupled",
    "power": 0,
    "power_outage_count": 108,
    "state_left": "OFF",
    "state_right": "OFF",
    "temperature": 35,
    "update": {
        "state": "idle"
    },
    "update_available": false,
    "action": null
}

I see in the manual there are exist some settings for “POWER OFF MEMORY” in MiHome, but how to turn it on using zigbee2mqtt addon? I do not see some “power_outage_memory” param which I can turn on.

Duke

Hello! I’m faced the same issue and I guess I found a solution. It described here:

This option allows the device to restore the last on/off state when it’s reconnected to power. To set this option publish to zigbee2mqtt/FRIENDLY_NAME/set payload {"power_outage_memory": true} (or false). Now toggle the plug/switch once with the button on it, from now on it will restore its state when reconnecting to power.

And it seems that it works for my Xiaomi QBKG04LM.