How can you change the ‘name’ that a device shows in the IDE or in smartthings devices
on the CLI? This is different than the label shown in the app itself. It looks like the ‘name’ field is populated with the name of the profile that was used when it was initially created. It doesn’t seem to update if you change the profile with try_update_metadata
in the driver code. How can this be changed?
You should be able to change it via the CLI.
True. I can also change it in the IDE. I meant to ask about changing it from code in an Edge driver.
Does that work? I’ve never tried it. It probably shouldn’t because name
is defined as being set by the device integration and isn’t supposed to be valid for device updates.
Yes, that is certainly the case.
On the legacy platform the name
is essential and the label
is optional, so I am rather wondering if the only reason the name
is populated on the current platform is to keep the legacy platform happy.
It does seem like the name
is intended to be set at device creation time by the integration and then left alone, which is in keeping with other API objects, and certainly the API doesn’t claim to allow it to be changed. However it also doesn’t claim to allow the device profile of a device to be changed and clearly that can be done with Edge drivers.
It could be that using the profile name seemed like a good idea at the time and then they started supporting changing the profiles and it didn’t seem so good but there were bigger fish to fry. It probably is redundant once the legacy system goes away.
It could be worse though. Location Modes have a name
and a label
too and the name
is what you called it originally.
I definitely use the profile updates. I was expecting the name to follow that profile. There doesn’t seem to be an issue with it not changing. It’s just confusing when you see it in the CLI and it doesn’t match.
My drivers integrate with external hubs and those hubs expose new functionality on their devices regularly. Changing the profile is the only way to add those capabilities. Otherwise, the devices would have to be deleted and reimported with each new feature.
I should note that I bumped into a terminology problem with my previous post. As ever with SmartThings the same term gets used in more than one way.
TL;DR What I was saying is that there isn’t supposed to be a way of update a device name
, but there isn’t supposed to be a way of changing a device profile
either and yet that happens. A device profile is related to, but not the same thing as, the profile in your driver.
Long version …
The Edge driver ‘profiles’ are exposed in the driver metadata in the API as the deviceIntegrationProfiles
with an ID and a version. Like this:
"deviceIntegrationProfiles": [
{
"id": "302aa9bb-35e2-34a7-aec5-1460e5a998f9",
"majorVersion": 1
}
],
If you try to look these up in /deviceprofiles
in the API they won’t be there.
However in the device object there is also a ‘profile’:
"profile": {
"id": "ffb30ec3-e275-354d-9482-9abbe4172416"
},
You will find that one in /deviceprofiles
and if you do it will look very like the ‘profile’ in the driver but not quite the same. There is obvious a link of some sort but it isn’t completely clear what it is.
If you use try_update_metadata
to change the ‘profile’ in an Edge driver that will result in the profile in the device also being updated. My point was that there isn’t any documented way of doing that and yet it happens, and so who knows what else is possible?
Yes, I totally agree.
Yep, here are the commands in the CLI to do both.
devices:rename rename a device
devices:status get the current status of all of a device's component's attributes
devices:update update a device's label and room
Those only change the label
of the device, not the name
.

Those only change the
label
of the device, not thename
.
Interesting. The behavior of the CLI has changed then because in the past, I was able to change the name to something more friendly than the profile name used when a device is onboarded.
Here are two devices running the same driver:
37 Guest Bedroom Right Wall GE Outlet ZWAVE 433b0f1a-1c97-4836-b6b7-b123712f6cb6
83 Traffic Signal ge-outlet-scene ZWAVE 33461da0-5d43-4b30-ae21-97996b5a9442
I changed the first one when I first switched over to Edge drivers. The second one I had to re-enroll after a power outage forced it offline and it wouldn’t respond.