Length limit for code names?

I'd like to set code names as Hubitat-${uuid_from_my_db}, but sometimes it looks like the API rejects this and sets the code name as Code #2 for some reason. Is there a length limit or a specific format that code names must follow? The documentation around this is quite sparse. Thank you!

Sounds like you're using some unspecified third-party integration that happens to use Maker API on the Hubitat side, in which case you'd need to provide more information about what that is (unless someone can guess based on your question).

Or if you're asking about a specific device via Maker API (and anything that uses it), the data you send with the command should be the same as whatever the device command on Hubitat accepts. I suspect this is not the question, as the only thing I can think of are numeric lock codes that don't line up with what's being asked...

Hiya!

Thanks for the response! Allow me to explain further

I'm actually building a third-party integration using the Maker API. We're trying to set access codes on locks.

If I send a request like so:

https://cloud.hubitat.com/api/${hub_id}/apps/3/devices/4/setCode/1,1000,Hubitat-6743a685-0aef-4088-a731-4d18462d437b?access_token=${access_token}

Sometimes the name parameter (Hubitat-6743a685-0aef-4088-a731-4d18462d437b) is set with the code, sometimes it will generate its own name (Code #1). This happens occasionally in the hubitat dashboard as well.

I think this has something to do with the length. So is there a length limit on the code name parameter?

I guess was actually a good guess after all. :slight_smile:

I suspect you're really dealing with a device/driver issue rather than something specific to Maker API or Dashboard, though anything is possible. To rule those out, I'd try the "Set Code" command directly from the device detail page and see what happens. Again, the behavior may depend on your specific device. Normally, code names are pretty short, like someone's name, but I don't recall any hard limits (if anything, I'd expect something on the attribute itself, which would be all code names and cods you see in lockCodes, rather than any particular part of it...but even then, attributes well over 1024 characters are technically valid, even though they are discouraged).