The PCA9685 is an I2C-bus controlled 16-channel LED controller optimized for Red/Green/Blue/Amber (RGBA) color backlighting applications. Each LED output has its own 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates at a programmable frequency from a typical of 24 Hz to 1526 Hz with a duty cycle that is adjustable from 0% to 100 % to allow the LED to be set to a specific brightness value. All outputs are set to the same PWM frequency.

PCA9685. Typical configuration
Fig. 1. PCA9685. Typical configuration

The configuration above is for 8 channels on a controller connected to P15 (SDA) and P13 (SCL) pins.

Address – it is the I2C address. The default value is 0x70 (hex) or 112 (dec).

Inversed – if this option is enabled and the PWM channel is off, the output will have the HIGH level. Otherwise, the output will change the LOW level.

Frequency – PWM frequency. The firmware uses a value from the first defined channel (in this example, Output 1).

Channel – PWM channel number from 0 to 15.

Type – the PWM output type (fig. 2).

PWM output type
Fig. 2. PWM output type

Zigbee2MQTT commands

on/off - Look for commands and examples for GPIO outputs.
write - sets the PWM duty cycle.
Topic: zigbee2mqtt/[friedly_name]/[channel]/set/brightness
Channel: l1, l2, l3 … l16
Payload: value (0..254)
Topic: zigbee2mqtt/[friedly_name]/set/[channel]
Channel: l1, l2, l3 … l16
Payload: {"brightness": value, "transition": 3}
value: 0 .. 254.
transition: (optional) the transition time in seconds between states.
read - reads the current value
Topic: zigbee2mqtt/[friedly_name]/[channel]/get/brightness
Payload: none
Returns: {"brightness_[channel]": value}

Comments
Harvey Specter
Posted at 09:47 December 26, 2021
Roman
Reply
Author

Please ignore my previous message. I think the problem was in incorrect pairing as I did not see any clusters on Enpoints 3 and 4. After few restarts of zigbee2mqtt and model Id change now I see 3 endpoints with the same clusters and no error anymore.

Harvey Specter
Posted at 02:32 December 26, 2021
Roman
Reply
Author

Hi, in firmware 1.5.2.5 I configured just 2 channels according to the example picture on this page. Saved custom converted and set it up in zigbee2mqtt.

In zigbee2mqtt I can change the brightness of the first channel but for the second channel I get ‘Error: LevelControl not supported on this endpoint’.

Do you see the same error?

Leave a Reply