deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

Incorrect light type for LEDVANCE A19 RGBW

Open Thomas-Vos opened this issue 2 years ago • 10 comments

Describe the bug

A user reported that their LEDVANCE A19 RGBW has the wrong light type. It is reported as a Color temperature light but it also supports setting a color. So it should be Extended color light instead.

https://community.hueessentials.com/t/ledvance-a19-rgbw-bulb-no-color-controls/4579

Steps to reproduce the behavior

N/A

Expected behavior

Extended color light as light type

Screenshots

Capture4 https://community.hueessentials.com/t/ledvance-a19-rgbw-bulb-no-color-controls/4579

Environment

N/A

deCONZ Logs

N/A

Additional context

https://github.com/dresden-elektronik/deconz-rest-plugin/pull/3721 https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3365

Thomas-Vos avatar Dec 04 '22 17:12 Thomas-Vos

Hi Thomas

Can you (or ask the user to) provide the rest api response ?

Kind regards,

Mimiix avatar Dec 04 '22 17:12 Mimiix

@Mimiix already discussed the issue with the devs on Discord, and I asked the user to provide the DDF so the bug can be fixed. It seems deCONZ is overriding the light type incorrectly here: https://github.com/dresden-elektronik/deconz-rest-plugin/blob/5d136aed7d2e79df663ab3f907954b6f3e6662bf/de_web_plugin.cpp#L3260

I will make a PR to fix this code, and once the user reports the DDF it can be fixed in a DDF as well.

Thomas-Vos avatar Dec 04 '22 17:12 Thomas-Vos

Aah okay. Good to hear you figured it out!

Mimiix avatar Dec 04 '22 17:12 Mimiix

Have found capture here https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3365#issuecomment-703791010 Will be nice if he can share the "auto generated" DDF, when selecting a node and making "Edit DDF", the DDF is on the third tab "preview"

In theorie just need to replace

"type": "$TYPE_COLOR_TEMPERATURE_LIGHT", by "type": "$TYPE_EXTENDED_COLOR_LIGHT",

In the "auto generated" DDF, but you can miss some fields too, like state/x or state/y, can need too to freeze for exemple the state/colormode.

Will be usefull if we can have the attribute list in the cluster 0x0300.

Smanar avatar Dec 04 '22 17:12 Smanar

Created a PR to fix the legacy code here: https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6592

Thomas-Vos avatar Dec 04 '22 18:12 Thomas-Vos

I changed the type in the DDF and Hue Essentials now correctly controls the bulb... though HE still shows it as 'unknown'. I also set the DDF to 'gold'

stock DDF...

{ "schema": "devcap1.schema.json", "manufacturername": "LEDVANCE", "modelid": "A19 RGBW", "product": "A19 RGBW", "sleeper": false, "status": "Draft", "subdevices": [ { "type": "$TYPE_COLOR_TEMPERATURE_LIGHT", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/colorcapabilities", "description": "The supported color modes as bitmap.", "refresh.interval": 84000 }, { "name": "config/ctmax", "description": "Maximum supported color temperature.", "refresh.interval": 84000 }, { "name": "config/ctmin", "description": "Minimum supported color temperature.", "refresh.interval": 84000 }, { "name": "state/alert", "description": "The currently active alert effect.", "default": "none" }, { "name": "state/bri", "description": "The current brightness.", "refresh.interval": 5 }, { "name": "state/colormode", "description": "The currently active color mode.", "refresh.interval": 300 }, { "name": "state/ct", "description": "The current Mired color temperature of the light. Where Mired is 1000000 / color temperature (in kelvins).", "refresh.interval": 5 }, { "name": "state/effect", "description": "The currently active effect.", "default": "none" }, { "name": "state/hue", "description": "The current color hue." }, { "name": "state/on", "description": "True when device is on; false when off.", "refresh.interval": 5 }, { "name": "state/reachable" }, { "name": "state/sat", "description": "The current color saturation.", "refresh.interval": 5 }, { "name": "state/x", "description": "The current color x coordinate.", "refresh.interval": 5 }, { "name": "state/y", "description": "The current color y coordinate." } ] } ], "bindings": [ { "bind": "unicast", "src.ep": 1, "dst.ep": 1, "cl": "0x0006", "report": [ { "at": "0x0000", "dt": "0x10", "min": 1, "max": 300 } ] }, { "bind": "unicast", "src.ep": 1, "dst.ep": 1, "cl": "0x0008", "report": [ { "at": "0x0000", "dt": "0x20", "min": 1, "max": 300, "change": "0x00000001" } ] }, { "bind": "unicast", "src.ep": 1, "dst.ep": 1, "cl": "0x0300", "report": [ { "at": "0x0007", "dt": "0x21", "min": 1, "max": 300, "change": "0x00000001" }, { "at": "0x0003", "dt": "0x21", "min": 1, "max": 300, "change": "0x0000000A" }, { "at": "0x0004", "dt": "0x21", "min": 1, "max": 300, "change": "0x0000000A" }, { "at": "0x0008", "dt": "0x30", "min": 1, "max": 300 } ] } ] }

Ltek avatar Dec 04 '22 19:12 Ltek

Thanks a lot for the DDF!

The unknown in Hue Essentials is unrelated to this issue and will be fixed in the next version, it's just a missing icon.

Thomas-Vos avatar Dec 04 '22 21:12 Thomas-Vos

@Ltek Nice thx ^^

Have updated the DDF,

  • set the mode to "Gold"
  • removed all description
  • changed the type to TYPE_EXTENDED_COLOR_LIGHT
  • increased all small "refresh.interval" as the device support bind/report
{
  "schema": "devcap1.schema.json",
  "manufacturername": "LEDVANCE",
  "modelid": "A19 RGBW",
  "product": "A19 RGBW",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_EXTENDED_COLOR_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/colorcapabilities",
          "static": 16
        },
        {
          "name": "config/ctmax",
          "static": 666
        },
        {
          "name": "config/ctmin",
          "static": 142
        },
        {
          "name": "state/alert",
          "default": "none"
        },
        {
          "name": "state/bri",
          "refresh.interval": 600
        },
        {
          "name": "state/colormode",
          "refresh.interval": 84000
        },
        {
          "name": "state/ct",
          "refresh.interval": 600
        },
        {
          "name": "state/effect",
          "default": "none"
        },
        {
          "name": "state/hue",
          "refresh.interval": 600
        },
        {
          "name": "state/on",
          "refresh.interval": 600
        },
        {
          "name": "state/reachable"
        },
        {
          "name": "state/sat",
          "refresh.interval": 600
        },
        {
          "name": "state/x",
          "refresh.interval": 600
        },
        {
          "name": "state/y",
          "refresh.interval": 600
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0008",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x20",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0300",
      "report": [
        {
          "at": "0x0007",
          "dt": "0x21",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        },
        {
          "at": "0x0003",
          "dt": "0x21",
          "min": 1,
          "max": 300,
          "change": "0x0000000A"
        },
        {
          "at": "0x0004",
          "dt": "0x21",
          "min": 1,
          "max": 300,
          "change": "0x0000000A"
        },
        {
          "at": "0x0008",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    }
  ]
}

I haven't freezed state/colormode (so this value can be wrong) but have freeezed other as the legacy code do it

        lightNode->addItem(DataTypeUInt16, RConfigCtMin)->setValue(142);
        lightNode->addItem(DataTypeUInt16, RConfigCtMax)->setValue(666);
        lightNode->addItem(DataTypeUInt16, RConfigColorCapabilities)->setValue(0x0001 | 0x0008 | 0x0010);

If you can test the last DDF pls ? You know how to replace them ?

Smanar avatar Dec 05 '22 16:12 Smanar

I'd propose to add @Smanar DDF. Currently we don't have any LEDVANCE lights available as DDF but a bunch of C++ workarounds predating DDF. So it would be cool to transition these lights to DDF over time and remove the C++ parts after that.

manup avatar Apr 01 '23 10:04 manup

Can we please, please create new DDFs first-time-right?

  • config/colorcapabilities of 16 is wrong. If the legacy code is correct, it should be 0x19. Are we sure this light doesn't support enhanced hue/saturation nor color loop? Probably, as these are pre-Zigbee-3 ZHA lights, without the ZLL extensions (hence the wrong type, as Enhanced Color Light is a ZLL extension).
  • config/colorcapabilities, config/ctmax and config/ctmin have been deprecated - please use cap/color/capabilities, cap/color/ct/max and cap/color/ct/min instead.
  • Please add the cap/color/xy capabilities. I'm not sure if LEDVANCE exposes these, nor whether they use the ColorPoint ZIgbee attribute set (like Hue), or the Primary set (like IKEA). If not, hard-code them (like MLI). According to my notes, LEDVANCE use: { r: [0.6972, 0.3027], g: [0.1737, 0.6991], b: [0.1227, 0.0959] }. Multiply these API values by 0xFFFF to get the Zigbee values.
  • Please double-check whether they support Off with Effect, Move to Level (with On/Off), Trigger Effect, and, if so, include the corresponding cap items.
  • Please double check whether they update the Current X and Current Y values when setting color temperature, and, if so, include cap/color/ct/computes_xy.
  • Please double check whether they support Execute_If_Off and if so, include the corresponding config items.
  • I don't suppose they support the Startup attributes, as OSRAM uses a specific command to set the startup state. Not sure if we ever exposed that through the API.

For examples, see:

  • Hue: devices/philips/light_zb3_C_gradient.json
  • MLI: devices/mli/zbt-extendedcolor.json
  • IKEA: devices/ikea/cws_light.json

ebaauw avatar Apr 01 '23 11:04 ebaauw