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

Add support Zigbee light with color_temp #1557

Open
AdimoUK opened this issue Jan 10, 2025 · 9 comments
Open

Add support Zigbee light with color_temp #1557

AdimoUK opened this issue Jan 10, 2025 · 9 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@AdimoUK
Copy link

AdimoUK commented Jan 10, 2025

Hi

Got 3 IKEA Tradfri GU10 bulbs linked to my Zigbee Bridge. All is working well in the eWeLink app, I have been able to pair those & control them using the app. However these are recognised by SonoffLAN as regular bulbs with no brightness / temperature control.

It initially picked these bulbs as switches, so I've gone ahead and configured them using config.yaml file to be lights. However this doesn't solve anything.

Here is the diagnostic (just relevant part, but let me know if you need the whole thing):

"device": {
      "uiid": 1258,
      "params": {
        "bindInfos": "***",
        "subDevId": "9b2244feff8176281258",
        "parentid": "100233927e",
        "staMac": "***",
        "THIRD_PARTY_EQUIPMENT_INFORMATION": {
          "brand": "IKEA",
          "productModel": "TRADFRI bulb GU10 WS 345lm"
        },
        "switch": "on",
        "colorTemp": 26,
        "brightness": 100
      },
      "model": "ZigbeeTunableWhiteLight",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "a4800c0a55"

Any chance of some guidance to get this to work?

On a side note, I can also confirm that I have also used the IKEA Tradfri 10W driver and this is picked up no problem, including brightness control fully working. FYI, here is the diagnostic relevant part again:

"device": {
      "uiid": 1257,
      "params": {
        "bindInfos": "***",
        "subDevId": "e08a5dfefff8e2441257",
        "parentid": "100233927e",
        "staMac": "***",
        "THIRD_PARTY_EQUIPMENT_INFORMATION": {
          "brand": "IKEA",
          "productModel": "TRADFRI Driver 10W"
        },
        "switch": "on",
        "brightness": 100,
        "mode": 0
      },
      "model": "ZigbeeWhiteLight",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "a4800bb997"
    }

I also am using the new ZBBridge-U model, and that is also working well.

Many thanks in advance!

@AlexxIT AlexxIT added the enhancement New feature or request label Jan 10, 2025
@AlexxIT AlexxIT self-assigned this Jan 10, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 12, 2025

Please set minimum colorTemp (yellow) from ewelink app and show device diagnostics. And set maximum colorTemp (white) and show device diagnostics.

The colour temperature can be switched between 2200 Kelvin (warm glow), 2700 Kelvin (warm white) and 4000 Kelvin (cool white).

@AlexxIT AlexxIT removed their assignment Jan 12, 2025
@AdimoUK
Copy link
Author

AdimoUK commented Jan 13, 2025

Thanks for the quick response!

As I have a total of 3 of these bulbs, I have set one to 2200K and one to 4000K, both at full brightness. Here are they both:

"a4800c0a57": {
  "uiid": 1258,
  "params": {
    "bindInfos": "***",
    "subDevId": "e52244feff8176281258",
    "parentid": "100233927e",
    "staMac": "***",
    "THIRD_PARTY_EQUIPMENT_INFORMATION": {
      "brand": "IKEA",
      "productModel": "TRADFRI bulb GU10 WS 345lm"
    },
    "switch": "on",
    "colorTemp": 0,
    "brightness": 100
  },
  "model": "ZigbeeTunableWhiteLight",
  "online": true,
  "local": null,
  "localtype": null,
  "host": null
},
"a4800c0a55": {
  "uiid": 1258,
  "params": {
    "bindInfos": "***",
    "subDevId": "9b2244feff8176281258",
    "parentid": "100233927e",
    "staMac": "***",
    "THIRD_PARTY_EQUIPMENT_INFORMATION": {
      "brand": "IKEA",
      "productModel": "TRADFRI bulb GU10 WS 345lm"
    },
    "switch": "on",
    "colorTemp": 100,
    "brightness": 100
  },
  "model": "ZigbeeTunableWhiteLight",
  "online": true,
  "local": null,
  "localtype": null,
  "host": null
}

Playing around with it to see values change, it seems that both brightness and colorTemp are on a scale of 0 - 100. (FYI - I had to click reload on the integration page each time to get the Download Diagnostics json file to update to current values). I'm guessing this is the info you are after.

Please let me know if I can help out any further!

//Edit: 0 represents warm white light, 100 represents cool white light. The bulbs have 2 sets of LEDs inside (warm and cool) and it's either one of the sets fully on, a mix in-between or the other set. Rather clever design I have to say!

@AlexxIT AlexxIT self-assigned this Jan 13, 2025
@AlexxIT AlexxIT changed the title IKEA Tradfri GU10 Bulbs (warm white / cold white + brightness) integration Add support Zigbee light with color_temp Jan 13, 2025
@AlexxIT AlexxIT added this to the v3.8.2 milestone Jan 13, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 16, 2025

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.8.2

@AlexxIT AlexxIT closed this as completed Jan 16, 2025
@AdimoUK
Copy link
Author

AdimoUK commented Jan 16, 2025

I'm afraid there's a 500 error from eweLink API now when running this. Unable to control the lights or see the status update (though the controls appear in a correct manner now).

Image

This is the diagnostic:

"errors": [
      {
        "name": "custom_components.sonoff.core.ewelink.cloud",
        "message": [
          "Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a56', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737048237592', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}"
        ],
        "level": "WARNING",
        "source": [
          "custom_components/sonoff/core/ewelink/cloud.py",
          603
        ],
        "timestamp": 1737048237.6540415,
        "exception": "",
        "count": 1,
        "first_occurred": 1737048237.6540415
      }
    ],
    "device": {
      "uiid": 1258,
      "params": {
        "bindInfos": "***",
        "subDevId": "97a309feff8176281258",
        "parentid": "100233927e",
        "staMac": "***",
        "THIRD_PARTY_EQUIPMENT_INFORMATION": {
          "brand": "IKEA",
          "productModel": "TRADFRI bulb GU10 WS 345lm"
        },
        "switch": "on",
        "colorTemp": 48,
        "brightness": 50,
        "null": "on"
      },
      "model": "ZigbeeTunableWhiteLight",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "a4800c0a56"
    }

Please let me know how I can help to debug / diagnose the issues.

@AlexxIT AlexxIT reopened this Jan 16, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 16, 2025

Yes. You needs to collect debug log. To find out what request is causing this error.

@AdimoUK
Copy link
Author

AdimoUK commented Jan 16, 2025

This is what's showing in the HA logs after turning on debugging.

This error originated from a custom integration.

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:603
integration: Sonoff (documentation, issues)
First occurred: 17:23:57 (7 occurrences)
Last logged: 20:30:13

Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a56', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059411035', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}
Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a57', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059411034', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}
Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a55', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059413297', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}
Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a56', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059413299', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}
Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a57', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059413298', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}

In the full log I only get this:

2025-01-16 20:30:13.500 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.cloud] a4800c0a57 => Cloud4 | {None: 'on'} | DDoS | DDoS | 1737059413298
2025-01-16 20:30:13.561 WARNING (MainThread) [custom_components.sonoff.core.ewelink.cloud] Cloud ERROR: {'error': 500, 'deviceid': 'a4800c0a57', 'apikey': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f', 'sequence': '1737059413298', 'uid': 'ceba33f9-5ecf-4744-8d7e-d726d386a25f'}

@AdimoUK
Copy link
Author

AdimoUK commented Jan 16, 2025

Messing around with changing the lights, it seems that updates sent to the API do in fact change the lights for both brightness and temperature.

2025-01-16 20:38:36.177 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] a4800c0a57 <= Cloud3 | {'bindInfos': {'alexa': ['ceba33f9-5ecf-4744-8d7e-d726d386a25f_26ca1996a20e8bd63617ab272d4eeede1d2d8e32']}, 'subDevId': 'e52244feff8176281258', 'parentid': '100233927e', 'staMac': '0x287681fffe4422e5', 'THIRD_PARTY_EQUIPMENT_INFORMATION': {'brand': 'IKEA', 'productModel': 'TRADFRI bulb GU10 WS 345lm'}, 'switch': 'on', 'colorTemp': 0, 'brightness': 20, 'null': 'on'} | 1737059916147

Turning the light on/off does not work, with the above CLOUD ERROR 500 message.

It's also unable to get the state of the light, so everything is marked as UNKNOWN. This was not the case prior to the update - I was able to turn them on/off, just not make changes to the brightness / temperature.

@AdimoUK
Copy link
Author

AdimoUK commented Jan 21, 2025

@AlexxIT are the above enough? Is there anything I can do to assist further?

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 22, 2025

Yes. It's enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants