Btw, for multi-button/function remotes like Aqara/Xiaomi Magic Cube you should really use Blueprints.
https://www.home-assistant.io/blog/2020/12/13/release-202012/#blueprints
https://www.home-assistant.io/docs/automation/using_blueprints/
The same really goes for any complex devices that feature more than lights control or basic sensors, and that goes not only for ZHA but also for Zigbee2MQTT, deCONZ/Phoscon, and Z-Wave JS as well.
https://community.home-assistant.io/c/blueprints-exchange/53
For the Aqara Magic Cube when specifically using ZHA check out these Blueprints:
https://community.home-assistant.io/t/zha-aqara-magic-cube-57-actions/297012
https://community.home-assistant.io/t/aqara-magic-cube-zha-51-actions/270829
https://community.home-assistant.io/t/aqara-cube-zha-simplified-face-based-device-control/388850
For the Aqara Magic Cube when specifically using Zigbee2MQTT check out these Blueprints:
https://community.home-assistant.io/t/zigbee2mqtt-xiaomi-cube-controller/393203
https://community.home-assistant.io/t/z2m-xiaomi-cube-controller/263006
For the Aqara Magic Cube when specifically using deCONZ/Phoscon check out these Blueprints:
https://community.home-assistant.io/t/mi-magic-cube-deconz-45-actions/256656
https://community.home-assistant.io/t/deconz-xiaomi-aqara-mfkzq01lm-cube-controller/255988
Here is a video by Jeff Geerling which clearly show experience before and after discovering Blueprints:
https://www.youtube.com/watch?v=gJFsZL5CTgM&ab_channel=JeffGeerling
PS: The real major difference between Zigbee based proprietary commercial gateways and an open-source gateway like ZHA and Zigbee2MQTT is that Zigbee based proprietary commercial gateways will come with preconfigured from that company with both custom device handlers as well as blueprint automations for the specific devices that they officially support as those have been specifically tested for full compatibility with that Zigbee gateway and its dedicated application, (which unfortunately usually is only their own brand of devices). So the developers of Zigbee based proprietary commercial gateways are normally trying to make their product interoperable with Zigbee devices from third-parties.