jnimmo / hass-dmx

Home Assistant DMX over IP Integration
MIT License
107 stars 47 forks source link

RGBW Fixture control interface issue #60

Open geniusled opened 3 years ago

geniusled commented 3 years ago

Hello and thanks for the awesome code, i started playing with HASS.io recently and learning python. ive been finally able to replace the stage lighting software ive been using for automation (what a nightmware) with HASS.io using this plugin to send data to networked artnet lights.

ive configured my fixtures/channels inside the configuration.yaml and i have set 2 fixtures as RGBW (12v rgbw "dumb" strip) they are discovered as entities automatically upon restart and respond accurately.

my issue is with the control interface given for these fixtures. when the dialog open, i can choose RGB value with the color picker (manages RGB values only) and the white channel separately. for some reason, i am not able to set RGB to off (0,0,0) and only use the white channel (0,0,0,255) like other light fixtures outside this plugin(example : wled device).

the color brightness fader control does not work. if i set value to 0, nothing happens (other non dmx light fixtures will set rgb to 0 normally) if i drag value along fader, wierd fader jumps happen on the interface but no changes on the light.

Would this be user setup error or an issue with the library? How to resolve? Thanks for your dedicated time.

configuration.yaml snippet

light:

  • platform: dmx host: 192.168.2.78 port: 6454 dmx_channels: 512 default_level: 255 universe: 0 devices:
    • channel: 4 name: Tv RGBW type: rgbw
    • channel: 8 name: Kitchen RGBW type: rgbw
robot256 commented 3 years ago

I see the same behavior with my RGBW light strip controller. Actually, I see the issue in the hass-dmx code is conversion from HS color to RGB, without any available brightness information in the color channel itself:

https://github.com/jnimmo/hass-dmx/blob/ebbb6930b75774ba3a381f5274d10f1b1f2b6064/custom_components/dmx/light.py#L414-L417

https://github.com/jnimmo/hass-dmx/blob/ebbb6930b75774ba3a381f5274d10f1b1f2b6064/custom_components/dmx/light.py#L518-L519

From reading the Light Entity docs, it looks like the problem could be resolved by adding explicit support for color_mode and supported_color_modes. The Feature Map entries for "SUPPORT_COLOR" and "SUPPORT_WHITE_VALUE" will be removed in the next month or two so this is a required update.

If the dmx integration properly reports that an entity supports COLOR_MODE_RGBW, then HA will send the rgbw_color attribute that includes correctly scaled R,G,B values, which encode the "color brightness" value we need.

EDIT: I see in the Developer Tools display that HA appears to be automatically putting the light into RGBW mode. But it's still true that neither the "rgb_color" nor the "rgbw_color" attributes respond to the "Color Brightness" slider in the color picker.

EDIT2: I noodled around with the Python code and found that even though the light is in "rgbw" mode, only "white_value" and "hs_color" attributes are received by the async_turn_on function. I wonder what will let the full rgbw tuple come through in the arguments list.