This is a collection of community drivers that support almost all popular Aqara/Xiaomi Zigbee devices :
You can look for an example of Aqara relays decoupled mode (smart bulb mode) configuration in @dandanache 's 'Aqara Dual Relay Module T2 (DCM-K01)' driver code.
Aqara/Xiaomi Zigbee devices use a TLV (Tag-Length-Value) encoding data structure to report a set of parameters specific to each device periodically. BTW, TLV encoding is also used in the Matter protocol. The big difference between the Matter TLV and Aqara TLV is that the latest is not officially documented ...
The community drivers contain various custom implementations of the Aqara TLV decoding. Jonathan's 'Aqara Human Presence Sensor FP1' driver provides an excellent code example.