Start/Stop Brightness Level Change

I am controlling smart bulbs through both zigbee2mqtt and a hubitat hub (different bulbs from different controller). When controlling bulbs via Hubitat, I typically have the option to “start level change” where I select a direction and it starts transitioning toward min/max brightness depending on the selected direction. It also gives the ability to “stop level change”. This stops the transition wherever it happens to be.

I know I could start the level change in a direction with a payload like:
{
“brightness”: 255,
“transition”: 10,
}

2 questions:

  1. Does Z2M have the equivalent to start+direction and stop change commands that it handles in a way similar to the way you can arbitrarily set the transition time?
  2. If not is there anyway to learn what the current brightness level is during a transition, so I could send a brightness command with that particular level to lock in the brightness?

Well I am not sure if it is inherent to my Ikea bulb or Z2M, but somehow I overlooked this before posting and then found it almost immediately after. The answer is to use:

  "brightness_move": -40, // Starts moving brightness down at 40 units per second
  "brightness_move": 0, // Stop moving brightness

This is in the Z2M documentation at:

Hi tmichael,

I’m struggeling with a similar issue. I have the MOES dimmer, and it also has the brightness_move option. But how do you use it?

I’ve made this automation from the UI in Home Assistant, but do not know where to put the brightness_move.

In this example the light.dimmer1 is the MOES zigbee dimmer.

- id: '1638293700852'
  alias: DimDown
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: 7e2fb23f36fdb8a4caccc17b618bcd5d
    type: action
    subtype: brightness_move_up_2
    discovery_id: 0x000d6f000fd85946 action_brightness_move_up_2
  condition: []
  action:
  - device_id: 9c280499454573e2646ea8bd53f9917a
    domain: light
    entity_id: light.dimmer1
    type: brightness_decrease
  mode: single

The switch in this example is a zigbee battery switch:
https://www.zigbee2mqtt.io/devices/4512729.html

The dimmer:
https://www.zigbee2mqtt.io/devices/MS-105Z.html

Unfortunately, I don’t really have much in the way of experience with HASS. I do my control via Node Red. That being said, here is a little feedback on how I am doing what I want to do (not necessarily what you want to do).

I created a NR dashboard with 3 buttons (I am simplifying by removing other things unrelated to the dimming). It looks like this:
image
The first to buttons start ramping the brightness in the direction specified. The rate of that change is based on some math of how long I want it to take and whether that time is should be how long it takes to go from dimmest to brightest or from current to most extreme in the desired direction.

Net net, assuming the max brightness is 255, the current brightness is 215 and I want it to go to full brightness over the course of 1 second, then my flow sends the command:

{
  "brightness_move": 40, // Starts moving brightness up at 40 units per second
}

If I decide to stop the ramping up in the middle of the ramp, then I click the brightness stop button which sends this command to Z2M:

{
  "brightness_move": 0, // Stop moving brightness
}

I assume within HASS, there is some way to say when button A is pressed send the Z2M command

{
  "brightness_move": 40, 
}

when button B is pressed send

{
  "brightness_move": -40, 
}

when button C is pressed, send

{
  "brightness_move": 0 
}

That’s what’s behind my dashboard buttons.