Device firmware version is commonly reported to the cloud through the OTA service as shown in the fw_update example. The OTA service is often used for managing device updates remotely, making it a reliable and efficient choice for reporting firmware versions.
Alternatively, the firmware version can be reported using the LightDB State. For implementation details, check out the lightdb set example.