Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
483 stars 300 forks source link

feat: add auto-detection of CC2652P #1071

Closed tobiasdiez closed 1 month ago

tobiasdiez commented 6 months ago

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.

Hedda commented 6 months ago

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 commented 1 month ago

Logic replaced in https://github.com/Koenkk/zigbee-herdsman/pull/1197