Open kucharskim opened 5 months ago
I think below helps, still testing...
--- /tmp/XXX-env/lib/python3.10/site-packages/bellows/cli/util.py.orig Thu Jan 25 08:55:02 2024
+++ /tmp/XXX-env/lib/python3.10/site-packages/bellows/cli/util.py Thu Jan 25 09:25:02 2024
@@ -52,7 +52,7 @@
zigpy_conf.CONF_DEVICE: {
zigpy_conf.CONF_DEVICE_PATH: ctx.obj["device"],
zigpy_conf.CONF_DEVICE_BAUDRATE: ctx.obj["baudrate"],
- zigpy_conf.CONF_FLOW_CONTROL: ctx.obj["flow_control"],
+ zigpy_conf.CONF_DEVICE_FLOW_CONTROL: ctx.obj["flow_control"],
},
zigpy_conf.CONF_DATABASE: ctx.obj["database_file"],
}
The bellows CLI isn't really maintained. The correct way to form a network is with zigpy-cli: https://github.com/zigpy/zigpy-cli#forming-a-network
@kucharskim For reference, the answer to this will probably be similar/same to answering replies here -> https://github.com/zigpy/zigpy/discussions/1342
It seems it's really poorly documented how to use zigpy. Bellows CLI doesn't work, zigpy-cli doesn't have commands to actually do much beyond form a network and directs back to bellows to do packet capture, and there isn't much of any documentation how to use the zigpy library directly.
I think that it is today you need to look the ZHA integration component code inside the Home Assistent core, but it now seems like that might change in the future. Check out the links in this discussion in the main zigpy project repository:
https://github.com/zigpy/zigpy/discussions/1207
as well as the related requests in this open issue that is asking for application examples:
I made the suggested change above, and the 'form' seems to work :) even allowing me to set a channel (because I had warning about busy channel 25). Also the 'permit' and 'info' seem to work. But the 'devices' never exits. 2 endpoints are listed IAS_CONTROL, and then CONTROLLER. (this is a sonoff USB dongle plus stick, Model ZBDongle-E) . For the Controller it shows input clusters: Basic(0) and at that point never exits. I've been through the code best I can, and it seems like it might be scheduler locking, still looking... Anyone got further than that please? Oh and I tried the suggested zigpy cli but seems not to support any cli control of devices.
As mentioned above, the bellows CLI isn't maintained at this point because it includes a lot of duplicate functionality from zigpy-cli, which uses up-to-date interfaces and works with every radio. Other than packet capture (which can be abstracted into a generic method within zigpy), everything else is radio-agnostic and should be supported within zigpy-cli.
If you want to make a PR adding the functionality you want to zigpy-cli, that would be much appreciated. The basic application startup sequence is shown in the permit
command: https://github.com/zigpy/zigpy-cli/blob/ab58a1b0c3d6e4670ab6af105e0fadc3310da2aa/zigpy_cli/radio.py#L167
Probably it is already in zigpy-cli, I just cant seem to find it, or any examples. I am just looking for basic functionality to read and write device attributes via zcl, and something equivalent to the bellows 'devices' command.