Skip to content

sparkplug-unique-device-names#459

Open
nickAS21 wants to merge 2 commits into
thingsboard:mainfrom
nickAS21:sparkplug-unique-device-names
Open

sparkplug-unique-device-names#459
nickAS21 wants to merge 2 commits into
thingsboard:mainfrom
nickAS21:sparkplug-unique-device-names

Conversation

@nickAS21

@nickAS21 nickAS21 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Introduces a unique naming convention for Sparkplug devices to prevent naming collisions.

Key Changes:

  • New Format: All devices now use {groupId}:{nodeId}:{deviceId} instead of just deviceId.
  • Auto-Migration: Legacy devices are automatically renamed upon the first NBIRTH or DBIRTH message.
  • Label Fallback: The old short name is saved into the Label field to prevent data loss.
  • System Lookup: Added a secondary fallback cache lookup by the legacy short name before triggering a rename.

Action RequiredNo manual scripts needed. Please review dashboards or rule chains that strictly rely on the old deviceId naming scheme.

https://github.com/thingsboard/thingsboard-pe/pull/4398

Type of change

  • New / updated documentation page (src/content/docs/**)
  • Shared include file (src/content/_includes/**)
  • Component, layout, or styling change (src/components/**, src/styles/**)
  • Landing / use-case / case-study page (src/pages/**, src/data/**)
  • Redirects (src/data/redirects.ts)
  • Version bump / release (see release skill)
  • Build, CI, scripts, or tooling
  • Other (please describe)

Affected products

Related issues

  • Closes #

Checklist

  • pnpm check passes (Astro / TypeScript)
  • pnpm lint:eslint passes
  • pnpm lint:slugcheck passes (required if pages were added/renamed/moved across languages)
  • pnpm lint:linkcheck passes locally — required to merge; run it before requesting review (use pnpm lint:linkcheck:nobuild if you already ran a build)
  • Renamed/removed pages have a redirect in src/data/redirects.ts, and pnpm generate:redirects was run
  • No hardcoded versions — values come from src/data/versions.ts
  • Screenshots attached for visual changes

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Sparkplug API documentation to describe the new unique Sparkplug device naming convention ({groupId}:{nodeId}:{deviceId}) and its backward-compatibility migration behavior to avoid device naming collisions.

Changes:

  • Added a “Device Naming & Uniqueness” section describing the fully-qualified device naming format and migration behavior.
  • Updated the Sparkplug emulator/getting-started text and examples to reflect the new naming format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +24
To prevent naming collisions across different groups or nodes, ThingsBoard enforces a fully qualified, unique namespacing convention for all Sparkplug devices using their hierarchy:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

<Aside type="caution" title="Backward Compatibility & Migration">
The migration from short legacy names to full-path names is implicit and happens automatically upon receiving the first Sparkplug message (`NBIRTH` or `DBIRTH`) after the system update:

* **Device Renaming:** Devices previously identified only by their short `deviceId` are automatically renamed to their full Sparkplug path (`groupId:edgeNode:deviceId`).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment on lines +49 to +54
#### Naming Comparison Examples:

| Aspect / Context | Before (Legacy) | After (Current) |
| :--- | :--- | :--- |
| **EoN Node** (e.g., groupId: `Group_A`, nodeId: `Node_5`) | `Plant_A` | `Plant_A` *(or any unique name according to Sparkplug 3.0 requirements)* |
| **Child Device** (e.g., deviceId: `Sensor-01`) | `Sensor-01` | `Group_A:Node_5:Sensor-01` |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants