Aqara switch in “smart bulb mode”?

Ok, so I don’t actually want to control a smart bulb with my Aqara switch but I think I want to do something similar. Here’s my setup:

I have an Aqara WS-USC04 Double Rocker switch (with neutral) in my kitchen, registered in zigbee2mqtt. One of the switches (top switch) controls a ceiling light and the other switch (bottom switch) controls outlets underneath the cabinets that have under-cabinet lights plugged into them. Works perfectly fine.

I’m in the process of replacing the existing under-cabinet lights with WLED-controlled lights. My plan was to just plug the esp32 controllers into the outlets and have the switch just power on the controllers which would power the lights. However when doing this, there’s 2-3 second delay between the time the switch is pressed and the time the lights come on. I’m assuming this is the esp32 booting up. So now I’m thinking instead of using the switch to physically control the outlet, I essentially want to bypass the relay functionality, just keep constant power to the outlets, and use the switch to control the WLED power.

I know Inovelli has a feature that somewhat achieves called “smart bulb mode” so the switch directly controls the bulb instead of just controlling power to the fixture. I went looking to see if my Aqara switch does something similar and noticed it has an “operation_mode” for each switch with the choices of “control_relay” or “decoupled” with control_relay being the default. I set the bottom switch to decoupled and it stopped toggling the power to outlets but I’m not really sure where to go from here. Or if this is even going to do what I want. I tried listening to topic events for this switch but nothing stood out.

Any help or advice is greatly appreciated.

In Z2M, go into Exposes under the device and set the bottom switch to decoupled mode.

And, I didn’t read fully :persevere:

So, from here, you’ll want to create an automation listening to the action event. I believe the value is “button_pressed”.

Thank you! This is the first time I’ve tried doing an automation based on events. When you say to listen to the action event, is that being fired via the MQTT topic? Or is this in the HA event bus? If I listen for the
zigbee2mqtt/Kitchen Double Rocker Switch topic and press the button, I just get what seems to be a generic dump of the state info:

{
    "action": null,
    "consumption": 116.5608139038086,
    "current": 0.25328099060058595,
    "device_temperature": 25,
    "energy": 116.56,
    "flip_indicator_light": null,
    "linkquality": 185,
    "operation_mode_bottom": "decoupled",
    "operation_mode_top": "control_relay",
    "power": 30.65,
    "power_outage_count": 11,
    "power_outage_memory": true,
    "power_outage_memory_top": true,
    "state": "OFF",
    "state_bottom": "ON",
    "state_top": "OFF",
    "update": {
        "installed_version": 31,
        "latest_version": 31,
        "state": "idle"
    },
    "update_available": false,
    "voltage": 121
}

Nope. It’s exposed as an entity from the device itself. If you look in the logbook, you’ll see what gets sent in the action entity.

Perfect!!! Works exactly as I want it to. Thanks again!!

1 Like

Happy to help! :blush:

1 Like