Release - Python Script to Mirror Device Names to Entity Names

I noticed while doing a new installation that it is much easier to name the entities during zwave pairing than the devices. Rather than go through each device to change it too, I wrote the python script below. It takes the defined custom name for lights, switches, and binary sensors and then applies that custom name to the corresponding device. It is easy enough to add additional domains to propogate, but you must be sure that you do not end up with more than one possible entity sharing a corresponding device id (like with a device that has both a binary sensor and a battery entity).

No warranties, though it does make a backup of both core files on each run.

Define the installation location at the top in install_location. This should point to the hidden folder for HA. No idea if this works on Hass as Iā€™m using Raspbian.

Usage:

1. Download the device_sync.py file and place it anywhere on the system
2. Run "python3 device_sync.py" as a user with write access to HA
3. Restart the HA server 

Enjoy:
https://github.com/blhoward2/ha-device-sync

1 Like