Zigpy-cc adds support for Zigbee adapters based on Texas Instruments chips

zigpy-cc libary by @sanyatuning for the zigpy project could soon add integrated native support for several inexpensive Texas Instruments based Zigbee USB sticks to ZHA component for Home Assistant

FYI, as I understand, zigpy-cc libary isn’t fully working yet but at least someone has started coding it.

zigpy-cc libary should in the future work with the ZHA (Zigbee Home Automation) integration for Home Assistant that @Adminiuga and @dmulcahey among others have made into very intuitive component to use and IMHO have finally managed to make Zigbee into a first-class citizen in Home Assistant

This will work by zigpy-cc library making zigpy compatible with CC2531 USB sticks and possibly also other TI CC chips if you flash them with the custom Z-Stack firmware from the Zigbee2mqtt project by @Koenkk (however this implementation is not dependent on having Zigbee2mqtt installed or running but is instead a native integration for Home Assistant so it will be very easy to get started)

@sanyatuning sorry if leaked this before you are ready to release it however the news of native support for cheap CC2531 based USB sticks was just too exciting to keep to myself

2 Likes

It looks like @sanyatuning has now submitted initial Beta support for Home Assistant’s ZHA integration

  • Texas Instruments CC253x, CC26x2R, and CC13x2 based radios (via the zigpy-cc library for zigpy)
    • CC2531 USB stick hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project
    • CC2530 + CC2591 USB stick hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project
    • CC2530 + CC2592 dev board hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project
    • CC2652R dev board hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project
    • CC1352P-2 dev board hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project
    • CC2538 + CC2592 dev board hardware flashed with custom Z-Stack coordinator firmware from the Zigbee2mqtt project

I’ve been trying to add the CC2652R (with CC26X2R1) in ZHA with no luck, whereas I can in zigbee2mqtt.

I just get the error that the device can’t be connected (after a few seconds “loading”).

image

Just in case, I stoped zigbee2mqtt beforehand.

I’m interested in how this is working for everyone? I gave it a bash but I’m seeing unpredictable results. My Phillips hue lights sometimes fail to to turn on even though the sensors reported movement and the commands been set through NR. I’m new to the ZHA side of things so gonna dig through the logs and see if I can work out why its sometimes failing.

Just noticed it’s actually beta and there was a custom repo to add the dev versions of zigpy/zigpy-cc, I’ll give this a go in the meantime.

Yes there is only exprimental/beta support for TI CC modules for now. Instructions on how to test newer development releases of zigpy-cc outside the release-cycle of Home Assistant is available here:

I would not recommend using a TI CC adapter with ZHA yet this unless you are willing to help alpha/beta test this for bug-testing purposes only in order to help further development to benifit eveyone.

I may already moved everything over. I’ll add some comments to the github when I’ve managed to dig through the logs.

Hello… Did you get any updates since? :slight_smile:
I’m also on my way to migrate away from a RPi+Raspbee setup towards a Dockerized HA + CC2351 + ZHA, so any updates are welcome :+1:t2:

I’m running the 4.4 release, all seems to work well. If i restart HASS a couple of lights wont turn on the first time but this seems to resolve itself after a while.

1 Like

Ok great news, thanks.

Let’s see when I can have time to flash the CC2351 and debug away…

Fingers crossed! :crossed_fingers:t2:

I have a Texas Instruments CC2531 USB
under Supervisor|System|Hardware, these serial devices are shown:
/dev/ttyAMA0
/dev/ttyACM0
/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D956FC-if00

The instructions for adding Zigbee Home Automation [ZHA] say:
Most devices need at very least the serial device path, like /dev/ttyUSB0,
but it is recommended to use device path from /dev/serial/by-id folder,
eg /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C0F003D3-if01-port0

although the devices shown by HA say /dev/serial/by-id/…
there is no such directory

Creating a new integration for ZHA, only shows /dev/ttyAMA0 - ttyAMA0, s/n: n/a
for serial device path
If I choose enter path manually, then enter
/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D956FC-if00
I get error user input malformed

even entering a path manually of /dev/ttyACM0
results in error user input malformed

Error is likely that it can not access the USB device or your device hardware or firmware has issues.

General advice not posted there is to first try another different USB port-and reboot or at least re-seat it.

I know that there are also known issues with some firmware versions for the CC2531 so try upgrading:

https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator

If you do not own a CC-Debugger adapter for flashing then try zigpy-znp on a seperate Linux computer:

https://github.com/zha-ng/zigpy-znp

There are then tips and instructions for troubleshooting towards the end on the ZHA component page:

https://www.home-assistant.io/integrations/zha/

If none helps then you should consider creating a bug-report for the ZHA integration via GitHub:

https://www.home-assistant.io/help/reporting_issues/

ZHA integration is part of the Home Assistant “core” application:

https://github.com/home-assistant/core/issues

Sorted!
Added these lines to configuration.yaml

zha:
  radio_type: ti_cc
  usb_path: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D956FC-if00
  baudrate: 115200

The line usb path is found at: Supervisor|System|Hardware

2 Likes

It all went well, integrated the first door sensor.
Tried to add the second - the first one is now unavailable!
Keep trying!!!
VERY Beta at the moment?

Yes support for Texas Instruments adapters is still somewhat experimental, integration page says so:

Tip is to buy a compatible Silicon Labs based adapter if want the most stable experinence today.

Any update here for CC2531 and ZHA integration? I just ordered a few and would love to try it in HA without changing my setup to Zigbee2MQTT

Yes, there are some updates in regards to CC2531 for the ZHA integration in Home Assistant, also remember to keep checking in on the documentation as it gets updated from time to time https://www.home-assistant.io/integrations/zha/

Firstly, the latest recommendation is to not buy CC2530 or CC2531 for production. They are however still the lest expensive adapters so they are still recommended for testing and experimenting before you go all-in on Zigbee.

Secondly is recommendation to use “zigpy-znp” instead of “zigpy-cc” radio library (setup option ZHA).

Thirdly is recommended to update the firmware to Z-Stack 3 (Z-Stack 3.0.x) before starting using it as it more stable and will give you an easy option to upgrade to newer radio adapter for production later. Instructions on how to upgrade firmware and hardware can be found in https://github.com/zigpy/zigpy-znp/blob/dev/README.md

Interesting you say to flash it with 3.0.x firmware. The ZHA official integration link you posted specifically says 1.2.x firmware. Are you positive?

Texas Instruments based radios with Z-Stack Home 1.2.x (via the zigpy-cc library for zigpy)
CC2531 USB stick hardware flashed with Z-Stack Home 1.2.x coordinator firmware

Yes I am sure and no that is not quite all that the ZHA integration page says so that might be confusing.

Fact is CC253x is not recommeded for production in ZHA regardless of firmware. Z-Stack 3 on CC2531 with zigpy-znp is experimental, but so is Z-Stack Home 1.2 with zigpy-cc, and zigpy-znp is more stable.

https://github.com/zigpy/zigpy/discussions/618

ZHA integration page https://www.home-assistant.io/integrations/zha/ list Texas Instruments based radios with Z-Stack Home 1.2.x (via the zigpy-cc library for zigpy) under “EXPERIMENTAL SUPPORT FOR ADDITIONAL ZIGBEE RADIO MODULES”, meaning that Z-Stack Home 1.2.x with zigpy-cc is not recommended for production with ZHA.

Though under “KNOWN WORKING ZIGBEE RADIO MODULES” it lists Texas Instruments based radios with Z-Stack 3.x.x (via the zigpy-znp library for zigpy) and if you follow the zigpy-znp link instead of the Zigbee2MQTT link you will find https://github.com/zha-ng/zigpy-znp project readme file.

Now if you read the whole of https://github.com/zigpy/zigpy-znp/blob/dev/README.md it says that it supports both Z-Stack Home 1.2.x and Z-Stack 3.0.x on CC2531, however, it also says that Z-Stack Home 1.2.x support on CC2531 is classified as “Alpha” (meaning experimental) and Z-Stack 3.0.x on CC2531 on is classified as “Beta” (meaning more mature than experimental but not stable enough for producion).

If you continue to https://github.com/zigpy/zigpy-znp/blob/dev/README.md you will see that you can do a backup and restore to other hardware as long as the firmware is the similar versions, which means that you can start out with CC2531 hardware with Z-Stack 3.0.x firmware and later upgrade to CC2652 hardware with Z-Stack 3.x.x firmware if you do a backup and restore.

As you also noticed Zigbee2MQTT on the other hand (which is not the same ZHA) recommends Z-Stack Home 1.2.x firmware on CC2531 and CC2530 but you need to understand that their recommendation is for Zigbee2MQTT and not for ZHA. ZHA only links to https://www.zigbee2mqtt.io/information/supported_adapters because that project provide firmware image files, however that does not mean that their firmware image files only work with Zigbee2MQTT, as it happens, they also work with ZHA (both with zigpy-cc and zigpy-znp).

Again, the main point you should take out of this is that CC2531 is still not recommended for production, but if you want to continue using CC2531 with ZHA when upgrade to Z-Stack 3 and switch to zigpy-znp.

1 Like