Can you use zigbee cluster commands in automations?

Hi there, I just started with Home Assistant. I am implementing some automations. I am working on one where “I believe that it would be easier if I could execute a zigbee cluster command directly from the automation”.

A command for example that I am interested in is in the screen shot below:

I use brightness step functions to increase or decrease the brightness of a light bulb step wise. This was easy to do since there is the possibility to use brightness_pct: -20 (which decreases the brightness by 20%; it’s just an example).
For the color temperature I could not find such a “data entry”. The Zigbee cluster command exists though and it works with my light bulb (see screen shot above).

I thought maybe there is a way to offset a cluster command directly somehow? Does anyone know or how did you guys handle it if you had a similar challenge? Appreciate any input.

Checkout ther “ZHA Toolkit” if want to try to go beyond some of the current limitations of the ZHA integration → GitHub - mdeweerd/zha-toolkit: 🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant

More discussion about zha-toolkit here (where it is probably better to post questions like that) → "zha-toolkit" - a big set of Zigbee commands on top of ZHA/zigpy

FYI, if a Zigbee device does not expose all the expected attributes then it might need a custom ZHA Device Handler (also known as a “quirk”), see → https://www.home-assistant.io/integrations/zha#how-to-add-support-for-new-and-unsupported-devices

That is, if expected clusters and/or attributes are missing then start by submitting a device support request under issues for the zha-device-handlers repository on GitHub to open a discussion with ZHA developers and other ZHA device handlers contributors → GitHub - zigpy/zha-device-handlers: ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.

You can issue zigbee commands using the ZHA provided service zha.issue_zigbee_cluster_command .

Or you can use zha-toolkit’s service zha_toolkit.zcl_cmd .

Both are similar, but zha-toolkit allows you to specify the device using one of its entities, and allows you to specify the number of times the command should be repeated until succes.

Further, zha-toolkit also allows you to send commands that are not know to zigpy or the zha-device-handler (quirk) as it will temporarily add a dummy command to the zigpy internals.

And you get the reply data back (not sure this is the case with zha).

As I am checking the Service UI, I notice that the dir parameter is not proposed - it defaults to 0 and you can add it in yaml if you need something else.
And I notice that the endpoint is not automatically determined at this time.