For anyone stumbling onto this topic looking for a simple way of doing this before it's built-in, here is a method that can be used to write Long attributes:
ArrayList zigbeeWriteLongAttribute(Integer cluster, Integer attributeId, Integer dataType, Long value, Map additionalParams = [:], int delay = 2000) {
String mfgCode = ""
if(additionalParams.containsKey("mfgCode")) {
mfgCode = " {${HexUtils.integerToHexString(HexUtils.hexStringToInt(additionalParams.get("mfgCode")), 2)}}"
}
String wattrArgs = "0x${device.deviceNetworkId} 0x01 0x${HexUtils.integerToHexString(cluster, 2)} " +
"0x${HexUtils.integerToHexString(attributeId, 2)} " +
"0x${HexUtils.integerToHexString(dataType, 1)} " +
"{${Long.toHexString(value)}}" +
"$mfgCode"
ArrayList cmdList = ["he wattr $wattrArgs", "delay $delay"]
return cmdList
}