# Enhancement: "compact device ID"

**URL:** <https://forum.genieacs.com/t/enhancement-compact-device-id/6426>\
**Category:** Uncategorized\
**Created:** [January 22, 2025, 3:09pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426 "2025-01-22T15:09:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![westnet-paul](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/westnet-paul/32/2239_2.png) [@westnet-paul](https://forum.genieacs.com/u/westnet-paul)\
**Post date:** [January 22, 2025, 3:09pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426/1 "2025-01-22T15:09:38Z")

</div>

I’m working on migrating from a 3rd-party ACS solution to a self-hosted GenieACS setup. I noticed that GenieACS is correctly following the TR-069 spec by including the DeviceClass in the generated device ID, but that’s causing me interop problems, because the old solution doesn’t.

For example, an AVM FRITZ!Box device will show up on GenieACS with device ID `00040E-FRITZ%21Box-D424DDF3ABD8` (the %21 in the device ID will be the subject of a follow-up bug report), but it appeared on the old ACS as `00040E-D424DDF3ABD8`, More to the point, the latter value is what’s printed on the box as the “CWMP ID”.

I’ve forked the repo and built an in-house version that uses a `CWMP_COMPACT_DEVICE_ID` flag to override the standards-compliant behaviour and always use only the OUI and serial number to generate the device ID. I’ve defaulted the flag to `false` to preserve the existing correct behaviour unless explicitly overridden.

OK to submit a PR? I’d prefer not to run a forked version if I can avoid it.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 22, 2025, 5:41pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426/2 "2025-01-22T17:41:37Z")

</div>

> [@westnet-paul](#):
>
> the %21 in the device ID will be the subject of a follow-up bug report

This is **not** a defect. This is by design. The component parts of the ACS ID are URL encoded.

---

<div class="post-metadata">

**Author:** ![westnet-paul](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/westnet-paul/32/2239_2.png) [@westnet-paul](https://forum.genieacs.com/u/westnet-paul)\
**Post date:** [January 22, 2025, 5:59pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426/3 "2025-01-22T17:59:40Z")

</div>

> [@akcoder](#):
>
> This is **not** a defect. This is by design. The component parts of the ACS ID are URL encoded.

Accepted. The bug comes when trying to create a task: if I use the device ID in the NBI URL, it gets decoded before attempting to retrieve the device from the database. So, if the `_id` in the database is `00040E-FRITZ%21Box-D424DDF3ABD8` and I attempt to create a task using that device ID, the actual `_id` value sent to MongoDB is `00040E-FRITZ!Box-D424DDF3ABD8` which obviously doesn’t match.

Any feedback on the proposed enhancement?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 22, 2025, 6:11pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426/4 "2025-01-22T18:11:02Z")

</div>

You need to encode the URI.

`00040E-FRITZ%21Box-D424DDF3ABD8` becomes  
`00040E-FRITZ%2521Box-D424DDF3ABD8`.

---

<div class="post-metadata">

**Author:** ![westnet-paul](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/westnet-paul/32/2239_2.png) [@westnet-paul](https://forum.genieacs.com/u/westnet-paul)\
**Post date:** [January 22, 2025, 7:30pm UTC](https://forum.genieacs.com/t/enhancement-compact-device-id/6426/5 "2025-01-22T19:30:01Z")

</div>

Yeah, that could work. URLencoding a URLencoded value is a bit meta, but hey.
