Coder Social home page Coder Social logo

Comments (13)

mdeweerd avatar mdeweerd commented on August 19, 2024 2

You can checkout zha_toolkit.zha_devices .

It mostly gets the same information that you can view with zha-network-card and I notice there is a fork that improves on it .

EDIT: I improved on that last fork: https://github.com/mdeweerd/zha-network-card .

from zha-toolkit.

mdeweerd avatar mdeweerd commented on August 19, 2024 1

As @MattWestb indicated, the individual devices do not appear in the backup.

I downloaded a backup interactively and it turns out that the CLI output format is different and dos not correspond to the "open" format.

image

I did not find the "entry point" in the zha code part to properly extract the other format.

from zha-toolkit.

mdeweerd avatar mdeweerd commented on August 19, 2024

The core issue is this:

    result = await bellows_backup._backup(app._ezsp)
  File "/home/homeassistant/homeassistant/lib/python3.9/site-packages/bellows/cli/backup.py", line 88, in _backup
    assert status == t.EmberStatus.SUCCESS

So the questions are:

  • Is await bellows_backup._backup(app._ezsp) (still) the proper way to start a backup.
  • or, what is causing assert status == t.EmberStatus.SUCCESS to fail (i.e., why is bellows_backup._backup resulting in a failure).

Maybe some logging can be done with regards to why the backup process is failing.

Howver 2022.10.5 has integrated ZHA backups - I haven't verified how that works, but I know you can download a backup using the ui.

from zha-toolkit.

tunerooster avatar tunerooster commented on August 19, 2024

I am running 2022.10.5 and the issue occurs no matter the triggering mechanism. Ie, using the UI results in the same log messages (failure). I already have DEBUG logging set. The output provided is from the HA log. Are you referring to some other log? Can you be specific what I can try or post? Many thanks!

from zha-toolkit.

beren12 avatar beren12 commented on August 19, 2024

Similar thing here.

from zha-toolkit.

mdeweerd avatar mdeweerd commented on August 19, 2024

The title is probably too wide as I guess only the ezsp_backup is giving issues.

You are lucky I have started using an ezsp device myself...

v0.8.21 corrects the ezsp_backup which has some important differences from the znp backup method in zigpy.

I get a backup in my setup, I have not compared with what I can download using the UI, it looks ok apart from the fact that there are no children at all in the backup file.

from zha-toolkit.

MattWestb avatar MattWestb commented on August 19, 2024

@mdeweerd Bellows is using "hashed TC-Link keys" = calculated from the joining device IEEE) so its no device token stored for devices but i think one master key is stored as token on the coordinator hardware storage.

I think this is unique for EZSP and the backup is not working restoring on one other coordinator type and standard EZSP firmware is only having 8 key tokens so it can being problem restoring one larger system on one EZSP then link-keys cant being (re)stored.

But the good thing is EZSP have no limited how many device cant being joined (and the joiniee is getting one updated TC-Link key) then using hashed link keys as the other coordinator system is having.

from zha-toolkit.

tunerooster avatar tunerooster commented on August 19, 2024

Thank you!!! I installed v0.8.22 and the backup now appears to have run successfully. It created the file:

~homeassistant/.homeassistant/custom_components/zha_toolkit/local/nwk_backup_initial.json

With the contents:

    "node_type": 1,
    "node_id": 0,
    "node_ieee": "80:4b:50:ff:fe:0b:30:ae",
    "panId": 3204,
    "extendedPanId": "cc:cc:cc:cc:a9:a8:cc:84",
    "radioChannel": 11,
    "radioTxPower": 20,
    "nwkUpdateId": 0,
    "channels": 134215680,
    "tc_link_key": {
        "bitmask": 26,
        "type": 1,
        "key": [
            90,
            105,
            103,
            66,
            101,
            101,
            65,
            108,
            108,
            105,
            97,
            110,
            99,
            101,
            48,
            57
        ],
        "outgoingFrameCounter": 2928640,
        "incomingFrameCounter": 0,
        "sequenceNumber": 0,
        "partnerEUI64": "80:4b:50:ff:fe:0b:30:ae"
    },
    "network_key": {
        "bitmask": 3,
        "type": 3,
        "key": [
            161,
            64,
            181,
            254,
            132,
            204,
            168,
            169,
            161,
            64,
            181,
            254,
            132,
            204,
            168,
            169
        ],
        "outgoingFrameCounter": 19353634,
        "incomingFrameCounter": 0,
        "sequenceNumber": 0,
        "partnerEUI64": "00:00:00:00:00:00:00:00"
    },
    "key_table": []
}

Does that appear to be correct? I must misunderstand what is being backed up...

In Home Assistant (ZHA), I have some 42 zigbee devices and I would like to get device names and areas backed up, i.e., so I never have to one-by-one, reconfigure them again. Can you , or anyone, offer me any insight/advice regarding this?

Thanks again so much for your help!

from zha-toolkit.

MattWestb avatar MattWestb commented on August 19, 2024

One more problem the swapping EZSP coordinators is that the chip IEEE cant being changed like in IT then its onetime burned in the factory.

In the NCP firmware its possible one time writing one new IEEE that the NCP firmware is using and can being done with bellows but it can being redone without one erasing / patching of the token in the user data with one SWD flash tool like Silabs commander, Seeger flasher and so on.

If not changing the IEEE the swapping chip to the original chip some device that have being configured with binding and reporting the the old IEEE is not working OK until they is reconfigured / updated to the new one.

PS: I swapping NCP of then testing RCP firmware for thread / Zigbee and if i using the same chip for Zigbee NCP and flashing it with RCP all is working OK.

from zha-toolkit.

tunerooster avatar tunerooster commented on August 19, 2024

Is there any way to backup all device/entity ids, friendly names, areas etc.? I lost everything a while back and it took a lot of time pairing, renaming and reconfiguring everything. I have been searching for a full zigbee backup/restore procedure ever since and have yet to find a solution. It is what I was hoping zha_toolkit.backup would do that, but apparently not. Would anyone here know of such a thing? Thanks for any suggestions!

from zha-toolkit.

tunerooster avatar tunerooster commented on August 19, 2024

Thank you for the advice! Is there any way to import the data from zha_toolkit.zha_devices or zha-network-card after a loss?

from zha-toolkit.

mdeweerd avatar mdeweerd commented on August 19, 2024

There is no coded way to reuse that data after a loss.

I am not sure on how that would (have to) work.
When the configuration is lost, you likely need to pair the devices again.
At best, you could pair your devices again, and then some program could match the IEEE name to the logged entity name and rename the entity names.
Not sure if there is an official python method for that.
It would have to be coded.
One needs to keep a backup of the extraction of course.

from zha-toolkit.

tunerooster avatar tunerooster commented on August 19, 2024

Thanks again for your reply. I guess I will have to live with the risk. Regards!

from zha-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.