ControllerX: correct mappings for HueDimmerController & ZHA?

I am currently taking my first steps with ControllerX and I am trying to get my Hue Dimmer Switch (RWL021) up and running with the ZHA integration. But just the standard operations (on, dim up, dim down, off, color wheel) do work but my automations do not. The mappings do not seem to be correct.

In the developer tools, I am able see all possible button events such as

(please click to open)
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:17:88:01:04:e4:8e:6c",
        "unique_id": "00:17:88:01:04:e4:8e:6c:2:0xfc00",
        "device_id": "b33f605d530e2dbe443a69a2c3f43362",
        "endpoint_id": 2,
        "cluster_id": 64512,
        "command": "up_press",
        "args": {
            "button": "up",
            "press_type": "press",
            "command_id": 0,
            "args": [
                2,
                3145728,
                0,
                33,
                0,
                0
            ]
        }
    },
    "origin": "LOCAL",
    "time_fired": "2022-01-15T21:07:48.154548+00:00",
    "context": {
        "id": "6e22c32c817ec237c3037c2029b62def",
        "parent_id": null,
        "user_id": null
    }
}

The corresponding light goes on and off and dims as requested but my automations do not work:

hue_dimmer_ceiling:
  module: controllerx
  class: HueDimmerController
  controller: '<my_ieee_id>'
  integration: zha
  light: light.mylight

  merge_mapping:
  
    1000: # On short released
      - service: script.hue_set_scene
        data:
          light: light.mylight
          scene: 'Bright'

    1001: # On long released
     # similar script call ...

    2001: # Dim up long released
     # similar script call ...

    3001: # Dim down long released
     # similar script call ...

    4000: # Off short released
     # similar script call ...

Please note that the script script.hue_set_scene does work in another context. After studying lots of threads I assume that it may have something to do with wrong mappings (“1000”, “1001”, etc.) but I was not able to find a clear documentation for the use of HueDimmerController with the ZHA integration.

So my question is: What are the correct mappings for a Hue Dimmer Switch (RWL021) in a ZHA context?

Many thanks in advance!

Hi @mibane,

You are going in the right path. The 1000, 1002, etc are events from deCONZ integration. You need to place the ZHA actions events in there (like the up_press shown in the example). However, by looking at the documentation, I do not think that ControllerX supports this controller. As of now we have:

If the actions that you see in the Developer Tools do not match the ones in the documentation, could you please open a “New device” ticket in GitHub with all the events that the device fires?

Thank you,
Xavi M.

Thank you, Xavi @xaviml, for your answer! :slight_smile:

I was afraid of this as I could not find any suitable documentation by myself and no one was answering my request here. In the meantime, I successfully started using deCONZ with ControllerX for my purposes because it works as documented. In the very beginning, I wanted to avoid an additional piece of software (deCONZ) in case the functionality could hopefully be handled by ZHA. This does not seem to be the case so I took the easier path with deCONZ.

Thanks again,
Mike

Hi @mibane,

The device is currently not supported for ZHA because I do not have this device and ZHA, but adding a new controller is quite easy, however, I need to know some details that just people with the controller can answer. For this reason, I pointed you to create a GitHub issue, so I can add this device to ControllerX.

On the other hand, I am glad you got it all working with deCONZ :slight_smile:

Regards,
Xavi M.