Best way to check Zigbee device firmware version in do_configure?

I know firmware version is in device.data.firmwareFullVersion, I use it in a custom driver for IKEA buttons so the battery report is handled correctly. However, almost no stock driver uses it and haven’t seen a usage inside do_configure handler.

Is the firmware version “guaranteed” to be available in do_configure? In other words, assuming the device reports it, is the configure lifecycle called after all the data is retrieved or is there a possibility that when checking the version that attribute is not populated yet?

Edit: BTW, looks like in older buttons device.data.firmwareFullVersion is nil, yet the SmartThings app displays the firmware version correctly in the information screen, maybe that’s not the correct attribute to check for firmware version?

Some stock drivers do use it - in init, though.

Edit: only 15 results on GitHub:

Maybe put a print or log in every life cycle handler to see where it’s available?

Yes, only few custom drivers use it and stock drivers only in one subdriver.

The question about it being the correct attribute is because it’s not always populated, seems to depend on the device, even if SmartThings can display the version in the app. Maybe there is a better way to check it or another attribute to check in case firmwareFullVersion is nil.

Hi @mocelet

We asked the engineering team, and they mentioned that obtaining this information is not possible within the driver.

If this value is populated, it is because it comes from the metadata of a migrated device.

However, it will not be populated for devices paired after the migration.

Thanks, although I don’t quite understand, do they mean the migration to Edge? I’ve only had SmartThings hub for a year so I don’t have migrated devices or past metadata and the attribute is definitely populated for many devices.

Edit: Funny thing, the only device where it does not populate seems to be the ikea tradfri 5-button. In the SmartThings app it displays the version (11115720) but device.data.firmwareFullVersion is nil. In all the other buttons the attribute is populated and matches what the app displays.

I guess the app displays the information from the firmwareUpdate capability, the currentVersion attribute is populated there.

1 Like

Can’t check this right now, but what about the attribute firmwareUpdate.currentVersion in the main component?

Like this (Z-Wave, but anyway):

It’s auto-populated and should be accessible (readable?).

1 Like

Yeah, I edited the message while you were writing and came to the same conclusion. However, I don’t get why the capability has the correct value yet the firmwareFullVersion attribute is nil, only in that device! :sweat_smile:

Edit: I believe that particular button has an ancient firmware and that’s why it’s not populated, in fact in the firmwareUpdate capability it now displays an error of updated failed with reason TOO_MANY_CLIENTS, which is weird since my understanding is that SmartThings doesn’t even update IKEA devices.

Another 5-button with a still old but more recent firmware has the value populated. So, yes, device.data.firmwareFullVersion seems OK except maybe for very very old firmwares so that’s fine, my goal was detecting if they are new firmwares and I’m fine with considering “nil” an old one.

1 Like