You could use zigbee2mqtt’s “experimental” feature “attribute_and_json”. Then send commands for colorXY and brightness in two separate channels. This allows to use a dimmer channel for brightness, where you can set minimum and maximum value.
This is how I configured my lamp (Aldi brand):
UID: mqtt:topic:mqtt_raspberry:ZigbeeRGBLight01
label: ZigbeeRGBLight01
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:systemBroker:mqtt_raspberry
location: Bedroom
channels:
- id: power
channelTypeUID: mqtt:switch
label: Power
description: ""
configuration:
commandTopic: zigbee2mqtt/ZigbeeRGBLight01/set
stateTopic: zigbee2mqtt/ZigbeeRGBLight01/state
off: OFF
on: ON
- id: dimmer
channelTypeUID: mqtt:dimmer
label: Brightness
description: ""
configuration:
commandTopic: zigbee2mqtt/ZigbeeRGBLight01/set/brightness
min: 0
stateTopic: zigbee2mqtt/ZigbeeRGBLight01/brightness
max: 254
- id: color
channelTypeUID: mqtt:color
label: Color
description: ""
configuration:
commandTopic: zigbee2mqtt/ZigbeeRGBLight01/set
colorMode: XYY
formatBeforePublish: '{"color":{"x": %1$s, "y": %2$s}}'
stateTopic: zigbee2mqtt/ZigbeeRGBLight01
(Note: removed some channels from the code for brevity)