espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
132 stars 20 forks source link

Add support for ZLL (Zigbee Light Link) application profile and its device classes (TZ-553) #208

Open Hedda opened 6 months ago

Hedda commented 6 months ago

Is your feature request related to a problem?

Generic request to please also add full support for ZLL (Zigbee Light Link) profile (PROFILE_ID = 49246) and all of its device classes:

The main difference between ZLL (Zigbee Light Link) profile and ZHA (Zigbee Home Automation) profile ZLL that it specifially define devices as "lights" instead "switches" for some devices classes that otherwise match the same device class ID as ZHA.

ZLL does however have some lighting related extensions that is not included in Zigbee HA, which is by the way why Philips/Signify primarly uses the Zigbee Light Link profile in its Philips Hue series products and it is what their Philips Hue Bridge supports directly.

In theory, using the ZLL profile ID will make it easier to make a Hue compatible device that can be paired with Philips Hue Bridge:

https://developers.meethue.com/zigbee-3-0-support-in-hue-ecosystem/

https://www.makeuseof.com/other-smart-bulbs-work-with-philips-hue/

So real world use case is that you can only ever join a Zigbee Light Link device directly to the official Philips Hue Bridge v1 and v2.

https://www.philips-hue.com/en-us/explore-hue/works-with

For reference, compare device classes for ZLL verses ZHA supported in zigpy library used in Home Assistant's Zigbee integration:

https://github.com/zigpy/zigpy/blob/dev/zigpy/profiles/zll.py

https://github.com/zigpy/zigpy/blob/dev/zigpy/profiles/zha.py

class DeviceType(t.enum16):
    ON_OFF_LIGHT = 0x0000
    ON_OFF_PLUGIN_UNIT = 0x0010
    DIMMABLE_LIGHT = 0x0100
    DIMMABLE_PLUGIN_UNIT = 0x0110
    COLOR_LIGHT = 0x0200
    EXTENDED_COLOR_LIGHT = 0x0210
    COLOR_TEMPERATURE_LIGHT = 0x0220

    COLOR_CONTROLLER = 0x0800
    COLOR_SCENE_CONTROLLER = 0x0810
    CONTROLLER = 0x0820
    SCENE_CONTROLLER = 0x0830
    CONTROL_BRIDGE = 0x0840
    ON_OFF_SENSOR = 0x0850

PS: ZLL was originally part of Zigbee Lighting & Occupancy Device Specification, so it also covers scenarios for Occupancy sensors.

Describe the solution you'd like.

Be able to make ZLL (Zigbee Light Link) profile compatible devices that can be paired directly to the official Philips Hue Bridge.

Describe alternatives you've considered.

No response

Additional context.

No response

chshu commented 6 months ago

Link: https://github.com/espressif/esp-zigbee-sdk/issues/205#issuecomment-1880811875

chshu commented 4 months ago

@Hedda The touchlink examples are supported now: https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_touchlink.

The ZLL seems an out of date spec, which was replaced by the touchlink in Zigbee 3.0. Do you think the touchlink feature is enough to cover your request?

Bosemani commented 3 months ago

Hai @Hedda Did you tried to add device to Philips Hue? Using touchlink feature how to add to hue gateway?

xieqinan commented 3 months ago

@Bosemani

Please refer to https://github.com/espressif/esp-zigbee-sdk/issues/168#issuecomment-1952370582.

Additionally, please note the version of the Hue gateway. You can set the endpoint version using the following code.

esp_zb_endpoint_config_t endpoint_config = {
        .endpoint = HA_COLOR_DIMMABLE_LIGHT_ENDPOINT,
        .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
        .app_device_id = 0x010D, // extened color light
        .app_device_version = 1  // Philips hue
    };
    esp_zb_ep_list_add_ep(esp_zb_color_dimmable_light_ep, esp_zb_color_dimmable_light_clusters_create(&light_cfg), endpoint_config);