Successfully migrated from ZHA to Z2M without re-pairing #24478
Replies: 12 comments 35 replies
-
Interesting! Had a chat with @Nerivec about this, it should be easy to add an automatic interview when an unknown device sends a message. So the procedure would be:
|
Beta Was this translation helpful? Give feedback.
-
What to do after coming home from a nice party? Feed the cats and deliver the code, of course! Note: The most straightforward way would be to instruct users to download a backup from ZHA and then disable it. However, you could probably also just curl the backup from the other extension.
|
Beta Was this translation helpful? Give feedback.
-
Does |
Beta Was this translation helpful? Give feedback.
-
I was able to download zigbee.db on a HAOS OVA install by using the File editor addon. Then dumping some attributes from it there are quite a few tables and they are versioned:
I think we're only interested in
There's not a good way of exporting devices from HA and I don't have access to |
Beta Was this translation helpful? Give feedback.
-
Thanks for this. Note that the ext_pan_id is in reverse order in the Z2M configuration vs. a ZHA backup for me (no clue who is right) ZHA backup "network_info": {
"extended_pan_id": "7e:51:d3:4f:64:50:5a:6e", Z2M config ext_pan_id:
- 110
- 90
- 80
- 100
- 79
- 211
- 81
- 126 |
Beta Was this translation helpful? Give feedback.
-
Tried following this but something is unhappy:
A quick web search suggests that maybe the problem is that there are other routers around that are still running the network and that's causing some kind of conflict? |
Beta Was this translation helpful? Give feedback.
-
I want to say thank you for this thread, and add some notes for anyone else who wants to try this:
So it took me a while to realize that was why it said this.. I originally assumed it was smarter than me, but none of my devices were talking right. Eventually I used the settings/advanced menu of z2m's front end to reverse the bytes and that fixed it (I assume deleting the
|
Beta Was this translation helpful? Give feedback.
-
Happy new year everyone. I'm starting from scratch on the zigbee2mqtt side. Provided Z2M configuration is complete (Zigbee network...), does it hurt to start without a device list so that I get the base |
Beta Was this translation helpful? Give feedback.
-
So here's what I did. Based on details in pretty much all previous posts. I performed data manipulation on the side for ease of use, config files are copied back and forth with the machine running zigbee2mqtt.
Everything works. |
Beta Was this translation helpful? Give feedback.
-
Dear all, |
Beta Was this translation helpful? Give feedback.
-
Would someone be able to write a (detailed) howto on how to do this? I've started of with ZHA but feel this is a mistake:
You would have everlasting ❤️ 🙏 . |
Beta Was this translation helpful? Give feedback.
-
I believe this should work? Using the Home Assistant Terminal and Studio Code Server add-ons (for easier editing/access), in Terminal run: $ tail -n 1 config/zigbee2mqtt/database.db
# note the highest ID value, replace below where it says "+ 2"
$ sqlite3 config/zigbee.db
sqlite> select CONCAT('{"id": ', (ROW_NUMBER() OVER (ORDER BY d.ieee)) + 2, ', "type": "EndDevice", "ieeeAddr": "0x', REPLACE(d.ieee, ':', ''), '", "nwkAddr": ', d.nwk, '}') FROM devices d JOIN endpoints e ON d.ieee = e.ieee ; This will give you a list like {"id": 8, "type": "EndDevice", "ieeeAddr": "0x00178801023dd160", "nwkAddr": 23188} That you should be able to paste into the zigbee2mqtt/database.db. |
Beta Was this translation helpful? Give feedback.
-
@Koenkk First of all, love the project! Thank you! I'm so glad to be able to set light gradients on my Signe again, and the software updates are a welcome plus (for no reason other than feeling up to date).
So, I've had a fun night and automated the device migration part with a script:
database.db
entry, e.g.:zigbee2mqtt/database.db
zigbee2mqtt/configuration.yaml
:This could be automated further for a full ZHA import:
I guess you know all this already, but I've read quite a few forum discussion and watched youtube videos where people crawl through their homes, re-pairing all of their devices manually 🤭
I could write this as a standalone TS script if you're interested?
Beta Was this translation helpful? Give feedback.
All reactions