Configure Hue Dimmer Switch to send toggle command instead of on/off

I am an experienced software engineer, but new to both Home Assistant and Zigbee. I’ve got pretty far in the last couple of evenings with the help of reading through this forum, but I’ve hit a problem and I’m hoping that somebody can help.

NB: I am not using the Hue integration and all of the devices mentioned below are connected to ZHA, not to a Hue hub.

I have the Hue RWL022 dimmer switch directly bound to a Zigbee group of 3 Hue bulbs and it works as expected, except that the on/off button alternately sends on or off commands as opposed to the toggle command. This means that if I have turned the lights on with the RWL022, then turn all the lights off via any other means, the next press on the RWL022’s on/off button has no effect because it is sending the off command to a group that is already off. The next press after that sends the on command which works as expected.

I have successfully created an automation so that when a plain Zigbee button is pressed, HA sends the toggle command (0x0002) to the lighting group’s onoff cluster (6), and that works as expected. I expect I could unbind the RWL022’s onoff cluster from the Zigbee group and use a similar automation to toggle the group when the RWL022’s on/off button is pressed, but I’d prefer to have the on/off button directly bound to the group so that the lights remain usable if/when HA is down for any reason (e.g. upgrading).

Is it possible to configure the RWL022 (by writing an attribute or sending it a command) so that pressing its on/off button sends the toggle command instead of the on and off commands? I know that the Hue devices have manufacturer-specific clusters which may control this, but I can’t find which one.

I see that ZCL defines cluster 7 to control this behaviour, but ZHA does not show this cluster for the RWL022. Is this because the ZHA configuration does not include it or because the RWL022 genuinely doesn’t support it?

Details about ZCL cluster 7:
ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIG (0x0007) Z-Stack API Reference: ZCL General Clusters
and
Z-Stack API Reference: ZCL On Off Switch Config Cluster

Thanks in advance for any advice.

Best regards,

Peter.

According to the device’s Zigbee info it is using this quirk:
zhaquirks.philips.rwl022.PhilipsRWL022

If I’m reading the ZHA debug log correctly, ZHA can read the supported clusters from the device during pairing, and it looks like cluster 0x0007 isn’t supported:

2024-02-23 12:41:02.291 INFO (MainThread) [zigpy.device] [0xedcd] Read model 'RWL022' and manufacturer 'Signify Netherlands B.V.' from <Endpoint id=1 in=[basic:0x0000, power:0x0001, identify:0x0003, manufacturer_specific:0xFC00, lightlink:0x1000] out=[ota:0x0019, basic:0x0000, identify:0x0003, groups:0x0004, on_off:0x0006, level:0x0008, scenes:0x0005, lightlink:0x1000] status=<Status.ZDO_INIT: 1>>

So if it is possible to configure the RWL022’s on/off button to send the toggle command then it would have to be via cluster 0xFC00.

ZHA has limited support for cluster 0xFC00 (aka PhilipsRemoteCluster), so it looks like there’s some digging ahead:

Hi Peter. Facing the same issue here. We’re you able to find out which attribute controls the switch’s on/off vs toggle behavior?

I find it strange that the default behavior of the RWL022 appears to be on/off given that it clearly has a toggle button as opposed to the earlier version.