Properly controlling brightness of Ikea Tradfri bulbs using ZHA and Node-Red with the brightness_move attribute

I am trying to control the dimming of Ikea Tradfri bulbs using the elegant brightness_move attribute that they have internally for this. You can just set a brigthness_move to a value in units/sec and then set it to 0 when you want to stop the dimming. This is way more elegant than using loops and sending continuous packets!

I got the idea from this video: https://www.youtube.com/watch?v=fwczsNdng3E and also shown in this post here: Dimming ikea lights with ikea dimmers the right way in nodered

Both do this using mqtt but I am hoping that I can do this with ZHA by sending a message with a payload as shown below:

I am trying to find a way to do this with a regular “call service” node in ZHA?

I have tried to send the command using the turn_on from the light, and just sending a zigbee command using ZHA (I guess this will be the way to get it to work):

However, when I do this it stops me from being able to send the command to the light:

1/13/2024, 2:08:40 PM[node: zha_debug_command](http://homeassistant.local:8123/api/hassio_ingress/R3oCy1HM2wOa4U2P4C960a53rKGHvLa0IK7HzRtUi1U/#)zha_event : msg.payload.event.command : string[4]

"move"

1/13/2024, 2:08:40 PM[node: Dim Ravi Desk](http://homeassistant.local:8123/api/hassio_ingress/R3oCy1HM2wOa4U2P4C960a53rKGHvLa0IK7HzRtUi1U/#)msg : error

"HomeAssistantError: extra keys not allowed @ data['brightness_move']"

1/13/2024, 2:08:42 PM[node: zha_debug_command](http://homeassistant.local:8123/api/hassio_ingress/R3oCy1HM2wOa4U2P4C960a53rKGHvLa0IK7HzRtUi1U/#)zha_event : msg.payload.event.command : string[16]

"stop_with_on_off"

1/13/2024, 2:08:42 PM[node: Stop Move Ravi Desk](http://homeassistant.local:8123/api/hassio_ingress/R3oCy1HM2wOa4U2P4C960a53rKGHvLa0IK7HzRtUi1U/#)msg : error

"HomeAssistantError: extra keys not allowed @ data['brightness_move']"

It seems to not be accepting keys that are not the ones Home Assistant uses for its light control. This is a dimming command that the Tradfri bulbs definitely accept but I can’t seem to send them. I have tried this with bulbs connect directly to ZHA on my home assistant yellow as well as bulbs that are connected trhough the tradfri gateway. I can’t find a solution either way.

Any ideas on how to send this with ZHA or should I transfer everything to MQTT and try that approach?

It seems to not be accepting keys that are not the ones home_assist uses. This is a dimming command that the bulbs definitely accept but I can’t seem to send them. I have tried this with bulbs connect directly to ZHA on my home assistant yellow as well as bulbs that are connected trhough the tradfri gateway. I can’t find a solution either way.

Any ideas on how to send this with ZHA or should I transfer everything to MQTT and try that approach?

I have no knowledge about Node Red, sorry. But I had a similar idea with a “normal” automation. Maybe this can help you:
The Zigbee Command you’re trying to call is not supported by the service light.turn_on, that’s correct. What you probably rather need is zha.issue_zigbee_cluster_command, but to find all the parameters you could follow these steps:

  1. in HomeAssistant go to the ZHA-Device of your light (not just the entity)
  2. on top left there should be ‘Device Info’ Box → klick the overflow-menu (three dots)
  3. ‘manage Zigbee Device’ (or simmiliar, sorry but mine is not english) with the square icon
  4. popup opens
  5. under “cluster” tab, select “LevelControl” in the dropdown
  6. underneath, go to “commands” tab
  7. select your command in the dropdown (something like move or move_with_on_off or whatever)
  8. enter your required (*) parameters (with mine it’s move_mode and rate) sometimes the default 0 (or false for bools) does not allow you to click “Issue Zigbee Command” (or similar) at the bottom. Just enable/disable them or enter some other number, and then 0 again
  9. now either fill in the service call manually, or listen to the call_service event in another tab, click the “Issue Command” button in the Zigbee popup and copy it from there
    (I guess the most important things are endpoint_id, cluster_id, cluster_type, command, command_type)
    If you play around in the popup, sometimes some other parameters might appear in the service call (depending on what commands you selected beforehand). These can be removed in the actual call in Node Red or whatever automation.