adminiuga / zha_custom Goto Github PK
View Code? Open in Web Editor NEW"zha_custom" component for Home Assistant. Zigpy commands service wrapper
"zha_custom" component for Home Assistant. Zigpy commands service wrapper
Suggest moving https://github.com/Adminiuga/zha_custom repository to -> https://github.com/zigpy/zha_custom
That way it would be found together with all other zigpy related repos -> https://github.com/zigpy/
Alternatively, maybe move to https://github.com/orgs/zha-ng ?
PS: zha_custom is still actively used by fork https://github.com/mdeweerd/zha_custom/
My experience of "removing" ZB3 bulbs that is working in real ZB3 mode is listening to the leav command but don't going in pairing mode and ending up in being in "Touch link modoe" and waiting for touch link initiating and not responding on "hardware reset" (6*on / off for IKEA) at all .
Both in deCONZ and Z2M users having problem that "hard" reset is not working on bulbs (most IKEA ZB3 but also others) and cant pairing devices (Its one firmware bug for 110%).
I have 2 times must using deCONZ with the old "webapp" for doing touch link reset of the bulb (and one time one wrong one in the kitchen 6 meters away). Then version 2 of RaspBee and CornBee have not the touch link implanted in the firmware its not possible for all user doing it.
Then all "normal" EZSP firmware have support for it so i was trying the Hue Thief that have working very well for some users. The problem its that the python 3.6 have broken some functionality and its not possible getting it to working. And the python 3.7 its possible getting the radio scanning working but not the consolle in/output (change in 3.7) is broken so its one dead end.
Was looking little and its one very small code that is used but the most is using one old (7.0) bellows for doing the hardware access (its working with newer bellows also if forcing updating it but not the last beta). Then I don't have the knowledge and experience of programming python i cant fixing it and making it working.
Then the most code is already in the "zigpy" (bellows) and the footprint is very small (300 lines) and the benefits large i suggesting that implanting it in the ZHA_CUSTOM as one more "service".
I don't knowing if more radios have support for it in the standard firmware (TI and dresden have it partly) so its not really belonging in ZHAs core.
If not possible putting it in ZHA_CUSTOM as service is still possible forking it and making one own project in zigpy and updating the code to py6.7/6.8 and using the installed bellows. That is making it useful for our user that getting device reset problems.
One other option is implanting it in zigpy / ZHA for more radio platforms and making one nice GUI in ZHA as deCONZ old "webbapp" and Z2M brand new front have with scanning, getting device list, Identify (blink) device and resetting device.
If i was having the knowledge of coding python i was having fixing it but sadly i don't have that.
Pleas taking one look and see if you can do some of it for zigpy or standalone installation.
Thanks in advance and also for all the work you have putting in bellows.
One user is having problem with one 200+ network with tuya TBGW that is updated to EZSP 6.7.8.0 from factory firmware 6.5.0.0 and is keeping the original config parameters in NVM and tuye is using key storage for all ZB3 devices and bellows is using hashed link keys
The that ending with that the key storage is not working then the new firmware have other setting then the original.
The network was getting one complete breakdown and hi is desperate getting it up and running.
The user is trying splitting the network to 3 or 4 system for getting up and working but its not so easy getting the NCP resetting but possible.
If implementing one "leave" function in ZHA_custom it being much easy to doing the oration, Sending the command and ZHA is very likely caching or getting problem but restarting ZHA shall forming the new parameters from ZHA config and all is being OK on the NCP side. Perhaps the command shall executing one (Z)HA restart command then its have executing the leave.
Not very nice way doing one reconfigure but its easy getting the user up and running but need "cleaning"" ZHA after that but better then having one 200+ network complete dead.
Or do you have one better way making the NCP being forces updating network key, PAN-ID and extended PAN-ID that is nervelessly for getting the network working OK without interfere with each other and getting thee "working mode" being initiated with "ZHA parameters" and getting the old away ?
Master @Adminiuga.
First i need explaining the basis for my "request".
I have large experience of communication / security systems and pretty novice in deep programing after trying BASIC in the school i was very disappointed and wos writing my code in assembler for MC6809 but was not working professional with it.
Logic and analytic thinking have always being my strong side then working with technical things.
And then cant finding the problem, then taking one step back and 2 to the side for seeing the problem from one other view.
After reading the 13-0402-13 Base Device Behavior Specification Version 1.0 and trying applying it one the silabs AN1233: Zigbee Security and was thinking the problem was rejoining devices in the network.
I have not finding any guide "how to implementing your custom EZSP coordinator" and i don't have your skills and experience of coding for NCPs.
Have "reading" the UG100: EZSP Reference Guide and trying finding out how silabs have implanting the Base-Device-Behavior in the EZSP concept. After one nights sleep I was rethinking and turing the problem around and was finding that the problem is not rejoining of devices, then the devices not in the network (reseted and dont have network or trustcenter link key in its key table).
Was finding 2 functions that catching my attention in the reference guide.
CearKeyTable and eraseKeyTableEntry.
It is not described how to using this on the host application side but its must being some logical behind them.
Back to our beloved bellows:
I think bellows is working more than well as secure Zigbee 3 coordinator but i have not trying it out so much and not over longer time. I have finding that is failing some fundamental functions that is not implanted for making it working "autonome" then joining devices that was paired in one network and stored in the NCPs key table and was resetted / removed from the network.
What i have see is that pairing devices then the NCP have its key table empty the NCP can adding new devices and its working well.
The fundamental thing is that then removing the NCP from the network (deleting it in ZHA) its still having the "old key table" saved in the chip. Then adding it to ZHA the key table in the chip is not being reseted and ther for using the "old key table" and can't (and should NOT do!!) updating the keys then the devices is not rejoining the network (if they don't have the,same key token) the devices is doing one new joining (pairing) and the NCP suld making one new key in the key table.
The logic is to erasing the key table then removing the NCP from the system. Then the NCP can adding new devices keys in the table then ZHA is adding new devices.
For testing this function its needed implanting from "UG100: EZSP Reference Guide EmberZNet PRO Release 6.8.0", 10 Security Frames fuktion:
Name: clearKeyTable ID: 0x00B1
Description: This function clears the key table of the current network.
Command Parameters: None
Response Parameters:
EmberStatus status The success or failure of the operation.
If pairing its working after key table is cleared its need being integrated in ZHA. Can being in "config" menu for the NCP and / or then deleting or adding the NCP in ZHA and also possible asking "delete the old key table in the NCP ?" can being good for keeping all paired devices security credentials then needed.
The next funktion is that ZHA its not deleting the key from one device in the NCPs table then deleting the device in ZHA.
Then deleted devices don't doing a "rejoining" (its dont have one network key or trustcenter link in its key table then its reseted) its doing on new pairing and therefore the old key in the NCPs table is useless and blocking the device from doing one new paring (perhaps bad for the user but its the secure way).
The logick is then deleting one device in ZHA also suld deleting the key in the NCPs table.
For testing this function is needed implanting from "UG100: EZSP Reference Guide EmberZNet PRO Release 6.8.0", 10 Security Frames fuktion:
Name: eraseKeyTableEntry ID: 0x0076
Description: This function erases the data in the key table entry at the specified index.
If the index is invalid, false is returned.
Command Parameters:
uint8_t index This indicates the index of entry to erase.
Response Parameters:
EmberStatus status The success or failure of the operation.
If pairing its working after the key is erased in the NCPs table then logic needs being integrated in ZHA for doing that automatic.
The normal suld being that ZHA is doing it then deleting one device in the GUI but it can also being good having it under the device property as "delete device key in NCP" thats making it possible resetting the device and repairing it without deleting it and is configuration in ZHA.
One thing that also can being god in the NCP config is "cleaning unused device keys in NCP table" for getting rid of "trash" in the key table that is not stored in ZHAs database for eliminating problems with "hidden ghost key" in the NCP.
I hope you is understanding my (un)logical thinking but i think this is the key for getting bellows working in real zigbee 3 mode without braking the security completely (as some other system have done).
Pleas integrating theses 2 functions in ZHA_CUSTOM so its being possible testing how the EZSP is handling the key table and if its working OK getting it implanted in the multiversion bellows (Bellows2 ?).
If you like opening for more advance testing and possible adding installation keys you can also inplanting:
Name: addOrUpdateKeyTableEntry ID: 0x0066
Description: This function updates an existing entry in the key table or adds a new one. It first searches the table for an existing entry
that matches the passed EUI64 address. If no entry is found, it searches for the first free entry. If successful, it updates the key data and
resets the associated incoming frame counter. If it fails to find an existing entry and no free one exists, it returns a failure.
Command Parameters:
EmberEUI64 address The address of the partner device associated with the Key.
bool linkKey An indication of whether this is a Link Key (true) or Master Key (false)
EmberKeyData keyData The actual key data associated with the entry.
Response Parameters:
EmberStatus status The success or failure error code of the operation.
One thing the "UG100: EZSP Reference Guide" i have looking in is "EmberZNet PRO Release 6.8.0" so it can being its not working with older versions without adapting the commands.
PS.
I have not looking on the TI chips implanting but Z2M have problem with the new texas adapters and need reflashing them for getting them working agen = can being bad keys in the table that the host and/or the NCP is not taking care of.
Have one nice weekend !!
Regard MW
As of version 2021.06
2021-06-03 22:23:10 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration zha_custom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-06-03 22:23:10 ERROR (SyncWorker_1) [homeassistant.loader] The custom integration 'zha_custom' does not have a valid version key (None) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.