Device ID Assignment - Is it fixed and unique?

I'm looking for information on how device IDs are assigned in Maker. Not the Z-Wave Node ID, but the "id" field for a device in Maker API or eventStream.

Is the assigned device id guaranteed to be fixed for the lifetime of the hub (i.e., unless there's a hub "reset")?

I.e., if I pair 10 devices, then remove device id = 5, do they renumber or do the remaining devices keep ID 1, 2, 3, 4, 6, 9, 10. If I then add another, does it take the "5" slot or become 11?

Also, is there anyplace this id is shown on the Hubitat interface? I don't think there is - wondering if there is an easy way to correlate an ID seen on the eventStream with the devices. It would be handy, at the very least, for the list of devices selected in MakerAPI to show the id next to the device name. E.g., as "Bathroom Floods (47)" or something similar.

I think I read that the numbers are non-reusable.

While Hubitat staff would have to speak for sure about the inner workings of their database, this ID is assigned by that and not related to Z-Wave, Zigbee, or the protocol itself (as you seem to be aware of, so just to be clear to everyone that we're not talking about the "DNI"). In my experience, these are issued in ascending order, more or less sequentially, though it does occasionally skip some, perhaps based on time since last addition. I've never seen it go back and re-use unused/removed values. I have not gone nuts here and to see what happens if you exceed this max (likely a 32- or 64-bit integer if not larger, far more than most people would ever get to...), but perhaps it would start looking back then. :slight_smile:

In any case, to answer the second part of your question, these are exposed at a few places in the UI. Most easily (IMHO), in your browser, you'll see it in the URL for your device: http://YourHubIP/device/edit/555 when you're on the device page means that is device "555". You'll also see this in the "Logs" (as "dev:555" in the live list). The easiest way to get the other way, I'd say, is to put the URL in your browser and see what comes up.

For the most part, these numbers are just used internally and not intended for end-user consumption, and I don't know of an easy way to view all of them at the same time. In the case of MakerAPI (where perhaps this could be a feature request), if I'm curious about a specific correlation, sometimes it's easier to go to the gear/status page for that app and hover the mouse over all the selected devices on that page (where they should be listed) until I find one whose tooltip text/URL matches the ID. Not elegant but good enough for me. :slight_smile:

1 Like

Thanks! That's helpful.