Skip to content

v2.11 - Multi-row devices are no longer collapsed

Choose a tag to compare

@Rouzax Rouzax released this 20 Aug 15:19
· 15 commits to main since this release

Fixes a data-loss bug. Update if you have any multi-unit device, most commonly a Central Scene remote.

What went wrong

A DeviceID is not unique in Domoticz. A multi-unit device is stored as one DeviceID with several Unit rows. The tool read only one of those rows, but wrote with WHERE DeviceID = ..., hitting all of them.

If you had named the units individually, a rename silently collapsed them:

BEFORE                      AFTER
Scene 1 Pressed             Living Room - Remote - Scene 1
Scene 1 Held        ───▶    Living Room - Remote - Scene 1
Scene 1 Released            Living Room - Remote - Scene 1

reported as Collisions: 0, defeating the guarantee the tool exists to provide. The undo statement also matched on DeviceID alone, so running the undo script overwrote all three rows with whichever single name had been captured, rather than restoring the originals. The documented recovery path destroyed the evidence.

What changes

The tool cannot rename these correctly. A single Z-Wave value yields a single label, so there is no information available to give three units three names, and someone who named them individually did so on purpose. Rows that disagree on name, switch type or custom image are now detected and skipped:

  !  1 device(s) skipped: several Domoticz rows share the DeviceID and disagree
     Renaming would collapse them into one name, and the undo script could not restore them.

Only devices the run would otherwise have renamed are reported. A Domoticz database holds devices from other hardware whose rows may also disagree, and warning about devices this tool never touches would just be noise.

Collision detection now also treats every distinct name in DeviceStatus as taken, rather than one name per DeviceID. Names owned by a non-primary row were previously invisible, so another device could be renamed onto one and create exactly the duplicate the detection prevents.

Devices whose rows agree are unaffected and rename exactly as before. The summary gains an Ambiguous field that appears only when it is above zero, so an ordinary run's output is unchanged.

Also in this release

  • A documentation site at https://rouzax.github.io/Rename-Domoticz-From-ZwaveJSON/, with a per-platform install guide covering Windows, macOS, Debian/Ubuntu, ARM Linux and Fedora/RHEL. The README is now a 78-line shop window instead of 616 lines.
  • A runtime-only dist branch, re-synced on every release, so git clone -b dist gives you just the files needed to run the tool.
  • Corrected reference data. Writing the docs against the script rather than the old README surfaced several long-standing errors: CustomImage value 9 was labelled "Fire" but is "Computer", the SwitchType and CustomImage tables held only 7 of 21 and 3 of 7 rows, and rename_rules.json loads from the script's own directory rather than the working directory.
  • Comment-based help no longer advertises a -WhatIf alias for -DryRun. It was removed in 2.4 and the help was never updated.

Preview with -DryRun first, as always.