Wireless (Tuya based) Zigbee button not fully supported on HA

my old Tuya zigbee buttons worked flawlessly on home assistant (using sonoff zigbee dongle) so I decided to buy some more…

I bought two of these single buttons:
https://www.aliexpress.com/item/1005006877383125.html

and one of this double gang button:
https://www.aliexpress.com/item/1005004644217026.html

both of them suppose to have the functionality for:

  • single click
  • double click
  • long click

(the double gang is times two per each gang - so total of 6 possible automations)

if I pair them to Tuya using the Tuya zigbee hub, I have all the full functionality.
but if I pair them directly to HA using my Sonoff zigbee hub, it barely works…

the single button one is shown like this:

for some reason recognized as an on-off switch, but gives me the ability to get triggered by single click if I choose “Switch turned on/off”

the double gang one has a sensor “opening” and gives me these options:

  • Opening opened
  • Opening closed
  • and some firmware and battery stuff
    which none of them works…

is there a way to get them working somehow? maybe install something on my HA? I saw this zha-device-handle repo

but I don’t understand what to do with it and how to install
it won’t install it via HACS.

It looks like these buttons (TS004F) are not supported by ZHA or Zigbee2MQTT

how can you tell?
is there a way to verify that before I purchase something else?
or perhaps is there any workaround?

I do not use ZHA, but the Zigbee2MQTT Add-on instead.
If you do a search on the Zigbee2MQTT site for TS004F, you don’t find a solution.
This will say the device is not supported (yet).
Best thing what you can do is, first check if the wanted device is supported, then buy.

Such devices will need custom ZHA device handlers for translation (also known as “quirk” in ZHA), see:

It is similar for Zigbee2MQTT (Z2M) where a device handler is known as a zigbee-herdsman converter:

For ZHA read:

For Z2M read:

In summery; If you manage to pair a Zigbee device sucessfully with the ZHA integration then chances are good that it can be made to work even if none or not all attributes are exposed as entities in ZHA, but it means that the device will probably need a custom ZHA Device Handler (also known as a ZHA Quirk) coded for it in order to expose Zigbee clusters and attributes are not exposed as standard by default, however you either need to code such a custom quirk yourself or request device support hoping that someone else can help coding of a zha-quirk for it.

PS: Tip to new Zigbee users: Checkout blakadder’s unofficial Zigbee Device Compatibility Repository. Anyone can help maintain the site by submitting device compatibility information to it. The repository contains independent community member’s reports or device-specific pairing tips for several home automation gateway/bridge/hub software, including open-source Zigbee implementations, such as ZHA, Zigbee2MQTT, and Tasmota (Zigbee2Tasmota). However as it is only maintained by community volenteers submitting updates to it (similar to the concept of Wikipedia) there is not guarantee that it has up-to-date or accurate information, so just because a device is not listed there does not mean that it will not work.