Skip to content

Instantly share code, notes, and snippets.

@EverythingSmartHome
Last active February 18, 2024 11:51
Show Gist options
  • Save EverythingSmartHome/990f2436608fd347cd20cf0009b5cef4 to your computer and use it in GitHub Desktop.
Save EverythingSmartHome/990f2436608fd347cd20cf0009b5cef4 to your computer and use it in GitHub Desktop.
Zigbee Network Migration
#Check new adapter is found
lsusb
#Check which port new adapter is on
ls -lah /dev/tty*
# Enter Home Assistant container
docker exec -it homeassistant /bin/bash
#Install open-coordinator-backup
pip install zigpy-znp 'git+https://github.com/puddly/bellows@puddly/open-coordinator-backup'
#Start backup process (replace with your device address)
bellows -d socket://YOUR_IP_OR_ADDRESS backup > /config/zigbee-backup.json
#Restore backup to new adatper (replace with your adapter)
python -m zigpy_znp.tools.network_restore /dev/ttyUSB0 -i /config/zigbee-backup.json
#Change to storage directory
cd /config/.storage
#Backup config file
cp core.config_entries core.config_entries.backup
#Edit config file
vi core.config_entries
#Find ZHA using the forward slash key and search for zha. Edit path and radio type as applicable. Press escape and type :x and hit enter to save.
@anoril1979
Copy link

I installed Python on Windows platform with all the components. SQLite3 is OK, ZigPy is ok, etc. but running zigpy command returns a missing zigpy-cli module, while this exact one is listed as installed by pip list command.
I'll wait for this to be ironed before to migrate my zigtbee gateway :P

@10165joe
Copy link

Hi, I get the following error when trying to install bellows branch
This branch is obsolete! Please test zigpy/zigpy-cli#2 instead
however if i try this, i get...
fatal: repository 'zigpy/zigpy-cli#2' not found

any help would be greatly appreciated.. thanks :-)

@Aham330
Copy link

Aham330 commented Apr 13, 2022

Hi @10165joe i believe I used this video to
update my Sonoff 3.0 dongle
Plus.

https://youtu.be/iCE5Z43EKpk

Then used the zha_toolkit through HACS to update my Zigbee network. Rewrote and renamed some devices (needed to be done anyway) also
Looked at the automations and changed some of those. All in all about 2 hours. Having about 30 devices.

Overall very happy because the Sonoff seems much more stable than the cc2531 that I had.

@10165joe
Copy link

Hi @10165joe i believe I used this video to update my Sonoff 3.0 dongle Plus.

https://youtu.be/iCE5Z43EKpk

Then used the zha_toolkit through HACS to update my Zigbee network. Rewrote and renamed some devices (needed to be done anyway) also Looked at the automations and changed some of those. All in all about 2 hours. Having about 30 devices.

Overall very happy because the Sonoff seems much more stable than the cc2531 that I had.

Perfect! thanks

@plankto
Copy link

plankto commented Jun 26, 2022

I just went through this and got stuck with the obsolete branch, switching out the following commands worked for me.

#Install open-coordinator-backup
pip install 'zigpy>=0.47.0' 'zigpy-znp>=0.8.0' 'zigpy-deconz>=0.17.0' git+https://github.com/puddly/zigpy-cli.git@puddly/zigpy-radio-api git+https://github.com/puddly/bellows.git@puddly/zigpy-radio-api

#Start backup process (replace with your device address)
zigpy -vv radio ezsp socket://YOUR_IP_OR_ADDRESS backup /config/zigbee-backup.json

#Restore backup to new adatper (replace with your adapter)
zigpy -vv radio znp /dev/ttyUSB0 restore /config/zigbee-backup.json

@ernst77
Copy link

ernst77 commented Jul 19, 2022

I just went through this and got stuck with the obsolete branch, switching out the following commands worked for me.

#Install open-coordinator-backup pip install 'zigpy>=0.47.0' 'zigpy-znp>=0.8.0' 'zigpy-deconz>=0.17.0' git+https://github.com/puddly/zigpy-cli.git@puddly/zigpy-radio-api git+https://github.com/puddly/bellows.git@puddly/zigpy-radio-api

#Start backup process (replace with your device address) zigpy -vv radio ezsp socket://YOUR_IP_OR_ADDRESS backup /config/zigbee-backup.json

#Restore backup to new adatper (replace with your adapter) zigpy -vv radio znp /dev/ttyUSB0 restore /config/zigbee-backup.json

this does not work either...

@sorenjacobi
Copy link

sorenjacobi commented Oct 9, 2022

This worked for me:

pip install 'zigpy>=0.47.0' 'zigpy-znp>=0.8.0' 'zigpy-deconz>=0.17.0' git+https://github.com/puddly/zigpy-cli.git@puddly/zigpy-radio-api

python -m zigpy_znp.tools.network_backup /dev/ttyUSB0 -o /config/zigbee-backup.json

Read more here: https://github.com/zigpy/zigpy-znp/blob/dev/TOOLS.md#backup-and-restore

@puddly
Copy link

puddly commented Oct 9, 2022

Please use ZHA's migration interface, there's no need to use the command line tools. If you still want to do it over the command line, use zigpy-cli: https://github.com/zigpy/zigpy-cli#network-backup

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