- 
                Notifications
    
You must be signed in to change notification settings  - Fork 7
 
Description
Hello, I am new to Zigbee stuff, so sorry if I am poisoning the issues section.
I know that the zigbee network can have multiple end-devices from various vendors and a coordinator.
End devices pair to the coordinator over the mesh network and the coordinator can poll the state of the end device and it can modify it too.
I have compiled esp_zigbee_ncp project in hopes that I would be able to control via a serial line to the esp32c6 and I would see pairing status of my outlet and that I would be able to toggle it on or off.
I see that the esp_zigbee_ncp listens on UART and has some specific protocol that zigpy-espzb might just implement.
I have however absolutely no idea how to use this repository and how to start up even a simple thing.
I have installed zigpy and zigpy-espzb.
I tried this code:
import asyncio, zigpy.config as zc
from zigpy_espzb.zigbee.application import ControllerApplication
CFG = {
    zc.CONF_DEVICE: {
        zc.CONF_DEVICE_PATH: "COM14",
        zc.CONF_DEVICE_BAUDRATE: 115200,   # int
    },
    "database_path": "zigbee.db",
    "ota": {"enabled": False},             # avoid provider schema
}
async def main():
    app = await ControllerApplication.new(CFG)
    try:
        await app.form_network()
    except Exception:
        pass
    print(await app.network_info())
    await app.permit(120)
asyncio.run(main())
and this is the error I am getting:
Traceback (most recent call last):
  File "C:\Users\Patrik\AppData\Roaming\JetBrains\PyCharm2024.2\scratches\zigbee_dzigat.py", line 22, in <module>
    asyncio.run(main())
  File "C:\Program Files\Applications\python_3_12_7\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Patrik\AppData\Roaming\JetBrains\PyCharm2024.2\scratches\zigbee_dzigat.py", line 14, in main
    app = await ControllerApplication.new(CFG)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\zigpy\application.py", line 237, in new
    app = cls(config)
          ^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\zigpy_espzb\zigbee\application.py", line 63, in __init__
    super().__init__(config=zigpy.config.ZIGPY_SCHEMA(config))
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\zigpy\application.py", line 70, in __init__
    self._config = self.SCHEMA(config)
                   ^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 549, in validate_dict
    return base_validate(path, data.items(), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 330, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 779, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 549, in validate_dict
    return base_validate(path, data.items(), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 330, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 590, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\voluptuous\schema_builder.py", line 779, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "C:\Program Files\Applications\python_3_12_7\Lib\site-packages\zigpy\config\validators.py", line 124, in cv_ota_provider
    provider_type = obj.get(zigpy.config.CONF_OTA_PROVIDER_TYPE)
                    ^^^^^^^
AttributeError: 'Ledvance' object has no attribute 'get'
I have no idea on how to get rid of that Ledvance error. I don't even know which library is misconfigured.
Can someone guide me on how to get the pairing done and polling/toggling of the outlet done?