Add 4-PWM RGBW LED mode#2162
Open
lumixen wants to merge 3 commits into
Open
Conversation
lumixen
force-pushed
the
rgbw-4pwm-mode
branch
5 times, most recently
from
July 19, 2026 10:26
897078f to
199268d
Compare
Owner
|
Seems nice, I replied there: |
- Store colorMode (RGB/White) in mode slot high byte - Reuse temperature slot for white channel when flag 52 is active - Add HAL_LED_PackModeAndColorMode / UnpackModeAndColorMode helpers - Update all 14 HAL implementations, flags docs - Struct stays at 64 bytes, zero format change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Flag 52 (OBK_FLAG_LED_4PWM_RGBW_MODE) for 4-PWM RGB + independent White LED strips, exposed as a single HA light entity with RGB/White color modes, including led_enableWhite command, led_colorMode MQTT topic, HA discovery via template schema, Web UI mode selector with dynamic RGB picker hide/show, and selftest coverage.
I have tested and am using these changes for the Magic Home RGBW controller:

RGB Mode:



White Mode:
HA light entity:
Essentially this PR implements a request for RGB+separate white channel from https://www.elektroda.pl/rtvforum/topic4003384.html
MQTT structure
cmnd/<device>/led_basecolor_rgbRRGGBBhexcmnd/<device>/led_enableWhitecmnd/<device>/led_enableAll0or1cmnd/<device>/led_dimmer0–100<device>/led_basecolor_rgb/getRRGGBBhex<device>/led_colorMode/get"rgb"or"white"<device>/led_enableAll/get0or1<device>/led_dimmer/get0–100HA discover payload:
{ "rgb_cmd_tpl": "{{'#%02x%02x%02x0000'|format(red,green,blue)}}", "rgb_val_tpl": "{{ value[0:2]|int(base=16) }},{{ value[2:4]|int(base=16) }},{{ value[4:6]|int(base=16) }}", "rgb_stat_t": "~/led_basecolor_rgb/get", "rgb_cmd_t": "cmnd/<device>/led_basecolor_rgb", "whit_cmd_t": "cmnd/<device>/led_enableWhite", "whit_scl": 100, "clrm_stat_t": "~/led_colorMode/get", "stat_t": "~/led_enableAll/get", "cmd_t": "cmnd/<device>/led_enableAll", "bri_stat_t": "~/led_dimmer/get", "bri_cmd_t": "cmnd/<device>/led_dimmer", "bri_scl": 100 }@openshwprojects, thank you for all your great work in making this project possible. Please let me know your feedback and whether exposing this feature as a new flag is an acceptable approach.