Manually renaming them all was way too much work, and worse:
- I ended up with devices having the same name, which completely broke my dzVents scripts (ask me how I know
). - Device naming was chaos, making it harder to keep an overview.
- Smoke detectors didn't have a Reset button, motion sensors had wrong icons, etc.
So I created a PowerShell script to bring order to the chaos and harmonize all device names automatically.
GitHub: Rename-Domoticz-From-ZwaveJSON
What does it do?
- Reads your Z-Wave JS JSON export.
- Creates a consistent name for each Domoticz device:
Code: Select all
[Room Name] - [Device Name] - [Property Label] - Applies renaming rules for common cases (Current Value, Watt/kWh, Temp, Lux, Motion, etc.).
- Fixes device types: Smoke detectors get a Reset button, motion sensors show the right icon, alert sensors can't be accidentally toggled.
- Preserves $ prefixes if you use those in Domoticz.
- Ensures no duplicate names, which is a lifesaver for dzVents scripting.
- Runs everything in a single transaction and makes a backup of your DB first.
- Generates an interactive HTML report with search/filter to review all changes.
Examples
After running the script, devices look like this:
Code: Select all
Kitchen - Dining Table Light
Kitchen - Dining Table Light [kWh]
Kitchen - Dining Table Light [W]
Porch - Sensor - LED: Blink on Motion
Shed - Ventilation Hood - Heat Alarm
Driveway - Sensor - Lux
Driveway - Sensor - TempHow to use
1. Stop Domoticz so there is no lock on the database.
2. Copy your domoticz.db to a safe working location where you will run the script.
3. Export your full Z-Wave JSON in Z-Wave JS UI:
General Actions → Dump → EXPORT
4. First do a dry run to preview changes:
Code: Select all
powershell
.\Rename-Domoticz-From-ZwaveJSON.ps1 -JsonFile "nodes_dump.json" -DbPath "domoticz.db" -DryRun
5. Check the generated HTML report to see what will be renamed.
6. If everything looks good, run without -DryRun to apply changes:
Code: Select all
powershell
.\Rename-Domoticz-From-ZwaveJSON.ps1 -JsonFile "nodes_dump.json" -DbPath "domoticz.db"
7. Copy the modified DB back to your Domoticz folder and restart Domoticz.
Note: This modifies your Domoticz database directly.
The script will create a timestamped backup automatically and generates an undo SQL script if you need to revert, but I still recommend making your own backup before use.
Hope this helps some of you who, like me, got lost in the sea of Z-Wave device names!