Zigbee wrong button number/type in trigger

After years of HA I have just started with a ConBee 2 hub and bought my first 4 button zigbee switch.
In the GUI the trigger drop down helpfully reports various button options.

"Turn On" button pressed
"Turn Off" button pressed
"Dim up" button pressed
"Dim up" button continuously pressed
"Dim down" button pressed
"Dim down" button continuously pressed
.....
"First button" pressed
"First button" continuously pressed
"First button" double clicked 
......

So logically I thought to select the 4 options of “First Button” pressed, "“Second Button” pressed etc for the 4 buttons.
However after hours of head scratching it turns out that the 4 buttons are mapped as follows:-

“Turn On” button pressed (Button 1 pressed)
“Turn Off” button pressed (Button 2 pressed)
“Dim up” button pressed (Button 3 pressed)
“Dim up” button continuously pressed (Button 3 long Press) 
“Dim down” button pressed (Button 4 pressed)

Is this a limitation of the integration or have I done something wrong in adding the device to the zigbee hub or is it the particular Zigbee 4 button hardware I chose. (Tuya TS0004F)?
Should all the button press types be supported i.e. 3 short presses?
Snippet of automation to show “dim_up” as the sub_type

- id: '1653822320300'
  alias: Bedroon Light Off
  description: ''
  trigger:
  - device_id: 1566ff9c2d8daecbb63a9adde32289ed
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: dim_up
  condition: []
  action:
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.bedroom_light_mqtt

ZHA, z2m or deconz?

Apologies not sure what any of that means. Does this help?


domain: zha?
Coordinator

There are 3 ways of incorporating zigbee devices into HA. Which one did you use?

I seem to think there was no option. I plugged the Conbee 2 into the Pi, HA recognised it and asked to “Add Zigbee Device” Integration. I then used the integration to add the device which it did automatically. So I then had a Zigbeecoordinator.


Do I assume the “by ZHA” means I have the ZHA version?

Yes zha. Sorry not much of an expert on zha. I use z2m.

I’m not sure I understand the issue/problem/question.
The buttons are linked to device actions and zha_events, you can use either.

The problem is the illogical drop down in the trigger does not map correctly.
See screen capture.


How can selecting “Dim up” map to Button 3 rather than “Third Button” pressed.
Also if you select “Third Button” pressed twice it does not trigger when the 3rd button is pressed twice.

When using Tuya 4F button in ZHA it have 2 modes, hence you can only chose the modes you switch deliver. There is a very long discussion on this and you can quite easily change the version as I read it.

I use Zigbee2mqtt, where the switch behave as a 12 scene switch.

that is exactly what I was looking for. thank you so much. will check it out :grinning:

FYI, you are using Home Assistant’s native ZHA integration as Zigbee solution so suggest read docs:

https://www.home-assistant.io/integrations/zha

Especially read part about ZHA exception and deviation handling if buy Tuya or Aqara/Xiaomi devices:

https://www.home-assistant.io/integrations/zha#zha-exception-and-deviation-handling

You can alternatively use Zigbee2MQTT or deCONZ/Phoscon but they all have different pros and cons.

PS: Tuya or Aqara/Xiaomi are infamous for not following Zigbee specification standards so almost all their devices need developers to make custom device handlers that parse and translate each device.