[ST Edge] Is there a way to dynamically change ocfDeviceType?

Hi,

Is there a way to change device’s ocfDeviceType dynamically?
I suppose I could have multiple device profiles with only ocfDeviceType different and then change them with

https://developer-preview.smartthings.com/edge-device-drivers/device.html#st.Device.try_update_metadata

but it seems too complicated to just change an icon.

Another question, is it possible to create device profile on the fly?
I perhaps could read the original device profile and just change the icon and profile’s name and then update device metadata to the newly created profile.

Thanks

1 Like

Hi, @ygerlovin!

No, it cannot be modified from within the driver. try_update_metadata is an excellent approach, the specified device profile in the parameter overwrites the old one.

No, creating device profiles dynamically is not supported yet, even for the try_update_metadata, the device profile must already exist in the driver package.

I’ve been discussing your use case with the engineering team, when I have more information on other possible alternatives, I’ll share it with you.

1 Like

@nayelyz

Nayely,

The API reference suggests the devices endpoint has the ability to ‘update a device’. Specifically it implies that is is possible to change the label, location (sometimes) and room, and change the categories and icon for each component (accompanied by a broken link to /devicecategories and with no clues offered as to how icons are defined).

Elsewhere (probably buried in comments in the Core SDK or somewhere like that) it is implied that only changing the label actually works.

Would you happen to know what the truth of the matter is? The ability for an end user to be able to change the category and/or icon seems to be pretty much the functionality that has been asked about lately.

OK the mobile app makes a pig’s ear of categories at the moment, which is why community developers have been using ocfDeviceType in Edge drivers, but if it stopped making a mess of them it rather seems the required functionality is documented, if not actually implemented.

1 Like

I see, following the instructions in the API document the request is successful but the changes are not applied. I’m checking this with the engineering team, I’ll let you know more as soon as I receive their feedback.

1 Like