How to configure the Philips Hue wall module to use push button (momentary) type wall switches [ZHA]

Same problem, only accepts 0 and 1.

File "/usr/src/homeassistant/homeassistant/components/zha/websocket_api.py", line 1333, in set_zigbee_cluster_attributes
    response = await zha_device.write_zigbee_attribute(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/zha/zigbee/device.py", line 878, in write_zigbee_attribute
    value = convert_zcl_value(value, attr_def.type)
  File "/usr/local/lib/python3.13/site-packages/zha/application/helpers.py", line 156, in convert_zcl_value
    field_type[value.replace(" ", "_").split(".", 1)[-1]]
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 782, in __getitem__
    return cls._member_map_[name]
           ~~~~~~~~~~~~~~~~^^^^^^
KeyError: '2'

Same goes for me; I’m having this problem with a wall module which until recently worked fine with 2 momentary switches. It suddenly switched to rocker mode and ever since, I can only set it to 1 button rocker or 1 button momentary switch (modes 0 and 1), all other modes just raise an error when trying to set them.

I see that there were some changes recently (History for zhaquirks/philips/wall_switch.py - zigpy/zha-device-handlers · GitHub), but can’t really tell what version my Home Assistant instance is currently using. I’m using Hass.io and have no idea how to find the quirk files.

I managed to find the quirk files and replace the wall_switch.py file with latest one from GitHub (zha-device-handlers/zhaquirks/philips/wall_switch.py at d2895d591cb3d9e884de5f990741c5a2cd05f0ab · zigpy/zha-device-handlers · GitHub). This fixed the issue, although the values have changed to SingleRocker, SinglePush, DoubleRocker and DoublePush instead of the previous 0, 1, 2 and 3 modes. So setting the value for mode to DoublePush fixed it for me.

I assume this fix will be in the next release, but if anyone needs to fix this asap because of non-functioning switches like me, this is what I did (but do so at your own risk!)

  • Install Advanced SSH & Web Terminal and turn off Protection Mode
  • Open Terminal and enter the Docker container: docker exec -it homeassistant /bin/bash
  • Change the working directory to /usr/local/lib/python3.13/site-packages/zhaquirks/philips: cd /usr/local/lib/python3.13/site-packages/zhaquirks/philips
  • (Optional) Make a backup of the current quirk file: cp wall_switch.py wall_switch.py.bck
  • Download the new quirk file and overwrite the old one: curl -4 https://raw.githubusercontent.com/zigpy/zha-device-handlers/d2895d591cb3d9e884de5f990741c5a2cd05f0ab/zhaquirks/philips/wall_switch.py > wall_switch.py (I had to force IPv4 in order for this to work using -4, this may be different for you)
  • Restart Home Assistant Core
  • Retry setting the mode using the new values mentioned above
  • Turn on Protection Mode for Advanced SSH & Web Terminal and optionally remove it if you don’t plan on using it in the future

As far as I’m aware, the homeassistant Docker container can be recreated at any time, which means the change will be undone, but I don’t think this will cause any issues with wall modules that have already been configured.

As I said before, do this at your own risk; I don’t know much about the Home Assistant internals, just enough to be dangerous!

1 Like

Just a little input that could help some of you:


On my RDM001, I had today actually human readable values in the mode. Also see the Cluster is not the same as mentioned in the post. I tested to write “SwitchMode.SinglePush”, “SwitchMode.SingleRocker”, “SwitchMode.DoublePush” and “SwitchMode.DoubleRocker” and all work and seem to have the desired behaviour from the log, thus, as you see, I use it as a Single Rocker and just read the release event to toggle my light.

I still hope it can help someone because I had absolutely no useful hit in google with these attributes I was reading from the cluster mode attribute.

Hi nannyy,

thx a lot for the fresh info. I have many RDM001 switch modules and I don’t get this new cluster. Do you use a quirk file?
I try to change the mode to doublepush, but I don’t get it.

My Home Assistant Version:

  • Core2025.1.4
  • Supervisor2024.12.3
  • Operating System14.2
  • Frontend20250109.2

Ohhhh this is very cool!

I also dont see the cluster:

Same problem here… no matter what I do, I can’t get the PhilipsBasicCluster to show up.

Used both Python quirks for rdm004 or rdm001 & rdm004.
Removed, rebooted and re-added under different names dozen of times. But it doesn’t seem to work.

I get the same as the screenshot above. The device id reported is a rdm001.

I can see in the logging that the quirks are being loaded.

In the meantime I realized that Zigbee2MQTT has better support (however I also reported some bugs there because the push button option reports the events twice) so I added another coordinator just for the Z2M.

It means I have 2 networks ZHA and Z2M for different devices - whichever supports which best - and I sync the thing in Home Assistant with the automations sometimes listening to ZHA events sometimes to MQTT actions… it might seems hacky but its actually quite flexible and robust in the same time

I spent quite a bit of time and effort figuring this out, but I finally managed to get it working! The main issue seems to be that I’m using ZHA instead of Zigbee2MQTT, which offers less compatibility.

I paired the RDM001 in-wall module with my ZHA instance successfully, but it didn’t create any entities. After some troubleshooting, I tried the quirks method to expose the PhilipsBasicCluster, but that didn’t work either.

However, I did notice log entries when I pressed the buttons:

  • Switch On event was fired
  • Switch Off With Effect event was fired, with parameters: {‘effect_id’: 0, ‘effect_variant’: 0}

After some digging, I realized these log entries weren’t being saved in the Logbook, so I couldn’t capture them to trigger any events. It turned out the logging was being handled by a third-party add-on.

With that in mind, I tried using the zha_event listener in Developer Tools and that did the trick! I was able to capture the exact events there and use them to trigger my automations.

The only downside is that I have a two rocker switch, but only one rocker is functional. Since this is in a bedroom where both lights are usually turned on anyway, I’m not too bothered by it.

For anyone who’s interested, here are my automations:

Switch On:

alias: Bedroom Switch On
description: ""
triggers:
  - event_type: zha_event
    event_data:
      device_ieee: 00:17:88:01:0b:02:23:04
      command: "on"
    trigger: event
actions:
  - action: light.turn_on
    metadata: {}
    data: {}
    target:
      area_id: bedroom

Switch Off:

alias: Bedroom Switch Off
description: ""
triggers:
  - event_type: zha_event
    event_data:
      device_ieee: 00:17:88:01:0b:02:23:04
      command: off_with_effect
      args:
        - 0
        - 0
    trigger: event
actions:
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      area_id: bedroom

Maybe this can be of help to anyone trying to use a Hue in-wall switch with the ZHA integration.

2 Likes

Your zha_event worked well for me with the SingleRocker.
I have configured another RDM004 as a DoubleRocker. There is a “Remote Button Short Press - Right event was fired” for the second switch, for example. Can you tell me how I can integrate this into the automation?

I’m having trouble with the wall swithces, as well. I have the old RDM001, and it does not load the quirk when pairing the device. So I don’t have the options available to change the button modes. It even says so within the log file:

2025-04-27 13:06:27.169 DEBUG (MainThread) [zha] (ZHAGatewayProxy) handling event protocol for event: RawDeviceInitializedEvent(device_info=RawDeviceInitializedDeviceInfo(ieee=00:17:88:01:0c:c2:6f:d6, nwk=0xD9BE, pairing_status=<DevicePairingStatus.INTERVIEW_COMPLETE: 2>, model=‘RDM001’, manufacturer=‘Signify Netherlands B.V.’, signature={‘manufacturer’: ‘Signify Netherlands B.V.’, ‘model’: ‘RDM001’, ‘node_desc’: {‘logical_type’: <LogicalType.EndDevice: 2>, ‘complex_descriptor_available’: 0, ‘user_descriptor_available’: 0, ‘reserved’: 0, ‘aps_flags’: 0, ‘frequency_band’: <FrequencyBand.Freq2400MHz: 8>, ‘mac_capability_flags’: <MACCapabilityFlags.AllocateAddress: 128>, ‘manufacturer_code’: 4107, ‘maximum_buffer_size’: 82, ‘maximum_incoming_transfer_size’: 128, ‘server_mask’: 11264, ‘maximum_outgoing_transfer_size’: 128, ‘descriptor_capability_field’: <DescriptorCapability.NONE: 0>}, ‘endpoints’: {1: {‘profile_id’: 260, ‘device_type’: <DeviceType.NON_COLOR_SCENE_CONTROLLER: 2096>, ‘input_clusters’: [0, 1, 3, 64512], ‘output_clusters’: [25, 0, 3, 4, 6, 8]}}}), event_type=‘zha_gateway_message’, event=‘raw_device_initialized’)
2025-04-27 13:06:27.169 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for Signify Netherlands B.V. RDM001 (00:17:88:01:0c:c2:6f:d6)
2025-04-27 13:06:27.170 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class ‘zhaquirks.philips.wall_switch.PhilipsWallSwitch’>
2025-04-27 13:06:27.170 DEBUG (MainThread) [zigpy.quirks] Fail because device_type mismatch on at least one endpoint

My HA Versions are:

Core: 2025.4.4
Supervisor: 2025.04.0
Operating System: 15.2
Frontend: 20250411.0

I tried to replace the quirk file with the latest from the Github Link posted above but the contents are identical. It seems to use the latest version.

Can anyone help?

I have the Rdm001 and this worked great. I just needed the switch to work on and off. Now I can ditch the hub. Thank you.

1 Like

Hey,
I’m using the wall module RDM004 with ZHA. The custom quirk in this thread is applied. I want to have the double rocker setup (value 2). I can set it in the PhilipsBasicCluster mode (id: 0x0034) to the values 0 and 1, but 2 and 3 are not working: Failed to perform the action zha/set_zigbee_cluster_attribute. ‘2’

Any idea?

I got it working now, if anyone is having the same issue here is the solution: I replaced the mentioned zha_quirk in this threat with that one:

And then set the attribute to: ‎SwitchMode.DoubleRocker

1 Like