Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add auto-detection of CC2652P #1071

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tobiasdiez
Copy link

Add detection of the CC2652P (from https://item.taobao.com/item.htm?_u=j20f1ocri1b58f&id=673052067615&spm=a1z09.2.0.0.6c5f2e8dlM2Hvh or https://nl.aliexpress.com/item/1005006155691159.html?gatewayAdapt=glo2nld).

On my system, the reported information was in capitals so I also changed the equalsPartial method to be case-insensitive.

@@ -43,6 +43,7 @@ const autoDetectDefinitions = [
{manufacturer: 'Texas Instruments', vendorId: '0451', productId: '16a8'}, // CC2531
{manufacturer: 'Texas Instruments', vendorId: '0451', productId: 'bef3'}, // CC1352P_2 and CC26X2R1
{manufacturer: 'Electrolama', vendorId: '0403', productId: '6015'}, // ZZH
{ manufacturer: 'Silicon Labs', vendorId: '10c4', productId: 'ea60' }, // CC2652P
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can add this one, ea60 is from the CP210x which is also used in EmberZNet adapters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh, it is however added there with a different manufacturer:

{manufacturer: 'Nabu Casa', vendorId: '10c4', productId: 'ea60'},// Home Assistant SkyConnect

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, the Dongle-P also has a different ID so let's merge this, can you fix the lint issues?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you fix the lint issues?

Done!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Can't use manufacturer as a "reference" for auto-detect, OS drivers can overwrite it. Which is why auto detect often fails btw.

return entries.every(([key, value]) => Equals(object[key], value));
return entries.every(([key, value]) => {
const objectValue = object[key];
if (typeof objectValue === 'string' && typeof value === 'string') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change needed?

Copy link
Author

@tobiasdiez tobiasdiez May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my system, the reported information of the chipset was in capitals so I also changed the equalsPartial method to be case-insensitive.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would propose to add an extra argument here: caseInsensitive

@Hedda
Copy link
Contributor

Hedda commented May 30, 2024

FYI, ZHA integration component in Home Assistant core could be used as a referece as contain index of compatible adapters:

https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf

See this related forum discussion about community effort to help whitelisting all compatible USB adapters:

https://community.home-assistant.io/t/community-help-wanted-to-whitelist-all-compatible-zigbee-and-z-wave-dongles-adapters-for-automatic-usb-discovery-in-home-assistant/344412

What is currently needed to automatically detect a Zigbee USB adapter is its USB Identifier (i.e. chip-ID) in combination with “Product Description String” (a.k.a. device descriptor/descriptors) in combination with its “Vendor ID” (a.k.a. vid hex) and “Product ID” (a.k.a. pid hex), however note that the USB disovery in ZHA is not specific to a single radio type but support all radio types as it then uses serial probes to detect which radio type (ezsp, znp, deconz, etc.) tha adapter running as firmware:

https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json

 "usb": [
    {
      "vid": "10C4",
      "pid": "EA60",
      "description": "*2652*",
      "known_devices": ["slae.sh cc2652rb stick"]
    },
    {
      "vid": "10C4",
      "pid": "EA60",
      "description": "*slzb-07*",
      "known_devices": ["smlight slzb-07"]
    },
    {
      "vid": "1A86",
      "pid": "55D4",
      "description": "*sonoff*plus*",
      "known_devices": ["sonoff zigbee dongle plus v2"]
    },
    {
      "vid": "10C4",
      "pid": "EA60",
      "description": "*sonoff*plus*",
      "known_devices": ["sonoff zigbee dongle plus"]
    },
    {
      "vid": "10C4",
      "pid": "EA60",
      "description": "*tubeszb*",
      "known_devices": ["TubesZB Coordinator"]
    },
    {
      "vid": "1A86",
      "pid": "7523",
      "description": "*tubeszb*",
      "known_devices": ["TubesZB Coordinator"]
    },
    {
      "vid": "1A86",
      "pid": "7523",
      "description": "*zigstar*",
      "known_devices": ["ZigStar Coordinators"]
    },
    {
      "vid": "1CF1",
      "pid": "0030",
      "description": "*conbee*",
      "known_devices": ["Conbee II"]
    },
    {
      "vid": "0403",
      "pid": "6015",
      "description": "*conbee*",
      "known_devices": ["Conbee III"]
    },
    {
      "vid": "10C4",
      "pid": "8A2A",
      "description": "*zigbee*",
      "known_devices": ["Nortek HUSBZB-1"]
    },
    {
      "vid": "0403",
      "pid": "6015",
      "description": "*zigate*",
      "known_devices": ["ZiGate+"]
    },
    {
      "vid": "10C4",
      "pid": "EA60",
      "description": "*zigate*",
      "known_devices": ["ZiGate"]
    },
    {
      "vid": "10C4",
      "pid": "8B34",
      "description": "*bv 2010/10*",
      "known_devices": ["Bitron Video AV2010/10"]
    }
  ],

PS: Zeroconf is also supported in Home Assistant's ZHA integration for network discovery of some specific remote Zigbee Coordinator appliances but there is is a plan to generalize that and steer future TCP coordinators to use a general _zigbee.local. type in ZHA to allow general discovery of all adapters without having to update whitelisting for specific adapters :

  "zeroconf": [
    {
      "type": "_esphomelib._tcp.local.",
      "name": "tube*"
    },
    {
      "type": "_zigate-zigbee-gateway._tcp.local.",
      "name": "*zigate*"
    },
    {
      "type": "_zigstar_gw._tcp.local.",
      "name": "*zigstar*"
    },
    {
      "type": "_uzg-01._tcp.local.",
      "name": "uzg-01*"
    },
    {
      "type": "_slzb-06._tcp.local.",
      "name": "slzb-06*"
    }
  ]

@Nerivec Nerivec mentioned this pull request Sep 23, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants