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

Zigbee Color Dimmable Light Example: wrong RGB values #11156

Open
1 task done
wf2020 opened this issue Mar 20, 2025 · 4 comments
Open
1 task done

Zigbee Color Dimmable Light Example: wrong RGB values #11156

wf2020 opened this issue Mar 20, 2025 · 4 comments
Labels
Area: Zigbee Issues and Feature Request about Zigbee Status: Community help needed Issue need help from any member from the Community.

Comments

@wf2020
Copy link

wf2020 commented Mar 20, 2025

Board

ESP32-C6

Device Description

Development Board

Hardware Configuration

GPIO15 connected to LED

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

80 MHz

PSRAM enabled

no

Upload speed

921600

Description

Tried the Zigbee Color Dimmable Light Example.
When setting colors with Zigbee2Mqtt (Home Assistant) the RGB values set in the example don't match the values sent:

Setting red to 255 sets red only to 69.
Setting green to 255 sets green only to 34.
Setting blue to 255 sets blue only to 128.

Sketch

ZigbeeColorDimmableLight zbColorLight = ZigbeeColorDimmableLight(ZIGBEE_RGB_LIGHT_ENDPOINT);

/********************* RGB LED functions **************************/
void setRGBLight(bool state, uint8_t red, uint8_t green, uint8_t blue, uint8_t level) {
  if (!state) {
    rgbLedWrite(led, 0, 0, 0);
    return;
  }
  float brightness = (float)level / 255;
  rgbLedWrite(led, red * brightness, green * brightness, blue * brightness);

/*** Output RGB values ***/
  Serial.print("R: ");
  Serial.print(red,DEC);
  Serial.print(" G: ");
  Serial.print(green,DEC);
  Serial.print(" B: ");
  Serial.println(blue,DEC);
}

Debug Message

R: 69 G: 0 B: 0
R: 0 G: 34 B: 0
R: 0 G: 0 B: 128

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@wf2020 wf2020 added the Status: Awaiting triage Issue is waiting for triage label Mar 20, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Area: Zigbee Issues and Feature Request about Zigbee Status: Community help needed Issue need help from any member from the Community. and removed Status: Awaiting triage Issue is waiting for triage labels Mar 21, 2025
@P-R-O-C-H-Y
Copy link
Member

Hi @wf2020, can you post some more logs from the ESP? Please select in the Arduino IDE Tools menu -> Zigbee mode -> End Device - DEBUG and also set Core Debug Level -> Verbose and post whole log here :)

Also If anyone using Z2M can test this and confirm, I will appreciate the help.

@wf2020
Copy link
Author

wf2020 commented Mar 21, 2025

This is the output on color changes:

[342870][V][ZigbeeHandlers.cpp:77] zb_attribute_set_handler(): Received message: endpoint(10), cluster(0x300), attribute(0x4), data size(2)
[342871][V][esp32-hal-rmt.c:454] rmtInit(): GPIO 15 - TX MODE - MemSize[48] - Freq=10000000Hz
[342871][V][esp32-hal-rmt.c:305] _rmtWrite(): GPIO: 15 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[342872][V][esp32-hal-rmt.c:306] _rmtWrite(): GPIO: 15 - Currently in Loop Mode: [NO] | Asked to Loop: NO, LoopCancel: NO

@P-R-O-C-H-Y
Copy link
Member

Can you please provide full log? Thanks

@wf2020
Copy link
Author

wf2020 commented Mar 24, 2025

Here including pairing:

[ 0][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): DeingbeeCore.cpp:289] esp_zb_app_signal_handler(): Network steering was not successful (status: ESP_FAIL)
..........ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349 dev type 2, joined 0, ext_pan_id 0, authenticated 0, tclk_valid 1
......................ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:251 No dev for join
ZBOSS: zdo/zdo_commissioning.c:210 Can't find PAN to join to! param 0
ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549 COMMISSIONING_STOP: app signal 10 comm status 3
[ 11512][I][ZigbeeCore.cpp:289] esp_zb_app_signal_handler(): Network steering was not successful (status: ESP_FAIL)
..........ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349 dev type 2, joined 0, ext_pan_id 0, authenticated 0, tclk_valid 1
.......................ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:186 low lqi 0
ZBOSS: nwk/nwk_join.c:293 Will assoc to pan 0x4306 on channel 11, dev 0x5312, iface_id 0
.....ZBOSS: mac/mac_associate.c:448 received association response
ZBOSS: zdo/zdo_app_join.c:771 CONGRATULATIONS! joined status 0, addr 0xd969, iface_id 0, ch 11, rejoin 0
ZBOSS: zdo/zdo_app_join.c:773 xpanid 8c:d2:90:00:11:22:33:44
.ZBOSS: secur/zdo_secur.c:211 NWK key fb:46:61:d6:fd:7b:0a:e0:20:e7:00:11:22:33:44:55
...........ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549 COMMISSIONING_STOP: app signal 10 comm status 0
[ 16433][I][ZigbeeCore.cpp:282] esp_zb_app_signal_handler(): Joined network successfully (Extended PAN ID: 8c:d2:90:00:11:22:33:44, PAN ID: 0x4306, Channel:11, Short Address: 0xd969)

=========== After Setup Start ============
INTERNAL Memory Info:

Total Size : 445308 B ( 434.9 KB)
Free Bytes : 380484 B ( 371.6 KB)
Allocated Bytes : 56464 B ( 55.1 KB)
Minimum Free Bytes: 380484 B ( 371.6 KB)
Largest Free Block: 352244 B ( 344.0 KB)

GPIO Info:

GPIO : BUS_TYPE[bus/unit][chan]

 9 : GPIO
12 : USB_DM
13 : USB_DP
15 : RMT_TX
16 : UART_TX[0]
17 : UART_RX[0]

============ After Setup End =============
[ 47292][V][ZigbeeHandlers.cpp:77] zb_attribute_set_handler(): Received message: endpoint(10), cluster(0x300), attribute(0x3), data size(2)
[ 47294][V][esp32-hal-rmt.c:454] rmtInit(): GPIO 15 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 47294][V][esp32-hal-rmt.c:305] _rmtWrite(): GPIO: 15 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 47295][V][esp32-hal-rmt.c:306] _rmtWrite(): GPIO: 15 - Currently in Loop Mode: [NO] | Asked to Loop: NO, LoopCancel: NO
R: 69 G: 0 B: 0
[ 51803][V][ZigbeeHandlers.cpp:77] zb_attribute_set_handler(): Received message: endpoint(10), cluster(0x300), attribute(0x4), data size(2)
[ 51803][V][esp32-hal-rmt.c:454] rmtInit(): GPIO 15 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 51804][V][esp32-hal-rmt.c:305] _rmtWrite(): GPIO: 15 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 51804][V][esp32-hal-rmt.c:306] _rmtWrite(): GPIO: 15 - Currently in Loop Mode: [NO] | Asked to Loop: NO, LoopCancel: NO
R: 0 G: 34 B: 0
[ 53667][V][ZigbeeHandlers.cpp:77] zb_attribute_set_handler(): Received message: endpoint(10), cluster(0x300), attribute(0x4), data size(2)
[ 53667][V][esp32-hal-rmt.c:454] rmtInit(): GPIO 15 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 53668][V][esp32-hal-rmt.c:305] _rmtWrite(): GPIO: 15 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 53668][V][esp32-hal-rmt.c:306] _rmtWrite(): GPIO: 15 - Currently in Loop Mode: [NO] | Asked to Loop: NO, LoopCancel: NO
R: 0 G: 0 B: 128

(Sorry, don't know how to get rid off the formatting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Zigbee Issues and Feature Request about Zigbee Status: Community help needed Issue need help from any member from the Community.
Projects
None yet
Development

No branches or pull requests

2 participants